- 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;
- }
- }
- }
-