Package tigase.workgroupqueues.scheduler

## Interface Controller

- All Known Implementing Classes:
    `DefaultController`

      @Bean(name="Controller",
            active=true)
      public interface Controller

  Controller interface to rule them all and call Scheduler.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addAgent​(Agent agent)` | Add new agent.
    `void` | `addUser​(User user)` | Add user to waiting queue.
    `Room` | `createRoomInstance​(Queue queue, User user)` | Creates instance of `Room` instance.
    `java.util.Collection<ISequenceAction>` | `getAddAgentToRoomActions​(Queue queue, User user, Agent agent, Room room)` | Returns collection of `Actions` to add `Agent` to room in MUC Component.
    `Queue` | `getQueue​(BareJID jid)` | Return `Queue` by JabberID.
    `int` | `getQueueUserPosition​(User user)` | Returns position of user in his queue.
    `int` | `getQueueUserWaitingTime​(User user)` | Estimated waiting time to handle user.
    `java.util.Collection<ISequenceAction>` | `getRoomCreateActions​(Queue queue, User user, Room room)` | Returns collection of `Actions` to create room in MUC Component.
    `void` | `offerAccepted​(Offer offer)` | Offer is accepted.
    `void` | `offerRejected​(Offer offer)` | Offer is rejected and it will return to waiting queue.
    `void` | `removeAgent​(Agent agent)` | Remove agent (because agent is no longe available for Workgroup Queues Component).
    `void` | `removeUser​(User user)` | Remove user/
    `void` | `sendNotifications()` | Sends all notifications to all users and all agents.
    `void` | `updateAgent​(Agent agent)` | Update status of agent.
    `void` | `updateUser​(User user)` | Update status of user.

- - ### Method Detail

    - #### addAgent

          void addAgent​(Agent agent)

      Add new agent.
      Parameters:
        `agent` - agent to add.

    - #### addUser

          void addUser​(User user)

      Add user to waiting queue.
      Parameters:
        `user` - user to add.

    - #### createRoomInstance

          Room createRoomInstance​(Queue queue,
                                  User user)
                           throws TigaseStringprepException

      Creates instance of `Room` instance. Do not creates Room on MUC Component!
      Parameters:
        `queue` - queue.
        `user` - user.
      Returns:
        instance of `Room` class.
      Throws:
        `TigaseStringprepException` - when invalid JID is processed somewhere.

    - #### getAddAgentToRoomActions

          java.util.Collection<ISequenceAction> getAddAgentToRoomActions​(Queue queue,
                                                                         User user,
                                                                         Agent agent,
                                                                         Room room)

      Returns collection of `Actions` to add `Agent` to room in MUC Component. Actions must be exevuted in `Sequencer`.
      Parameters:
        `queue` - queue.
        `user` - user.
        `agent` - agent.
        `room` - room.
      Returns:
        collections of `Actions`.

    - #### getQueue

          Queue getQueue​(BareJID jid)

      Return `Queue` by JabberID.
      Parameters:
        `jid` - JID of workgroup queue.
      Returns:
        queue or `null` if queue doesn't exists.

    - #### getQueueUserPosition

          int getQueueUserPosition​(User user)

      Returns position of user in his queue.
      Parameters:
        `user` - user
      Returns:
        position in queue.

    - #### getQueueUserWaitingTime

          int getQueueUserWaitingTime​(User user)

      Estimated waiting time to handle user.
      Parameters:
        `user` - user.
      Returns:
        time in seconds.

    - #### getRoomCreateActions

          java.util.Collection<ISequenceAction> getRoomCreateActions​(Queue queue,
                                                                     User user,
                                                                     Room room)

      Returns collection of `Actions` to create room in MUC Component. Actions must be executed in `Sequencer`.
      Parameters:
        `queue` - queue
        `user` - user
        `room` - room
      Returns:
        collections of `Actions`.

    - #### offerAccepted

          void offerAccepted​(Offer offer)

      Offer is accepted. Agent should be invited, room created, etc.
      Parameters:
        `offer` - offer to be accepted.

    - #### offerRejected

          void offerRejected​(Offer offer)

      Offer is rejected and it will return to waiting queue.
      Parameters:
        `offer` - offer to be rejected.

    - #### removeAgent

          void removeAgent​(Agent agent)

      Remove agent (because agent is no longe available for Workgroup Queues Component).
      Parameters:
        `agent` - agent to be removed.

    - #### removeUser

          void removeUser​(User user)

      Remove user/
      Parameters:
        `user` - user to be removed.

    - #### sendNotifications

          void sendNotifications()

      Sends all notifications to all users and all agents.

    - #### updateAgent

          void updateAgent​(Agent agent)

      Update status of agent.
      Parameters:
        `agent` - agent.

    - #### updateUser

          void updateUser​(User user)

      Update status of user.
      Parameters:
        `user` - user.