Merge changes If0630105,I9d2d5e61,I1cea2a32,Icc05b6a7,Ic57eb4f8, ...
[packetcable.git] / packetcable-driver / src / main / java / org / umu / cops / prpep / COPSPepMsgSender.java
index f1ba5c474e08b1d86098733098d7a9a1f598d4b0..7bb35ce28b898989aa8d0338758a8652eb747b76 100644 (file)
@@ -6,10 +6,10 @@
 
 package org.umu.cops.prpep;
 
+import org.umu.cops.COPSMsgSender;
 import org.umu.cops.stack.*;
 import org.umu.cops.stack.COPSClientSI.CSIType;
 import org.umu.cops.stack.COPSContext.RType;
-import org.umu.cops.stack.COPSHeader.ClientType;
 import org.umu.cops.stack.COPSReason.ReasonCode;
 import org.umu.cops.stack.COPSReportType.ReportType;
 
@@ -25,23 +25,7 @@ import java.util.Set;
  * @version COPSPepMsgSender.java, v 2.00 2004
  *
  */
-public class COPSPepMsgSender {
-
-    /**
-     * Socket connection to PDP
-     */
-    protected Socket _sock;
-
-    /**
-     * The client-type identifies the policy client
-     */
-    protected ClientType _clientType;
-
-    /**
-     * The client handle is used to uniquely identify a particular
-     * PEP's request for a client-type
-     */
-    protected COPSHandle _handle;
+public class COPSPepMsgSender extends COPSMsgSender {
 
     /**
      * Create a COPSPepMsgSender
@@ -50,32 +34,8 @@ public class COPSPepMsgSender {
      * @param clientHandle      client handle
      * @param sock              socket of PDP connection
      */
-    public COPSPepMsgSender (ClientType clientType, COPSHandle clientHandle, Socket sock) {
-        // COPS Handle
-        _handle = clientHandle;
-        _clientType = clientType;
-
-        _sock = sock;
-    }
-
-    /**
-     * Return client handle
-     *
-     * @return   a COPSHandle
-     *
-     */
-    public COPSHandle getClientHandle() {
-        return _handle;
-    }
-
-    /**
-     * Return client-type
-     *
-     * @return   a short
-     *
-     */
-    public ClientType getClientType() {
-        return _clientType;
+    public COPSPepMsgSender(short clientType, COPSHandle clientHandle, Socket sock) {
+        super(clientType, clientHandle, sock);
     }
 
     /**
@@ -177,11 +137,9 @@ public class COPSPepMsgSender {
      *   The Synchronize State Complete is sent by the PEP to the PDP after
      *   the PDP sends a synchronize state request to the PEP and the PEP has
      *   finished synchronization.
-     *
      * @throws   COPSPepException
-     *
      */
-    public void sendSyncComplete() throws COPSPepException {
+    public void sendSyncComplete() throws COPSException {
         final COPSSyncStateMsg msg = new COPSSyncStateMsg(_clientType, _handle, null);
         try {
             msg.writeData(_sock);
@@ -195,11 +153,9 @@ public class COPSPepMsgSender {
      * When sent from the PEP this message indicates to the remote PDP that
      * the state identified by the client handle is no longer
      * available/relevant.
-     *
      * @throws   COPSPepException
-     *
      */
-    public void sendDeleteRequest() throws COPSPepException {
+    public void sendDeleteRequest() throws COPSException {
         // *** TODO: send a real reason
         final COPSReason reason = new COPSReason(ReasonCode.UNSPECIFIED, ReasonCode.NA);
         final COPSDeleteMsg msg = new COPSDeleteMsg(_clientType, _handle, reason, null);