2 * (c) 2015 Cable Television Laboratories, Inc. All rights reserved.
7 import org.pcmm.gates.ITransactionID.GateCommandType;
8 import org.pcmm.gates.impl.PCMMGateReq;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11 import org.umu.cops.COPSStateMan;
12 import org.umu.cops.prpdp.COPSPdpDataProcess;
13 import org.umu.cops.prpdp.COPSPdpReqStateMan;
14 import org.umu.cops.stack.COPSError;
16 import java.util.HashMap;
20 public class PCMMPdpDataProcess implements COPSPdpDataProcess {
22 public final static Logger logger = LoggerFactory.getLogger(PCMMPdpDataProcess.class);
25 public Map getRemovePolicy(final COPSPdpReqStateMan man) {
26 logger.info("Retrieving the remove policy");
27 // TODO - Implement me
32 public Map getInstallPolicy(final COPSPdpReqStateMan man) {
33 logger.info("Retrieving the remove policy");
34 // TODO - Implement me
39 public void setClientData(final COPSPdpReqStateMan man, final Map<String, String> reqSIs) {
40 logger.info("Setting the client data");
41 // TODO - Implement me
45 * Fail report received
46 * @param man - the state manager
47 * @param gateMsg - the gate request message
49 public void failReport(final COPSPdpReqStateMan man, final PCMMGateReq gateMsg) {
50 logger.info("Fail Report notified with error - " + gateMsg.getError().toString());
51 // TODO - Implement me
55 public void failReport(final COPSPdpReqStateMan man, final Map<String, String> reportSIs) {
56 logger.info("Fail report notified");
57 // TODO - Implement me
61 public void successReport(final COPSPdpReqStateMan man, final Map<String, String> reportSIs) {
62 logger.info("Success report notified");
63 // TODO - Implement me
67 * Positive report received
68 * @param man - the state manager
69 * @param gateMsg - the gate request message
71 public void successReport(final COPSPdpReqStateMan man, final PCMMGateReq gateMsg) {
72 logger.info("Success Report notified.");
74 if ( gateMsg.getTransactionID().getGateCommandType().equals(GateCommandType.GATE_DELETE_ACK)) {
75 logger.info("GateDeleteAck: GateID = " + gateMsg.getGateID().getGateID());
76 if (gateMsg.getGateID().getGateID() == PCMMGlobalConfig.getGateID1())
77 PCMMGlobalConfig.setGateID1(0);
78 if (gateMsg.getGateID().getGateID() == PCMMGlobalConfig.getGateID2())
79 PCMMGlobalConfig.setGateID2(0);
82 if ( gateMsg.getTransactionID().getGateCommandType().equals(GateCommandType.GATE_SET_ACK)) {
83 logger.info("GateSetAck : GateID = " + gateMsg.getGateID().getGateID());
84 if (0 == PCMMGlobalConfig.getGateID1())
85 PCMMGlobalConfig.setGateID1(gateMsg.getGateID().getGateID());
86 if (0 == PCMMGlobalConfig.getGateID2())
87 PCMMGlobalConfig.setGateID2(gateMsg.getGateID().getGateID());
92 * Accounting report received
93 * @param man - the state manager
94 * @param gateMsg - the gate request message
96 public void acctReport(final PCMMPdpReqStateMan man, final PCMMGateReq gateMsg) {
97 logger.info("Acct Report notified.");
98 // TODO - Impelement me
102 public void acctReport (final COPSPdpReqStateMan man, final Map reportSIs) {
103 logger.info("Acct Report notified.");
104 // TODO - had to implement but do not know what to do here
108 public void notifyNoAcctReport(final COPSPdpReqStateMan man) {
109 logger.info("No Acct Report notified.");
110 // TODO - Impelement me
114 public void notifyNoKAliveReceived(final COPSStateMan man) {
115 logger.info("Notify No K alive received.");
116 // TODO - Impelement me
120 public void notifyClosedConnection(final COPSStateMan man, final COPSError error) {
121 logger.info("Connection was closed by PEP");
122 // TODO - Implement me
126 public void notifyDeleteRequestState(final COPSPdpReqStateMan man) {
127 logger.info("Delete request state notified");
128 // TODO - Impelement me
132 public void closeRequestState(final COPSStateMan man) {
133 logger.info("Close request state notified");
134 // TODO - Impelement me