Merge changes If0630105,I9d2d5e61,I1cea2a32,Icc05b6a7,Ic57eb4f8, ...
[packetcable.git] / packetcable-driver / src / main / java / org / umu / cops / COPSMsgSender.java
1 package org.umu.cops;
2
3 import org.umu.cops.stack.COPSHandle;
4
5 import java.net.Socket;
6
7 /**
8  * Abstract COPS Message sender
9  */
10 public abstract class COPSMsgSender {
11
12     /**
13      * COPS client-type that identifies the policy client
14      */
15     protected final short _clientType;
16
17     /**
18      * COPS client handle used to uniquely identify a particular
19      * PEP's request for a client-type
20      */
21     protected final COPSHandle _handle;
22
23     /**
24      * Socket connected to PEP
25      */
26     protected final Socket _sock;
27
28     public COPSMsgSender(final short clientType, final COPSHandle handle, final Socket sock) {
29         if (handle == null) throw new IllegalArgumentException("Client handle must not be null");
30         if (sock == null) throw new IllegalArgumentException("Socket must not be null");
31         this._clientType = clientType;
32         this._handle = handle;
33         this._sock = sock;
34     }
35
36     /**
37      * Gets the client handle
38      * @return   Client's <tt>COPSHandle</tt>
39      */
40     public COPSHandle getClientHandle() {
41         return _handle;
42     }
43
44     /**
45      * Gets the client-type
46      * @return   Client-type value
47      */
48     public short getClientType() {
49         return _clientType;
50     }
51
52 }