def _toState(self, state, *args, **kwargs):
        """
        Transition to the next state.

        @param state: Name of the next state.
        """
        try:
            method = getattr(self, '_state_%s' % state)
        except AttributeError:
            raise ValueError("No such state %r" % state)

        log.msg("%s: to state %r" % (self.__class__.__name__, state))
        self._state = state
        method(*args, **kwargs)
Transition to the next state.

        @param state: Name of the next state.