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 AgentCompleteEvent is triggered when at the end of a call if the caller
21   * was connected to an agent.<br>
22   * It is implemented in <code>apps/app_queue.c</code>.<br>
23   * Available since Asterisk 1.2
24   * 
25   * @author srt
26   * @version $Id: AgentCompleteEvent.java,v 1.2 2005/08/28 09:45:18 srt Exp $
27   * @since 0.2
28   */
29  public class AgentCompleteEvent extends AbstractAgentEvent
30  {
31      /***
32       * Serial version identifier.
33       */
34      private static final long serialVersionUID = 2108033737226142194L;
35  
36      private Long holdTime;
37      private Long talkTime;
38      private String reason;
39  
40      public AgentCompleteEvent(Object source)
41      {
42          super(source);
43      }
44  
45      /***
46       * Returns the amount of time the caller was on hold.
47       * 
48       * @return the amount of time the caller was on hold in seconds.
49       */
50      public Long getHoldTime()
51      {
52          return holdTime;
53      }
54  
55      /***
56       * Sets the amount of time the caller was on hold.
57       * 
58       * @param holdtime the amount of time the caller was on hold in seconds.
59       */
60      public void setHoldTime(Long holdtime)
61      {
62          this.holdTime = holdtime;
63      }
64  
65      /***
66       * Returns the amount of time the caller talked to the agent.
67       * 
68       * @return the amount of time the caller talked to the agent in seconds.
69       */
70      public Long getTalkTime()
71      {
72          return talkTime;
73      }
74  
75      /***
76       * Sets the amount of time the caller talked to the agent.
77       * 
78       * @param talkTime the amount of time the caller talked to the agent in
79       *            seconds.
80       */
81      public void setTalkTime(Long talkTime)
82      {
83          this.talkTime = talkTime;
84      }
85  
86      /***
87       * Returns if the agent or the caller terminated the call.
88       * 
89       * @return "agent" if the agent terminated the call, "caller" if the caller
90       *         terminated the call.
91       */
92      public String getReason()
93      {
94          return reason;
95      }
96  
97      /***
98       * Sets if the agent or the caller terminated the call.
99       * 
100      * @param reason "agent" if the agent terminated the call, "caller" if the
101      *            caller terminated the call.
102      */
103     public void setReason(String reason)
104     {
105         this.reason = reason;
106     }
107 }