2 * Copyright (c) 2014, 2015 Cable Television Laboratories, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
11 import org.pcmm.gates.ITransactionID.GateCommandType;
12 import org.pcmm.gates.impl.PCMMGateReq;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15 import org.umu.cops.COPSStateMan;
16 import org.umu.cops.prpdp.COPSPdpDataProcess;
17 import org.umu.cops.prpdp.COPSPdpReqStateMan;
18 import org.umu.cops.stack.COPSError;
20 import java.util.HashMap;
24 public class PCMMPdpDataProcess implements COPSPdpDataProcess {
26 public final static Logger logger = LoggerFactory.getLogger(PCMMPdpDataProcess.class);
29 public Map getRemovePolicy(final COPSPdpReqStateMan man) {
30 logger.info("Retrieving the remove policy");
31 // TODO - Implement me
36 public Map getInstallPolicy(final COPSPdpReqStateMan man) {
37 logger.info("Retrieving the remove policy");
38 // TODO - Implement me
43 public void setClientData(final COPSPdpReqStateMan man, final Map<String, String> reqSIs) {
44 logger.info("Setting the client data");
45 // TODO - Implement me
49 * Fail report received
50 * @param man - the state manager
51 * @param gateMsg - the gate request message
53 public void failReport(final COPSPdpReqStateMan man, final PCMMGateReq gateMsg) {
54 logger.info("Fail Report notified with error - " + gateMsg.getError().toString());
55 // TODO - Implement me
59 public void failReport(final COPSPdpReqStateMan man, final Map<String, String> reportSIs) {
60 logger.info("Fail report notified");
61 // TODO - Implement me
65 public void successReport(final COPSPdpReqStateMan man, final Map<String, String> reportSIs) {
66 logger.info("Success report notified");
67 // TODO - Implement me
71 * Positive report received
72 * @param man - the state manager
73 * @param gateMsg - the gate request message
75 public void successReport(final COPSPdpReqStateMan man, final PCMMGateReq gateMsg) {
76 logger.info("Success Report notified.");
78 if ( gateMsg.getTransactionID().getGateCommandType().equals(GateCommandType.GATE_DELETE_ACK)) {
79 logger.info("GateDeleteAck: GateID = " + gateMsg.getGateID().getGateID());
80 if (gateMsg.getGateID().getGateID() == PCMMGlobalConfig.getGateID1())
81 PCMMGlobalConfig.setGateID1(0);
82 if (gateMsg.getGateID().getGateID() == PCMMGlobalConfig.getGateID2())
83 PCMMGlobalConfig.setGateID2(0);
86 if ( gateMsg.getTransactionID().getGateCommandType().equals(GateCommandType.GATE_SET_ACK)) {
87 logger.info("GateSetAck : GateID = " + gateMsg.getGateID().getGateID());
88 if (0 == PCMMGlobalConfig.getGateID1())
89 PCMMGlobalConfig.setGateID1(gateMsg.getGateID().getGateID());
90 if (0 == PCMMGlobalConfig.getGateID2())
91 PCMMGlobalConfig.setGateID2(gateMsg.getGateID().getGateID());
96 * Accounting report received
97 * @param man - the state manager
98 * @param gateMsg - the gate request message
100 public void acctReport(final PCMMPdpReqStateMan man, final PCMMGateReq gateMsg) {
101 logger.info("Acct Report notified.");
102 // TODO - Impelement me
106 public void acctReport (final COPSPdpReqStateMan man, final Map reportSIs) {
107 logger.info("Acct Report notified.");
108 // TODO - had to implement but do not know what to do here
112 public void notifyNoAcctReport(final COPSPdpReqStateMan man) {
113 logger.info("No Acct Report notified.");
114 // TODO - Impelement me
118 public void notifyNoKAliveReceived(final COPSStateMan man) {
119 logger.info("Notify No K alive received.");
120 // TODO - Impelement me
124 public void notifyClosedConnection(final COPSStateMan man, final COPSError error) {
125 logger.info("Connection was closed by PEP");
126 // TODO - Implement me
130 public void notifyDeleteRequestState(final COPSPdpReqStateMan man) {
131 logger.info("Delete request state notified");
132 // TODO - Impelement me
136 public void closeRequestState(final COPSStateMan man) {
137 logger.info("Close request state notified");
138 // TODO - Impelement me