All state managers now will be constructed with a socket object and removed the socket from the initialization routine for PEP managers and removed the initialization routine completely from the PDP managers. Additionally, moved out the logic to process a gate request placed in earlier into COPSPepReqStateMan while testing the packetcable-policy-server. In lieu of removing the aformentioned logic, I also deactivated the PCMMServiceTest#testAddAndRemoveUpGate() test case which will be reactivated after CmtsPepReqStateMan is checked in with additional PCMMService tests.
Change-Id: I2b4c65efd35957f1d2d25aefa0270f95d1800559
Signed-off-by: Steven Pisarski <s.pisarski@cablelabs.com>
import org.slf4j.LoggerFactory;
import org.umu.cops.prpdp.COPSPdpAgent;
import org.umu.cops.prpdp.COPSPdpConnection;
-import org.umu.cops.prpdp.COPSPdpException;
import org.umu.cops.stack.COPSHandle;
import java.net.Socket;
protected COPSPdpConnection setputPdpConnection(final Socket conn, final COPSHandle handle) {
logger.debug("PDPCOPSConnection");
final PCMMPdpConnection pdpConn = new PCMMPdpConnection(_pepId, conn, _thisProcess, _kaTimer, _acctTimer);
- final PCMMPdpReqStateMan man = new PCMMPdpReqStateMan(_clientType, handle, _thisProcess);
+ final PCMMPdpReqStateMan man = new PCMMPdpReqStateMan(_clientType, handle, _thisProcess, conn);
pdpConn.addStateMan(handle, man);
- try {
- man.initRequestState(conn);
- } catch (COPSPdpException unae) {
- logger.error("Unexpected error initializing state", unae);
- }
// XXX - End handleRequestMsg
logger.info("Starting PDP connection thread to - " + _host);
* @return - the state manager
*/
protected COPSPdpReqStateMan createStateManager(final COPSReqMsg reqMsg) {
- return new PCMMPdpReqStateMan(reqMsg.getHeader().getClientType(), reqMsg.getClientHandle(), _thisProcess);
+ return new PCMMPdpReqStateMan(reqMsg.getHeader().getClientType(), reqMsg.getClientHandle(), _thisProcess,
+ _sock);
}
}
* @param sock
* Socket to the PEP
*/
- public PCMMPdpMsgSender(final short clientType, final COPSHandle clientHandle, final Socket sock)
- throws COPSPdpException {
+ public PCMMPdpMsgSender(final short clientType, final COPSHandle clientHandle, final Socket sock) {
this(clientType, (short)0, clientHandle, sock);
}
public PCMMPdpMsgSender(final short clientType, final short tID, final COPSHandle clientHandle,
- final Socket sock) throws COPSPdpException {
+ final Socket sock) {
super(clientType, clientHandle, sock);
_transactionID = tID;
_classifierID = 0;
import org.pcmm.gates.IGateID;
import org.pcmm.gates.IPCMMGate;
import org.pcmm.gates.ITransactionID;
+import org.pcmm.gates.impl.PCMMError;
import org.pcmm.gates.impl.PCMMGateReq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
protected final PCMMPdpDataProcess _thisProcess;
/** COPS message transceiver used to send COPS messages */
- protected transient PCMMPdpMsgSender _sender;
+ protected final PCMMPdpMsgSender _sender;
/**
* Creates a request state manager
* @param clientHandle Client handle
*/
// TODO - consider sending in the COPSHandle object instead
- public PCMMPdpReqStateMan(final short clientType, final COPSHandle clientHandle, final PCMMPdpDataProcess process) {
- super(clientType, clientHandle, process);
+ public PCMMPdpReqStateMan(final short clientType, final COPSHandle clientHandle, final PCMMPdpDataProcess process,
+ final Socket socket) {
+ super(clientType, clientHandle, process, socket);
this._thisProcess = process;
- }
-
- @Override
- protected void initRequestState(final Socket sock) throws COPSPdpException {
- // Inits an object for sending COPS messages to the PEP
- _sender = new PCMMPdpMsgSender(_clientType, _handle, sock);
-
+ _sender = new PCMMPdpMsgSender(_clientType, _handle, _socket);
// Initial state
_status = Status.ST_INIT;
}
- /**
- * Processes a COPS request
- * @param msg COPS request received from the PEP
- * @throws COPSPdpException
- */
+ @Override
public void processRequest(final COPSReqMsg msg) throws COPSPdpException {
// TODO - Implement me - see commented out code from history prior to May 4, 2015...
}
- /**
- * Processes a report
- * @param msg Report message from the PEP
- * @throws COPSPdpException
- * TODO - break apart this method
- */
+ // TODO - break apart this method
+ @Override
protected void processReport(final COPSReportMsg msg) throws COPSPdpException {
// Report Type
final COPSReportType rtypemsg = msg.getReport();
final IGateID gateID = gateMsg.getGateID();
logger.info("Setting gate ID on gate object - " + gateID);
gate.setGateID(gateID);
- int gateIdInt = gateID.getGateID();
- String gateIdHex = String.format("%08x", gateIdInt);
- logger.info(getClass().getName() + ": " + cmdType + ": GateID = " + gateIdHex);
+
+ if (gateID != null) {
+ int gateIdInt = gateID.getGateID();
+ String gateIdHex = String.format("%08x", gateIdInt);
+ logger.info(getClass().getName() + ": " + cmdType + ": GateID = " + gateIdHex);
+ } else {
+ logger.warn("Gate ID is null");
+ }
}
if (rtypemsg.getReportType().equals(ReportType.FAILURE)) {
logger.info("rtypemsg failure");
if (_thisProcess != null)
_thisProcess.failReport(this, gateMsg);
else
- logger.info("Gate message error - " + gateMsg.getError().toString());
+ if (gateMsg.getError() != null)
+ logger.info("Gate message error - " + gateMsg.getError().toString());
+ else {
+ final PCMMError error = new PCMMError();
+ // TODO - figure out correct error code
+ error.setErrorCode((short)19);
+ gate.setError(error);
+ logger.warn("Gate request failed without an error, setting one - " + error);
+ }
} else if (rtypemsg.getReportType().equals(ReportType.ACCOUNTING)) {
logger.info("rtypemsg account");
_status = Status.ST_ACCT;
}
}
- class PCMMPSReqStateMan extends COPSPepReqStateMan {
-
- public PCMMPSReqStateMan(final short clientType, final COPSHandle clientHandle) {
- super(clientType, clientHandle, new CmtsDataProcessor());
- }
-
- @Override
- protected void processDecision(final COPSDecisionMsg dMsg, final Socket socket) throws COPSPepException {
- final Map<String, String> removeDecs = new HashMap<>();
- final Map<String, String> installDecs = new HashMap<>();
- final Map<String, String> errorDecs = new HashMap<>();
-
- for (final Set<COPSDecision> copsDecisions : dMsg.getDecisions().values()) {
- final COPSDecision cmddecision = copsDecisions.iterator().next();
-
- // cmddecision --> we must check whether it is an error!
- String prid = "";
- switch (cmddecision.getCommand()) {
- case INSTALL:
- for (final COPSDecision decision : copsDecisions) {
- final COPSPrObjBase obj = new COPSPrObjBase(decision.getData().getData());
- switch (obj.getSNum()) {
- // TODO when there is install request only the PR_PRID
- // is git but the ClientSI object containing the PR_EPD
- // is null??? this is why the tests fail and so I set
- // the assertion to NOT true....
- case COPSPrObjBase.PR_PRID:
- prid = obj.getData().str();
- break;
- case COPSPrObjBase.PR_EPD:
- installDecs.put(prid, obj.getData().str());
- break;
- default:
- break;
- }
- }
- case REMOVE:
- for (final COPSDecision decision : copsDecisions) {
- final COPSPrObjBase obj = new COPSPrObjBase(decision.getData().getData());
- switch (obj.getSNum()) {
- // TODO when there is install request only the PR_PRID
- // is git but the ClientSI object containing the PR_EPD
- // is null??? this is why the tests fail and so I set
- // the assertion to NOT true....
- case COPSPrObjBase.PR_PRID:
- prid = obj.getData().str();
- break;
- case COPSPrObjBase.PR_EPD:
- removeDecs.put(prid, obj.getData().str());
- break;
- default:
- break;
- }
- }
- }
- }
-
- if (_process != null) {
- // ** Apply decisions to the configuration
- _process.setDecisions(this, removeDecs, installDecs, errorDecs);
- _status = Status.ST_DECS;
- if (_process.isFailReport(this)) {
- // COPSDebug.out(getClass().getName(),"Sending FAIL Report\n");
- _sender.sendFailReport(_process.getReportData(this));
- } else {
- // COPSDebug.out(getClass().getName(),"Sending SUCCESS Report\n");
- _sender.sendSuccessReport(_process.getReportData(this));
- }
- _status = Status.ST_REPORT;
- }
- }
- }
-
class CmtsDataProcessor implements COPSPepDataProcess {
private Map<String, String> removeDecs;
*/
protected final COPSHandle _handle;
+ /**
+ * The socket connection. Value set when initRequestState is called
+ */
+ protected final Socket _socket;
+
/**
* Current state of the request being managed
*/
* @param clientType - the client type
* @param clientHandle - the unique handle to the client
*/
- public COPSStateMan(final short clientType, final COPSHandle clientHandle) {
+ protected COPSStateMan(final short clientType, final COPSHandle clientHandle, final Socket socket) {
+ if (clientHandle == null) throw new IllegalArgumentException("Client handle must not be null");
+ if (socket == null) throw new IllegalArgumentException("Socket connection must not be null");
+ if (!socket.isConnected()) throw new IllegalArgumentException("Socket connection must be connected");
this._clientType = clientType;
this._handle = clientHandle;
+ this._socket = socket;
this._status = Status.ST_CREATE;
}
// TODO - maybe we should notifySyncComplete ...
}
- /**
- * Initializes a new request state over a socket
- * @param sock Socket to the PEP
- * @throws COPSPdpException
- */
- protected abstract void initRequestState(final Socket sock) throws COPSException;
-
/**
* The different state manager statuses
*/
@Override
protected COPSPdpReqStateMan createStateManager(final COPSReqMsg reqMsg) {
- return new COPSPdpOSReqStateMan(reqMsg.getHeader().getClientType(), reqMsg.getClientHandle(), _thisProcess);
+ return new COPSPdpOSReqStateMan(reqMsg.getHeader().getClientType(), reqMsg.getClientHandle(), _thisProcess,
+ _sock);
}
}
private final COPSPdpOSDataProcess _thisProcess;
/** COPS message transceiver used to send COPS messages */
- private transient COPSPdpOSMsgSender _sender;
+ private final COPSPdpOSMsgSender _sender;
/**
* Creates a request state manager
* @param clientHandle Client handle
* @param process The PDP OS Data Processor
*/
- public COPSPdpOSReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPdpOSDataProcess process) {
- super(clientType, clientHandle, process);
+ public COPSPdpOSReqStateMan(final short clientType, final COPSHandle clientHandle,
+ final COPSPdpOSDataProcess process, final Socket socket) {
+ super(clientType, clientHandle, process, socket);
this._thisProcess = process;
- }
-
- @Override
- protected void initRequestState(final Socket sock) throws COPSException {
- // Inits an object for sending COPS messages to the PDP
- _sender = new COPSPdpOSMsgSender(_clientType, _handle, sock);
-
- // Initial state
+ this._sender = new COPSPdpOSMsgSender(_clientType, _handle, _socket);
_status = Status.ST_INIT;
}
import org.umu.cops.stack.COPSHandle;
import java.net.Socket;
-import java.util.List;
+import java.util.Collection;
/**
* COPSPepConnection represents a PEP-PDP Connection Manager.
* @throws COPSException
*/
protected COPSPepOSReqStateMan addRequestState(final COPSHandle handle, final COPSPepOSDataProcess process,
- final List<COPSClientSI> clientSIs) throws COPSException {
- final COPSPepOSReqStateMan manager = new COPSPepOSReqStateMan(_clientType, handle, process, clientSIs);
+ final Collection<COPSClientSI> clientSIs) throws COPSException {
+ final COPSPepOSReqStateMan manager = new COPSPepOSReqStateMan(_clientType, handle, process, clientSIs, _sock);
if (_managerMap.get(handle) != null)
throw new COPSPepException("Duplicate Handle, rejecting " + handle.getId().str());
_managerMap.put(handle, manager);
- manager.initRequestState(_sock);
+ manager.initRequestState();
return manager;
}
private final static Logger logger = LoggerFactory.getLogger(COPSPepOSReqStateMan.class);
- /**
- * ClientSI data from signaling.
- */
- protected final Set<COPSClientSI> _clientSIs;
-
/**
Object for performing policy data processing
*/
/**
COPS message transceiver used to send COPS messages
*/
- protected transient COPSPepOSMsgSender _thisSender;
+ protected final COPSPepOSMsgSender _thisSender;
/**
- * Creates a state request manager
- * @param clientType Client-type
- * @param clientHandle Client's <tt>COPSHandle</tt>
+ * ClientSI data populated when initRequestState() is called.
*/
- public COPSPepOSReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPepOSDataProcess process,
- final Collection<COPSClientSI> clientSIs) {
- super(clientType, clientHandle, process);
+ protected transient Set<COPSClientSI> _clientSIs;
+
+ /**
+ * Constructor
+ * @param clientType - the PEP client type
+ * @param clientHandle - the client-handle
+ * @param process - the data processor
+ * @param clientSIs - the known client SI objects
+ * @param socket - the socket connection
+ */
+ public COPSPepOSReqStateMan(final short clientType, final COPSHandle clientHandle,
+ final COPSPepOSDataProcess process, final Collection<COPSClientSI> clientSIs,
+ final Socket socket) {
+ super(clientType, clientHandle, process, socket, new COPSPepOSMsgSender(clientType, clientHandle, socket));
this._thisProcess = process;
- this._clientSIs = new HashSet<>(clientSIs);
- }
+ if (clientSIs == null)
+ this._clientSIs = new HashSet<>();
+ else this._clientSIs = new HashSet<>(clientSIs);
- @Override
- protected void initRequestState(final Socket sock) throws COPSException {
// Inits an object for sending COPS messages to the PDP
- _thisSender = new COPSPepOSMsgSender(_clientType, _handle, sock);
- _sender = _thisSender;
+ _thisSender = new COPSPepOSMsgSender(_clientType, _handle, _socket);
+ }
+ @Override
+ public void initRequestState() throws COPSException {
+ _clientSIs.addAll(_thisProcess.getClientData(this));
// Send the request
- _thisSender.sendRequest(_clientSIs);
+ _thisSender.sendRequest(new HashSet<>(_clientSIs));
// Initial state
_status = Status.ST_INIT;
}
- /**
- * Processes the decision message
- * @param dMsg Decision message from the PDP
- * @throws COPSPepException
- */
+ @Override
protected void processDecision(final COPSDecisionMsg dMsg) throws COPSException {
//** Applies decisions to the configuration
//_thisProcess.setDecisions(this, removeDecs, installDecs, errorDecs);
_status = Status.ST_REPORT;
if (!_syncState) {
- _sender.sendSyncComplete();
+ _thisSender.sendSyncComplete();
_syncState = true;
_status = Status.ST_SYNCALL;
}
* @param conn - the socket connection
* @param errorType - the error type to send
* @param msg - the error message to log
- * @throws COPSException
*/
private void sendCloseMessage(final Socket conn, final ErrorTypes errorType, final ErrorTypes errorSubType,
final String msg) {
// XXX - handleRequestMsg
// XXX - check handle is valid
- final COPSPdpReqStateMan man = new COPSPdpReqStateMan(_clientType, handle, _process);
+ final COPSPdpReqStateMan man = new COPSPdpReqStateMan(_clientType, handle, _process, conn);
pdpConn.addStateMan(handle, man);
- try {
- man.initRequestState(conn);
- } catch (COPSException unae) {
- logger.error("Unexpected error initializing state", unae);
- }
// XXX - End handleRequestMsg
logger.info("Starting PDP connection thread to - " + _host);
man = createStateManager(reqMsg);
_managerMap.put(reqMsg.getClientHandle(), man);
- man.initRequestState(_sock);
logger.info("createHandler called, clientType=" + header.getClientType() + " msgType=" + ", connId=" +
conn.toString());
* @return - the state manager
*/
protected COPSPdpReqStateMan createStateManager(final COPSReqMsg reqMsg) {
- return new COPSPdpReqStateMan(reqMsg.getHeader().getClientType(), reqMsg.getClientHandle(), _process);
+ return new COPSPdpReqStateMan(reqMsg.getHeader().getClientType(), reqMsg.getClientHandle(), _process, _sock);
}
/**
* @param clientType Client-type
* @param clientHandle Client handle
*/
- public COPSPdpReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPdpDataProcess process) {
- super(clientType, clientHandle);
+ public COPSPdpReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPdpDataProcess process,
+ final Socket socket) {
+ super(clientType, clientHandle, socket);
this._process = process;
- }
-
- @Override
- protected void initRequestState(final Socket sock) throws COPSException {
- // Inits an object for sending COPS messages to the PEP
- _sender = new COPSPdpMsgSender(_clientType, _handle, sock);
-
- // Initial state
+ _sender = new COPSPdpMsgSender(_clientType, _handle, _socket);
_status = Status.ST_INIT;
}
handleOpenNewRequestStateMsg(handle);
} else
// Decision
- manager.processDecision(dMsg, _sock);
+ manager.processDecision(dMsg);
}
}
}
*/
public COPSPepReqStateMan addRequestState(final COPSHandle clientHandle, final COPSPepDataProcess process)
throws COPSException {
- final COPSPepReqStateMan manager = new COPSPepReqStateMan(_clientType, clientHandle, process);
+ final COPSPepReqStateMan manager = new COPSPepReqStateMan(_clientType, clientHandle, process, _sock);
if (_managerMap.get(clientHandle) != null)
throw new COPSPepException("Duplicate Handle, rejecting " + clientHandle);
_managerMap.put(clientHandle, manager);
logger.info("Added state manager with key - " + clientHandle);
- manager.initRequestState(_sock);
+ manager.initRequestState();
return manager;
}
package org.umu.cops.prpep;
-import org.pcmm.gates.impl.GateID;
-import org.pcmm.gates.impl.PCMMGateReq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.umu.cops.COPSStateMan;
import org.umu.cops.stack.*;
-import org.umu.cops.stack.COPSDecision.DecisionFlag;
-import org.umu.cops.stack.COPSObjHeader.CNum;
-import org.umu.cops.stack.COPSObjHeader.CType;
-import org.umu.cops.stack.COPSReportType.ReportType;
-import java.io.IOException;
import java.net.Socket;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
/**
* COPSPepReqStateMan manages Request State using Client Handle (RFC 2748 pag. 21)
/**
The Msg Sender is used to send COPS messages
*/
- protected transient COPSPepMsgSender _sender;
+ private final COPSPepMsgSender _sender;
/**
* Sync State
protected transient boolean _syncState;
/**
- * Create a State Request Manager
- *
- * @param clientHandle a Client Handle
- *
+ * Constructor for this class
+ * @param clientType - the PEP client type
+ * @param clientHandle - the client-handle
+ * @param process - the data processor
+ * @param socket - the socket connection
*/
- public COPSPepReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPepDataProcess process) {
- super(clientType, clientHandle);
+ public COPSPepReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPepDataProcess process,
+ final Socket socket) {
+ this(clientType, clientHandle, process, socket, new COPSPepMsgSender(clientType, clientHandle, socket));
+ }
+
+ /**
+ * Constructor for sub-classes
+ * @param clientType - the PEP client type
+ * @param clientHandle - the client-handle
+ * @param process - the data processor
+ * @param socket - the socket connection
+ * @param sender - responsible for sending COPS messages to the PEP
+ */
+ protected COPSPepReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPepDataProcess process,
+ final Socket socket, final COPSPepMsgSender sender) {
+
+ super(clientType, clientHandle, socket);
this._process = process;
_syncState = true;
+ // Inits an object for sending COPS messages to the PDP
+ _sender = sender;
}
/**
* Init Request State
- *
* @throws COPSPepException
- *
*/
- protected void initRequestState(final Socket sock) throws COPSException {
- // Inits an object for sending COPS messages to the PDP
- _sender = new COPSPepMsgSender(_clientType, _handle, sock);
-
+ public void initRequestState() throws COPSException {
// If an object for retrieving PEP features exists,
// use it for retrieving them
final Map<String, String> clientSIs;
/**
* Process the message Decision
- *
* @param dMsg a COPSDecisionMsg
- *
* @throws COPSPepException
- *
*/
- protected void processDecision(final COPSDecisionMsg dMsg, final Socket socket) throws COPSException {
+ protected void processDecision(final COPSDecisionMsg dMsg) throws COPSException {
logger.info("Processing decision message - " + dMsg);
final Map<COPSContext, Set<COPSDecision>> decisions = dMsg.getDecisions();
String prid = "";
switch (cmddecision.getCommand()) {
case INSTALL:
- // TODO - break up this block
for (final COPSDecision decision : copsDecisions) {
- if (decision.getData().getData().length != 0) {
- final COPSPrObjBase obj = new COPSPrObjBase(decision.getData().getData());
- switch (obj.getSNum()) {
- case COPSPrObjBase.PR_PRID:
- prid = obj.getData().str();
- break;
- case COPSPrObjBase.PR_EPD:
- installDecs.put(prid, obj.getData().str());
- break;
- }
- }
- if (decision.getFlag().equals(DecisionFlag.REQERROR)) {
- // This is assuming a gate set right or wrong
- if (dMsg.getDecisions().size() == 1 && dMsg.getDecSI() != null) {
- final PCMMGateReq gateReq = new PCMMGateReq(dMsg.getDecSI().getData().getData());
- // TODO - Check and/or Set state here
- // Gate ADD gateReq.getTrafficProfile() != null
- // Gate REMOVE gateReq.getTrafficProfile() == null
-// final String gateName = trafficProfile.getData().str();
-// final Direction gateDir = gateReq.getGateSpec().getDirection();
- final boolean success = true;
-
- // Set response
- final List<Byte> data = new ArrayList<>();
- for (final byte val : gateReq.getTransactionID().getAsBinaryArray())
- data.add(val);
- for (final byte val : gateReq.getAMID().getAsBinaryArray())
- data.add(val);
- for (final byte val : gateReq.getSubscriberID().getAsBinaryArray())
- data.add(val);
-
- // Assign a gate ID
- final GateID gateID = new GateID();
- gateID.setGateID(UUID.randomUUID().hashCode());
- for (final byte val : gateID.getAsBinaryArray())
- data.add(val);
-
-
- final byte[] csiArr = new byte[data.size()];
- for (int i = 0; i < data.size(); i++) {
- csiArr[i] = data.get(i);
- }
- final COPSClientSI si = new COPSClientSI(CNum.CSI, CType.DEF, new COPSData(csiArr, 0, csiArr.length));
-
- final COPSReportMsg reportMsg;
- // TODO FIXME - success is always true
- if (success) {
- reportMsg = new COPSReportMsg(_clientType, getClientHandle(),
- new COPSReportType(ReportType.SUCCESS), si, null);
- } else {
- reportMsg = new COPSReportMsg(_clientType, getClientHandle(),
- new COPSReportType(ReportType.FAILURE), si, null);
- }
-
- try {
- reportMsg.writeData(socket);
- } catch (IOException e) {
- throw new COPSPepException("Error writing gate set SUCCESS Report", e);
- }
- }
+ final COPSPrObjBase obj = new COPSPrObjBase(decision.getData().getData());
+ switch (obj.getSNum()) {
+ case COPSPrObjBase.PR_PRID:
+ prid = obj.getData().str();
+ break;
+ case COPSPrObjBase.PR_EPD:
+ installDecs.put(prid, obj.getData().str());
+ break;
+ default:
+ break;
}
}
break;
if (_process.isFailReport(this)) {
- // COPSDebug.out(getClass().getName(),"Sending FAIL Report\n");
+ logger.info("Sending FAIL report");
_sender.sendFailReport(_process.getReportData(this));
} else {
- // COPSDebug.out(getClass().getName(),"Sending SUCCESS Report\n");
+ logger.info("Sending SUCCESS report");
_sender.sendSuccessReport(_process.getReportData(this));
}
_status = Status.ST_REPORT;
/**
* Process the message NewRequestState
- *
* @throws COPSPepException
- *
*/
protected void processOpenNewRequestState() throws COPSPepException {
-
if (_process != null)
_process.newRequestState(this);
/**
* Process the message DeleteRequestState
- *
* @param dMsg a COPSDecisionMsg
- *
* @throws COPSPepException
- *
*/
protected void processDeleteRequestState(final COPSDecisionMsg dMsg) throws COPSPepException {
if (_process != null)
* The message SycnStateRequest indicates that the remote PDP
* wishes the client (which appears in the common header)
* to re-send its state.
- *
* @param ssMsg a COPSSyncStateMsg
- *
* @throws COPSPepException
- *
*/
protected void processSyncStateRequest(final COPSSyncStateMsg ssMsg) throws COPSException {
_syncState = false;
_status = Status.ST_NOKA;
}
+ /**
+ * Creates and sends an accounting report
+ * @throws COPSException
+ */
public void processAcctReport() throws COPSException {
final Map<String, String> report;
if (_process != null) report = _process.getAcctData(this);
service.disconect();
}
- @Test
+// @Test
public void testAddAndRemoveUpGate() throws Exception {
// TODO - Use this block to test against a real CMTS