Fixed building of models, moved code into directory structure.
[packetcable.git] / protocol_plugins.packetcable / src / main / java / org / pcmm / gates / IGateSpec.java
1 /**
2  @header@
3  */
4
5
6 package org.pcmm.gates;
7
8 import org.pcmm.base.IPCMMBaseObject;
9
10 /**
11  * <p>
12  * The GateSpec describes some high-level attributes of the Gate, and contains
13  * information regarding the treatment of other objects specified in the Gate
14  * message.
15  * </p>
16  *
17  *
18  *
19  *
20  */
21 public interface IGateSpec extends IPCMMBaseObject {
22
23     static final byte SNUM = 5;
24     static final byte STYPE = 1;
25     static final short LENGTH = 16;
26
27     /**
28      * <p>
29      * Direction indicates whether the Gate is for an upstream or downstream
30      * flow. Depending on this direction, the CMTS MUST reserve and activate the
31      * DOCSIS flows accordingly. For Multicast Gates the CMTS needs to only
32      * support flows or gates in the downstream direction.
33      * </p>
34      *
35      *
36      */
37     public enum Direction {
38
39         UPSTREAM((byte) 1), DOWNSTREAM((byte) 0);
40
41         private Direction(byte value) {
42             this.value = value;
43         }
44
45         public byte getValue() {
46             return value;
47         }
48
49         @Override
50         public String toString() {
51             switch (value) {
52             case 1:
53                 return "Upstream";
54             default:
55                 return "Downstream";
56             }
57         }
58
59         private byte value;
60
61         public static Direction valueOf(byte v) {
62             switch (v) {
63             case 0:
64                 return Direction.DOWNSTREAM;
65             case 1:
66                 return Direction.UPSTREAM;
67             default:
68                 throw new IllegalArgumentException("not supported value");
69             }
70         }
71
72     };
73
74     /**
75      *
76      */
77     public enum DSCPTOS {
78
79         ENABLE((byte) 1), OVERRIDE((byte) 0);
80
81         private DSCPTOS(byte value) {
82             this.value = value;
83         }
84
85         public byte getValue() {
86             return value;
87         }
88
89         @Override
90         public String toString() {
91             switch (value) {
92             case 1:
93                 return "Enable";
94             default:
95                 return "Override";
96             }
97         }
98
99         public static DSCPTOS valueOf(byte v) {
100             switch (v) {
101             case 0:
102                 return DSCPTOS.OVERRIDE;
103             case 1:
104                 return DSCPTOS.ENABLE;
105             default:
106                 throw new IllegalArgumentException("not supported value");
107             }
108         }
109
110         private byte value;
111
112     };
113
114     /**
115      * <p>
116      * provides a way for the Application Manager and the Policy Server to group
117      * Gates into different classes with different authorization
118      * characteristics. For example, one could use the SessionClassID to
119      * represent some prioritization or preemption scheme that would allow
120      * either the Policy Server or the CMTS to preempt a pre-authorized Gate in
121      * favor of allowing a new Gate with a higher priority to be authorized.
122      * </p>
123      *
124      * @return session class ID;
125      */
126     ISessionClassID getSessionClassID();
127
128     /**
129      * <p>
130      * sets the session class ID;
131      * </p>
132      * <p>
133      * SessionClassID is a 1-byte unsigned integer value which identifies the
134      * proper admission control policy or parameters to be applied for this
135      * Gate. The SessionClassID is a bit field, defined as follows: Bit 0-2:
136      * Priority, a number from 0 to 7, where 0 is low priority and 7 is high.
137      * Bit 3: Preemption, set to enable preemption of bandwidth allocated to
138      * lower priority sessions if necessary (if supported). Bit 4-7:
139      * Configurable, default to 0
140      * </p>
141      */
142     void setSessionClassID(ISessionClassID id);
143
144     /**
145      *
146      * @return direction.
147      */
148     Direction getDirection();
149
150     /**
151      * sets the direction
152      *
153      * @param direction
154      *            Direction
155      */
156     void setDirection(Direction direction);
157
158     /**
159      * Authorized Timer limits the amount of time the authorization must remain
160      * valid before it is reserved
161      *
162      * @return time in ms;
163      */
164     short getTimerT1();
165
166     /**
167      * sets the authorized timer
168      *
169      * @param authTimer
170      *            : authorized timer
171      */
172     void setTimerT1(short authTimer);
173
174     /**
175      * Reserved Timer limits the amount of time the reservation must remain
176      * valid before the resources are committed
177      *
178      * @return time in ms;
179      */
180     short getTimerT2();
181
182     /**
183      * sets the reserved timer.
184      *
185      * @param timer
186      */
187     void setTimerT2(short timer);
188
189     /**
190      * Committed Timer limits the amount of time a committed service flow may
191      * remain idle.
192      *
193      * @return time in ms;
194      */
195     short getTimerT3();
196
197     /**
198      * sets the committed timer.
199      *
200      * @param t
201      *            timer
202      */
203     void setTimerT3(short t);
204
205     /**
206      * Committed Recovery Timer limits the amount of time that a committed
207      * service flow can remain without a subsequent refresh message from the
208      * PS/AM once the PS/AM has been notified of inactivity
209      *
210      * @return time in ms;
211      */
212     short getTimerT4();
213
214     /**
215      * sets the Committed Recovery Timer.
216      *
217      * @param t
218      *            timer
219      */
220     void setTimerT4(short t);
221
222     /**
223      *
224      * @param dscpTos
225      */
226     void setDSCP_TOSOverwrite(DSCPTOS dscpTos);
227
228     /**
229      *
230      * @return DSCP/TOS
231      */
232     DSCPTOS getDSCP_TOSOverwrite();
233
234     /**
235      *
236      * @return
237      */
238     byte getDSCP_TOSMask();
239
240     /**
241      *
242      * @param dscp_tos_mask
243      */
244     void setDSCP_TOSMask(byte dscp_tos_mask);
245
246 }