1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.protocol.event;
import java.util.*;
import net.java.sip.communicator.service.protocol.*;
/**
* <tt>MessageWaitingEvent<tt> indicates a message waiting event
* is received.
*
* @author Damian Minkov
*/
public class MessageWaitingEvent
extends EventObject
{
/**
* Serial version UID.
*/
private static final long serialVersionUID = 0L;
/**
* The URI we can use to reach messages from provider that is firing
* the event.
*/
private String account;
/**
* Number of new/unread messages.
*/
private int unreadMessages = 0;
/**
* Number of old/read messages.
*/
private int readMessages = 0;
/**
* Number of new/unread urgent messages.
*/
private int unreadUrgentMessages = 0;
/**
* Number of old/read messages.
*/
private int readUrgentMessages = 0;
/**
* The message type for this event.
*/
private OperationSetMessageWaiting.MessageType messageType;
/**
* The list of notification messages concerned by this event.
*/
private List<NotificationMessage> messageList;
/**
* Constructs the Event with the given source, typically the provider and
* number of messages.
*
* @param messageType the message type for this event.
* @param source the protocol provider from which this event is coming.
* @param account the account URI we can use to reach the messages.
* @param unreadMessages the unread messages.
* @param readMessages the read messages.
* @param unreadUrgentMessages the unread urgent messages.
* @param readUrgentMessages the read urgent messages.
*/
public MessageWaitingEvent(
ProtocolProviderService source,
OperationSetMessageWaiting.MessageType messageType,
String account,
int unreadMessages,
int readMessages,
int unreadUrgentMessages,
int readUrgentMessages)
{
this( source,
messageType,
account,
unreadMessages,
readMessages,
unreadUrgentMessages,
readUrgentMessages,
null);
}
/**
* Constructs the Event with the given source, typically the provider and
* number of messages.
*
* @param messageType the message type for this event.
* @param source the protocol provider from which this event is coming.
* @param account the account URI we can use to reach the messages.
* @param unreadMessages the unread messages.
* @param readMessages the read messages.
* @param unreadUrgentMessages the unread urgent messages.
* @param readUrgentMessages the read urgent messages.
* @param messages the list of messages that this event is about.
*/
public MessageWaitingEvent(
ProtocolProviderService source,
OperationSetMessageWaiting.MessageType messageType,
String account,
int unreadMessages,
int readMessages,
int unreadUrgentMessages,
int readUrgentMessages,
List<NotificationMessage> messages)
{
super(source);
this.messageType = messageType;
this.account = account;
this.unreadMessages = unreadMessages;
this.readMessages = readMessages;
this.unreadUrgentMessages = unreadUrgentMessages;
this.readUrgentMessages = readUrgentMessages;
this.messageList = messages;
}
/**
* Returns the <tt>ProtocolProviderService</tt> which originated this event.
*
* @return the source <tt>ProtocolProviderService</tt>
*/
public ProtocolProviderService getSourceProvider()
{
return (ProtocolProviderService) getSource();
}
/**
* The URI we can use to reach messages from provider that is firing
* the event.
* @return account URI.
*/
public String getAccount()
{
return account;
}
/**
* Number of new/unread messages.
* @return Number of new/unread messages.
*/
public int getUnreadMessages()
{
return unreadMessages;
}
/**
* Number of old/read messages.
* @return Number of old/read messages.
*/
public int getReadMessages()
{
return readMessages;
}
/**
* Number of new/unread urgent messages.
* @return Number of new/unread urgent messages.
*/
public int getUnreadUrgentMessages()
{
return unreadUrgentMessages;
}
/**
* Number of old/read messages.
* @return Number of old/read messages.
*/
public int getReadUrgentMessages()
{
return readUrgentMessages;
}
/**
* The message type for this event.
* @return the message type.
*/
public OperationSetMessageWaiting.MessageType getMessageType()
{
return messageType;
}
public Iterator<NotificationMessage> getMessages()
{
if (messageList != null)
return messageList.iterator();
return null;
}
}
|