KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > web > talk > plugin > SessionInfo


1 package com.quikj.application.web.talk.plugin;
2
3 import com.quikj.server.web.*;
4
5 import java.util.*;
6
7 public class SessionInfo
8 {
9     public SessionInfo(long session, EndPointInterface calling)
10     {
11         sessionId = session;
12         endPoints.addElement(calling);
13     }
14     
15     public void addEndPoint(EndPointInterface endpoint)
16     {
17         endPoints.addElement(endpoint);
18     }
19     
20     public boolean removeEndPoint(EndPointInterface endpoint)
21     {
22         int index = indexOf(endpoint);
23         
24         if (index >= 0)
25         {
26             endPoints.removeElementAt(index);
27         }
28         else
29         {
30             return false;
31         }
32         return true;
33     }
34     
35     public boolean replaceEndPoint (int index, EndPointInterface endpoint)
36     {
37         if (index < numEndPoints())
38         {
39             endPoints.set(index, endpoint);
40         }
41         else
42         {
43             return false;
44         }
45         return true;
46     }
47     
48     public long getSessionId()
49     {
50         return sessionId;
51     }
52     
53     public int numEndPoints()
54     {
55         return endPoints.size();
56     }
57     
58     public EndPointInterface getCallingEndPoint()
59     {
60         // the calling endpoint is always the first one
61
return elementAt(0);
62     }
63     
64     public EndPointInterface elementAt(int index)
65     {
66         return (EndPointInterface)endPoints.elementAt(index);
67     }
68     
69     public int indexOf(EndPointInterface endpoint) // returns -1 if the endpoint is not found
70
{
71         return endPoints.indexOf(endpoint);
72     }
73     
74     public void setConnected(boolean connected)
75     {
76         this.connected = connected;
77     }
78     
79     public boolean isConnected()
80     {
81         return connected;
82     }
83     
84     public void setRequestId(int request_id)
85     {
86         requestId = request_id;
87     }
88     
89     public int getRequestId()
90     {
91         return requestId;
92     }
93     
94     public ConferenceBridge getConferenceBridge()
95     {
96         return conferenceBridge;
97     }
98     
99     public void setConferenceBridge (ConferenceBridge bridge)
100     {
101         conferenceBridge = bridge;
102     }
103     
104     public void setSessionId (long new_session_id)
105     {
106         sessionId = new_session_id;
107     }
108         
109     /** Getter for property billingId.
110      * @return Value of property billingId.
111      */

112     public java.lang.String JavaDoc getBillingId()
113     {
114         return billingId;
115     }
116     
117     /** Setter for property billingId.
118      * @param billingId New value of property billingId.
119      */

120     public void setBillingId(java.lang.String JavaDoc billingId)
121     {
122         this.billingId = billingId;
123     }
124     
125     /** Getter for property encryptedKey.
126      * @return Value of property encryptedKey.
127      */

128     public java.lang.String JavaDoc getEncryptedKey()
129     {
130         return encryptedKey;
131     }
132     
133     /** Setter for property encryptedKey.
134      * @param encryptedKey New value of property encryptedKey.
135      */

136     public void setEncryptedKey(java.lang.String JavaDoc encryptedKey)
137     {
138         this.encryptedKey = encryptedKey;
139     }
140     
141     private long sessionId;
142     private Vector endPoints = new Vector();
143     private boolean connected = false;
144     private int requestId = -1;
145     private ConferenceBridge conferenceBridge = null;
146     private String JavaDoc billingId = null;
147     private String JavaDoc encryptedKey = null;
148 }
149
150
151
152
153
154
155
156
157
Popular Tags