2004-08-17 09:44:36 +02:00
|
|
|
/**
|
2004-11-03 00:37:00 +01:00
|
|
|
* $RCSfile$
|
|
|
|
* $Revision$
|
|
|
|
* $Date$
|
|
|
|
*
|
|
|
|
* Copyright 2003-2004 Jive Software.
|
|
|
|
*
|
|
|
|
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2004-08-17 09:44:36 +02:00
|
|
|
|
2004-08-16 02:57:36 +02:00
|
|
|
package org.jivesoftware.smackx.workgroup.agent;
|
|
|
|
|
|
|
|
import org.jivesoftware.smack.packet.Presence;
|
|
|
|
|
|
|
|
/**
|
2004-08-17 09:44:36 +02:00
|
|
|
* An agent represents the agent role in a workgroup queue.
|
|
|
|
*
|
|
|
|
* @author Matt Tucker
|
2004-08-16 02:57:36 +02:00
|
|
|
*/
|
|
|
|
public class Agent {
|
|
|
|
|
2004-08-17 09:44:36 +02:00
|
|
|
private String user;
|
|
|
|
private int maxChats = -1;
|
|
|
|
private int currentChats = -1;
|
|
|
|
private Presence presence = null;
|
2004-08-16 02:57:36 +02:00
|
|
|
|
|
|
|
/**
|
2004-08-17 09:44:36 +02:00
|
|
|
* Creates an Agent.
|
|
|
|
*
|
|
|
|
* @param user the agent's JID.
|
|
|
|
* @param currentChats the number of chats the agent is currently in.
|
|
|
|
* @param maxChats the maximum number of chats the agent is allowed in.
|
|
|
|
* @param presence the agent's presence.
|
2004-08-16 02:57:36 +02:00
|
|
|
*/
|
2004-08-17 09:44:36 +02:00
|
|
|
public Agent(String user, int currentChats, int maxChats, Presence presence) {
|
|
|
|
this.user = user;
|
|
|
|
this.currentChats = currentChats;
|
|
|
|
this.maxChats = maxChats;
|
|
|
|
this.presence = presence;
|
|
|
|
}
|
2004-08-16 02:57:36 +02:00
|
|
|
|
2004-08-17 09:44:36 +02:00
|
|
|
/**
|
|
|
|
* Return this agent's JID.
|
|
|
|
*
|
|
|
|
* @return this agent's JID.
|
2004-08-16 02:57:36 +02:00
|
|
|
*/
|
2004-08-17 09:44:36 +02:00
|
|
|
public String getUser() {
|
|
|
|
return user;
|
|
|
|
}
|
2004-08-16 02:57:36 +02:00
|
|
|
|
2004-08-17 09:44:36 +02:00
|
|
|
/**
|
|
|
|
* Return the maximum number of chats this agent can participate in.
|
|
|
|
*
|
|
|
|
* @return the maximum number of chats this agent can participate in.
|
|
|
|
*/
|
|
|
|
public int getMaxChats() {
|
|
|
|
return maxChats;
|
|
|
|
}
|
2004-08-16 02:57:36 +02:00
|
|
|
|
2004-08-17 09:44:36 +02:00
|
|
|
/**
|
|
|
|
* Return the number of chats this agent is currently in.
|
|
|
|
*
|
|
|
|
* @return the number of chats this agent is currently in.
|
|
|
|
*/
|
|
|
|
public int getCurrentChats() {
|
|
|
|
return currentChats;
|
|
|
|
}
|
2004-08-16 02:57:36 +02:00
|
|
|
|
2004-08-17 09:44:36 +02:00
|
|
|
/**
|
|
|
|
* Return this agent's presence.
|
|
|
|
*
|
|
|
|
* @return this agent's presence.
|
|
|
|
*/
|
|
|
|
public Presence getPresence() {
|
|
|
|
return presence;
|
|
|
|
}
|
2004-08-16 02:57:36 +02:00
|
|
|
}
|