f9961c404bb938c7d8795e136de52c8514ec3918
[packetcable.git] / packetcable-driver / src / main / java / org / pcmm / PCMMPdpConnection.java
1 /*
2  @header@
3  */
4
5 package org.pcmm;
6
7 import org.umu.cops.prpdp.COPSPdpConnection;
8 import org.umu.cops.prpdp.COPSPdpReqStateMan;
9 import org.umu.cops.stack.COPSPepId;
10 import org.umu.cops.stack.COPSReqMsg;
11
12 import javax.annotation.concurrent.ThreadSafe;
13 import java.net.Socket;
14
15 /**
16  * Class for managing an provisioning connection at the PDP side for receiving and brokering out COPS messages.
17  */
18 @ThreadSafe
19 public class PCMMPdpConnection extends COPSPdpConnection {
20
21     /**
22      *  PDP policy data processor class
23      */
24     protected final PCMMPdpDataProcess _thisProcess;
25
26     /**
27      * Creates a new PDP connection
28      *
29      * @param pepId PEP-ID of the connected PEP
30      * @param sock Socket connected to PEP
31      * @param process Object for processing policy data
32      */
33     public PCMMPdpConnection(final COPSPepId pepId, final Socket sock, final PCMMPdpDataProcess process,
34                              final short kaTimer, final short acctTimer) {
35         super(pepId, sock, process, kaTimer, acctTimer);
36         _thisProcess = process;
37     }
38
39     /**
40      * Returns an instance of a COPSPdpReqStateMan
41      * @param reqMsg - the request on which to create the state manager
42      * @return - the state manager
43      */
44     protected COPSPdpReqStateMan createStateManager(final COPSReqMsg reqMsg) {
45         return new PCMMPdpReqStateMan(reqMsg.getHeader().getClientType(), reqMsg.getClientHandle(), _thisProcess,
46                 _sock);
47     }
48
49 }