1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package net.sf.asterisk.manager;
18
19 import java.io.Serializable;
20 import java.util.ArrayList;
21 import java.util.Collections;
22 import java.util.List;
23
24 /***
25 * @author srt
26 * @version $Id: Queue.java,v 1.3 2005/08/21 22:39:22 srt Exp $
27 */
28 public class Queue implements Serializable
29 {
30 /***
31 * Serial version identifier
32 */
33 private static final long serialVersionUID = -6597536667933738312L;
34 private String name;
35 private Integer max;
36 private List entries;
37
38 public Queue(String name)
39 {
40 this.name = name;
41 this.entries = Collections.synchronizedList(new ArrayList());
42 }
43
44 public String getName()
45 {
46 return name;
47 }
48
49 public Integer getMax()
50 {
51 return max;
52 }
53
54 public void setMax(Integer max)
55 {
56 this.max = max;
57 }
58
59 public List getEntries()
60 {
61 return entries;
62 }
63
64 public void addEntry(Channel entry)
65 {
66 entries.add(entry);
67 }
68
69 public void removeEntry(Channel entry)
70 {
71 entries.remove(entry);
72 }
73
74 public String toString()
75 {
76 StringBuffer sb;
77
78 sb = new StringBuffer(getClass().getName() + ": ");
79
80 sb.append("name='" + getName() + "'; ");
81 sb.append("max='" + getMax() + "'; ");
82 sb.append("entries='" + getEntries() + "'; ");
83 sb.append("systemHashcode=" + System.identityHashCode(this));
84
85 return sb.toString();
86 }
87 }