X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=packetcable-driver%2Fsrc%2Fmain%2Fjava%2Forg%2Fpcmm%2FPCMMPdpMsgSender.java;h=d1560646928fb2a7f04e8dd1530ac2d3502be0c2;hb=896fa34dd5d1779138a10e253a2d21cbac2f1780;hp=91303b1232ce6126ab0e386feb4d9a94389cdbf6;hpb=83c87ccd0cbdf125edfcbe24dd74e6d5f6b72f4e;p=packetcable.git diff --git a/packetcable-driver/src/main/java/org/pcmm/PCMMPdpMsgSender.java b/packetcable-driver/src/main/java/org/pcmm/PCMMPdpMsgSender.java index 91303b1..d156064 100644 --- a/packetcable-driver/src/main/java/org/pcmm/PCMMPdpMsgSender.java +++ b/packetcable-driver/src/main/java/org/pcmm/PCMMPdpMsgSender.java @@ -98,7 +98,7 @@ public class PCMMPdpMsgSender extends COPSMsgSender { final ITransactionID trID = new TransactionID(_transactionID, GateCommandType.GATE_SET); gate.setTransactionID(trID); - // retain the transactionId to gate request mapping for gateID recovery after response + // retain the transactitrIDnumonId to gate request mapping for gateID recovery after response // see PCMMPdpReqStateMan.processReport() final Short trIDnum = trID.getTransactionIdentifier(); logger.info("Adding gate to cache - " + gate + " with key - " + trIDnum); @@ -227,13 +227,43 @@ public class PCMMPdpMsgSender extends COPSMsgSender { * * @throws COPSPdpException */ - public void sendGateInfo() throws COPSPdpException { + public void sendGateInfo(final IPCMMGate gate) throws COPSPdpException { /* * ::= [] [] */ - final COPSSyncStateMsg msg = new COPSSyncStateMsg(getClientType(), _handle, null); + + // added + final ITransactionID trID = new TransactionID(_transactionID, GateCommandType.GATE_INFO); + gate.setTransactionID(trID); + // retain the transactionId to gate request mapping for gateID recovery after response + // see PCMMPdpReqStateMan.processReport() + final Short trIDnum = trID.getTransactionIdentifier(); + logger.info("Adding gate to cache - " + gate + " with key - " + trIDnum); + PCMMGlobalConfig.transactionGateMap.put(trIDnum, gate); + + // gateDelete only requires AMID, subscriberID, and gateID + // remove the gateSpec, traffic profile, and classifiers from original gate request + gate.setGateSpec(null); + gate.setTrafficProfile(null); + gate.setClassifiers(null); + // clear the error object + gate.setError(null); + + + // XXX - GateID + final byte[] data = gate.getData(); + final Set decisionSet = new HashSet<>(); + decisionSet.add(new COPSDecision(CType.DEF, Command.INSTALL, DecisionFlag.REQERROR)); + final Map> decisionMap = new HashMap<>(); + decisionMap.put(new COPSContext(RType.CONFIG, (short)0), decisionSet); + final COPSClientSI clientSD = new COPSClientSI(CNum.DEC, CType.CSI, new COPSData(data, 0, data.length)); + + //final COPSSyncStateMsg msg = new COPSSyncStateMsg(getClientType(), _handle, null); + final COPSDecisionMsg decisionMsg = new COPSDecisionMsg(getClientType(), _handle, decisionMap, null, clientSD); + try { - msg.writeData(_sock); + //msg.writeData(_sock); + decisionMsg.writeData(_sock); } catch (IOException e) { throw new COPSPdpException("Failed to send the GateInfo request", e); }