Cleanup of state managers' interfaces (constructor and init).
[packetcable.git] / packetcable-driver / src / main / java / org / pcmm / PCMMPdpAgent.java
1 /**
2  @header@
3  */
4
5 package org.pcmm;
6
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
9 import org.umu.cops.prpdp.COPSPdpAgent;
10 import org.umu.cops.prpdp.COPSPdpConnection;
11 import org.umu.cops.stack.COPSHandle;
12
13 import java.net.Socket;
14
15 /**
16  * Core PDP agent for provisioning
17  */
18 public class PCMMPdpAgent extends COPSPdpAgent {
19
20     private static final Logger logger = LoggerFactory.getLogger(PCMMPdpAgent.class);
21
22     /** Well-known port for PCMM */
23     public static final int WELL_KNOWN_PDP_PORT = 3918;
24
25     /**
26      * Policy data processing object
27      */
28     private final PCMMPdpDataProcess _thisProcess;
29
30     /**
31      * Creates a PDP Agent
32      *
33      * @param clientType - COPS Client-type
34      * @param psHost - Host to connect to
35      * @param psPort - Port to connect to
36      * @param process - Object to perform policy data processing
37      */
38     public PCMMPdpAgent(final String psHost, final int psPort, final short clientType,
39                         final PCMMPdpDataProcess process) {
40         super(psHost, psPort, clientType, process);
41         _thisProcess = process;
42     }
43
44     @Override
45     protected COPSPdpConnection setputPdpConnection(final Socket conn, final COPSHandle handle) {
46         logger.debug("PDPCOPSConnection");
47         final PCMMPdpConnection pdpConn = new PCMMPdpConnection(_pepId, conn, _thisProcess, _kaTimer, _acctTimer);
48         final PCMMPdpReqStateMan man = new PCMMPdpReqStateMan(_clientType, handle, _thisProcess, conn);
49         pdpConn.addStateMan(handle, man);
50         // XXX - End handleRequestMsg
51
52         logger.info("Starting PDP connection thread to - " + _host);
53         return pdpConn;
54     }
55
56 }
57