View Javadoc

1   /*
2    * Copyright  2004-2005 Stefan Reuter
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *
16   */
17  package net.sf.asterisk.manager.event;
18  
19  /***
20   * An AgentsEvent is triggered for each agent in response to an AgentsAction.<br>
21   * Available since Asterisk 1.2
22   * 
23   * @see net.sf.asterisk.manager.action.AgentsAction
24   * @author srt
25   * @version $Id: AgentsEvent.java,v 1.1 2005/07/15 19:01:33 srt Exp $
26   * @since 0.2
27   */
28  public class AgentsEvent extends ResponseEvent
29  {
30      /***
31       * Serial version identifier
32       */
33      private static final long serialVersionUID = -3619197512835308812L;
34      private String agent;
35      private String name;
36      private String status;
37      private String loggedInChan;
38      private Long loggedInTime;
39      private String talkingTo;
40  
41      /***
42       * @param source
43       */
44      public AgentsEvent(Object source)
45      {
46          super(source);
47      }
48  
49      /***
50       * Returns the agentid.
51       */
52      public String getAgent()
53      {
54          return agent;
55      }
56  
57      /***
58       * Sets the agentid.
59       */
60      public void setAgent(String agent)
61      {
62          this.agent = agent;
63      }
64  
65      /***
66       * Returns the name of this agent.
67       * 
68       * @return the name of this agent
69       */
70      public String getName()
71      {
72          return name;
73      }
74  
75      /***
76       * Sets the name of this agent.
77       * 
78       * @param name the name of this agent
79       */
80      public void setName(String name)
81      {
82          this.name = name;
83      }
84  
85      /***
86       * Returns the status of this agent.<br>
87       * This is one of
88       * <dl>
89       * <dt>"AGENT_LOGGEDOFF"</dt>
90       * <dd>Agent isn't logged in</dd>
91       * <dt>"AGENT_IDLE"</dt>
92       * <dd>Agent is logged in, and waiting for call</dd>
93       * <dt>"AGENT_ONCALL"</dt>
94       * <dd>Agent is logged in, and on a call</dd>
95       * <dt>"AGENT_UNKNOWN"</dt>
96       * <dd>Don't know anything about agent. Shouldn't ever get this.</dd>
97       * </dl>
98       * 
99       * @return the status of this agent
100      */
101     public String getStatus()
102     {
103         return status;
104     }
105 
106     /***
107      * Sets the status of this agent.
108      * 
109      * @param status the status of this agent
110      */
111     public void setStatus(String status)
112     {
113         this.status = status;
114     }
115 
116     /***
117      * Returns the name of channel this agent logged in from.
118      * 
119      * @return the name of the channel this agent logged in from or "n/a" if the
120      *         agent is not logged in.
121      */
122     public String getLoggedInChan()
123     {
124         return loggedInChan;
125     }
126 
127     /***
128      * Sets the name of channel this agent logged in from.
129      * 
130      * @param loggedInChan the name of channel this agent logged in from
131      */
132     public void setLoggedInChan(String loggedInChan)
133     {
134         this.loggedInChan = loggedInChan;
135     }
136 
137     /***
138      * Returns the time (in seconds since 01/01/1970) when the agent logged in.
139      * 
140      * @return the time when the agent logged in or 0 if the user is not logged
141      *         in.
142      */
143     public Long getLoggedInTime()
144     {
145         return loggedInTime;
146     }
147 
148     /***
149      * Sets the time when the agent logged in.
150      * 
151      * @param loggedInTime the time when the agent logged in
152      */
153     public void setLoggedInTime(Long loggedInTime)
154     {
155         this.loggedInTime = loggedInTime;
156     }
157 
158     /***
159      * Returns the numerical Caller*ID of the channel this agent is talking to.
160      * 
161      * @return the numerical Caller*ID of the channel this agent is talking to
162      *         or "n/a" if this agent is talking to nobody.
163      */
164     public String getTalkingTo()
165     {
166         return talkingTo;
167     }
168 
169     /***
170      * Sets the numerical Caller*ID of the channel this agent is talking to.
171      * 
172      * @param talkingTo the numerical Caller*ID of the channel this agent is
173      *            talking to
174      */
175     public void setTalkingTo(String talkingTo)
176     {
177         this.talkingTo = talkingTo;
178     }
179 }