blob: 89a18995f06c02027766df7d5a77a0a5cdba4e0f (
plain)
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
|
/**
* $Revision$
* $Date$
*
* Copyright 2003-2007 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.
*/
package org.jivesoftware.smackx.workgroup;
import java.util.Date;
/**
* An immutable class which wraps up customer-in-queue data return from the server; depending on
* the type of information dispatched from the server, not all information will be available in
* any given instance.
*
* @author loki der quaeler
*/
public class QueueUser {
private String userID;
private int queuePosition;
private int estimatedTime;
private Date joinDate;
/**
* @param uid the user jid of the customer in the queue
* @param position the position customer sits in the queue
* @param time the estimate of how much longer the customer will be in the queue in seconds
* @param joinedAt the timestamp of when the customer entered the queue
*/
public QueueUser (String uid, int position, int time, Date joinedAt) {
super();
this.userID = uid;
this.queuePosition = position;
this.estimatedTime = time;
this.joinDate = joinedAt;
}
/**
* @return the user jid of the customer in the queue
*/
public String getUserID () {
return this.userID;
}
/**
* @return the position in the queue at which the customer sits, or -1 if the update which
* this instance embodies is only a time update instead
*/
public int getQueuePosition () {
return this.queuePosition;
}
/**
* @return the estimated time remaining of the customer in the queue in seconds, or -1 if
* if the update which this instance embodies is only a position update instead
*/
public int getEstimatedRemainingTime () {
return this.estimatedTime;
}
/**
* @return the timestamp of when this customer entered the queue, or null if the server did not
* provide this information
*/
public Date getQueueJoinTimestamp () {
return this.joinDate;
}
}
|