Generalize COPSPepOSConnection as a COPSPepConnection. 58/19658/2
authorSteven Pisarski <s.pisarski@cablelabs.com>
Tue, 5 May 2015 20:14:49 +0000 (14:14 -0600)
committerThomas Kee <xsited@yahoo.com>
Fri, 8 May 2015 19:52:02 +0000 (12:52 -0700)
Removed duplicated logic up to the super.

Change-Id: I489ec7f6221101e8bd4f1f08089055ff154beeb5
Signed-off-by: Steven Pisarski <s.pisarski@cablelabs.com>
packetcable-driver/src/main/java/org/umu/cops/ospep/COPSPepOSConnection.java
packetcable-driver/src/main/java/org/umu/cops/ospep/COPSPepOSReqStateMan.java
packetcable-driver/src/main/java/org/umu/cops/prpep/COPSPepConnection.java
packetcable-driver/src/main/java/org/umu/cops/prpep/COPSPepReqStateMan.java

index 116aeefe32ecb19155770703ae58d10605616ac4..a375d3e1ff5015b16e9a87525d0973ecc3734e04 100644 (file)
@@ -1,59 +1,17 @@
 package org.umu.cops.ospep;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.umu.cops.prpep.COPSPepConnection;
 import org.umu.cops.stack.*;
-import org.umu.cops.stack.COPSHeader.OPCode;
 
-import java.io.IOException;
 import java.net.Socket;
-import java.util.Date;
 import java.util.Hashtable;
 import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * COPSPepConnection represents a PEP-PDP Connection Manager.
  * Responsible for processing messages received from PDP.
  */
-public class COPSPepOSConnection implements Runnable {
-
-    public final static Logger logger = LoggerFactory.getLogger(COPSPepOSConnection.class);
-
-    /** Socket connected to PDP */
-    protected Socket _sock;
-
-    /** Time to wait responses (milliseconds), default is 10 seconds */
-    protected final int _responseTime;
-
-    /** COPS Client-type */
-    protected short _clientType;
-
-    /**
-        Accounting timer value (secs)
-     */
-    protected transient short _acctTimer;
-
-    /**
-        Keep-alive timer value (secs)
-     */
-    protected transient short _kaTimer;
-
-    /**
-     *  Time of the latest keep-alive received
-     */
-    protected Date _lastRecKa;
-
-    /**
-        Maps a COPS Client Handle to a Request State Manager
-     */
-    protected final Map<String, COPSPepOSReqStateMan> _managerMap;
-
-    /**
-        COPS error returned by PDP
-     */
-    protected COPSError _error;
+public class COPSPepOSConnection extends COPSPepConnection {
 
     /**
      * Creates a new PEP connection
@@ -61,46 +19,7 @@ public class COPSPepOSConnection implements Runnable {
      * @param sock          Socket connected to PDP
      */
     public COPSPepOSConnection(final short clientType, final Socket sock) {
-        _clientType = clientType;
-        _sock = sock;
-
-        // Timers
-        _acctTimer = 0;
-        _kaTimer = 0;
-        _responseTime = 10000;
-        _managerMap = new ConcurrentHashMap<>();
-    }
-
-    /**
-     * Gets the response time
-     * @return  Response time value (msecs)
-     */
-    public int getResponseTime() {
-        return _responseTime;
-    }
-
-    /**
-     * Gets the socket connected to the PDP
-     * @return  Socket connected to PDP
-     */
-    public Socket getSocket() {
-        return _sock;
-    }
-
-    /**
-     * Gets keep-alive timer
-     * @return  Keep-alive timer value (secs)
-     */
-    public short getKaTimer () {
-        return _kaTimer;
-    }
-
-    /**
-     * Gets accounting timer
-     * @return  Accounting timer value (secs)
-     */
-    public short getAcctTimer () {
-        return _acctTimer;
+        super(clientType, sock);
     }
 
     /**
@@ -112,256 +31,12 @@ public class COPSPepOSConnection implements Runnable {
         return new Hashtable(_managerMap);
     }
 
-    /**
-     * Checks whether the socket to the PDP is closed or not
-     * @return  <tt>true</tt> if the socket is closed, <tt>false</tt> otherwise
-     */
-    public boolean isClosed() {
-        return _sock.isClosed();
-    }
-
-    /**
-     * Closes the socket
-     *
-     * @throws java.io.IOException
-     */
-    protected void close() throws IOException {
-        _sock.close();
-    }
-
-    /**
-     * Sets keep-alive timer
-     * @param kaTimer   Keep-alive timer value (secs)
-     */
-    public void setKaTimer(short kaTimer) {
-        _kaTimer = kaTimer;
-    }
-
-    /**
-     * Sets accounting timer
-     * @param acctTimer Accounting timer value (secs)
-     */
-    public void setAcctTimer(short acctTimer) {
-        _acctTimer = acctTimer;
-    }
-
-    /**
-     * Message-processing loop
-     */
-    public void run () {
-        Date _lastSendKa = new Date();
-        Date _lastSendAcc = new Date();
-        _lastRecKa = new Date();
-
-        try {
-            while (!_sock.isClosed()) {
-                if (_sock.getInputStream().available() != 0) {
-                    processMessage(_sock);
-                    _lastRecKa = new Date();
-                }
-
-                // Keep Alive
-                if (_kaTimer > 0) {
-                    // Timeout del PDP
-                    int _startTime = (int) (_lastRecKa.getTime());
-                    int cTime = (int) (new Date().getTime());
-
-                    if ((cTime - _startTime) > _kaTimer*1000) {
-                        _sock.close();
-                        // Notify all Request State Managers
-                        notifyNoKAAllReqStateMan();
-                    }
-
-                    // Send to PEP
-                    _startTime = (int) (_lastSendKa.getTime());
-                    cTime = (int) (new Date().getTime());
-
-                    if ((cTime - _startTime) > ((_kaTimer*3/4) * 1000)) {
-                        final COPSKAMsg msg = new COPSKAMsg(null);
-                        COPSTransceiver.sendMsg(msg, _sock);
-                        _lastSendKa = new Date();
-                    }
-                }
-
-                // Accounting
-                if (_acctTimer > 0) {
-                    int _startTime = (int) (_lastSendAcc.getTime());
-                    int cTime = (int) (new Date().getTime());
-
-                    if ((cTime - _startTime) > ((_acctTimer*3/4)*1000)) {
-                        // Notify all Request State Managers
-                        notifyAcctAllReqStateMan();
-                        _lastSendAcc = new Date();
-                    }
-                }
-
-                try {
-                    Thread.sleep(500);
-                } catch (Exception e) {
-                    logger.error("Exception thrown while sleeping", e);
-                }
-            }
-        } catch (Exception e) {
-            logger.error("Error while processing socket messages", e);
-        }
-
-        // connection closed by server
-        // COPSDebug.out(getClass().getName(),"Connection closed by server");
-        try {
-            _sock.close();
-        } catch (IOException e) {
-            logger.error("Unexpected exception closing the socket", e);
-        }
-
-        // Notify all Request State Managers
-        try {
-            notifyCloseAllReqStateMan();
-        } catch (COPSPepException e) {
-            logger.error("Error closing state managers", e);
-        }
-    }
-
-    /**
-     * Gets a COPS message from the socket and processes it
-     * @param conn  Socket connected to the PDP
-     * @throws COPSPepException
-     * @throws COPSException
-     * @throws IOException
-     */
-    protected void processMessage(Socket conn) throws COPSException, IOException {
-        COPSMsg msg = COPSTransceiver.receiveMsg(conn);
-
-        if (msg.getHeader().getOpCode().equals(OPCode.CC)) {
-            handleClientCloseMsg(conn, msg);
-        } else if (msg.getHeader().getOpCode().equals(OPCode.DEC)) {
-            handleDecisionMsg(/*OJO conn, */msg);
-        } else if (msg.getHeader().getOpCode().equals(OPCode.SSQ)) {
-            handleSyncStateReqMsg(conn, msg);
-        } else if (msg.getHeader().getOpCode().equals(OPCode.KA)) {
-            handleKeepAliveMsg(conn, msg);
-        } else {
-            throw new COPSPepException("Message not expected (" + msg.getHeader().getOpCode() + ").");
-        }
-    }
-
-    /**
-     * Handle Client Close Message, close the passed connection
-     *
-     * @param    conn                a  Socket
-     * @param    msg                 a  COPSMsg
-     *
-     *
-     * <Client-Close> ::= <Common Header>
-     *                      <Error>
-     *                      [<Integrity>]
-     *
-     * Not support [<Integrity>]
-     *
-     */
-    private void handleClientCloseMsg(Socket conn, COPSMsg msg) {
-        COPSClientCloseMsg cMsg = (COPSClientCloseMsg) msg;
-        _error = cMsg.getError();
-
-        // COPSDebug.out(getClass().getName(),"Got close request, closing connection " +
-        //  conn.getInetAddress() + ":" + conn.getPort() + ":[Error " + _error.getDescription() + "]");
-
-        try {
-            // Support
-            if (cMsg.getIntegrity() != null)
-                logger.warn("Unsupported objects (Integrity) to connection " + conn.getInetAddress());
-
-            conn.close();
-        } catch (Exception unae) {
-            logger.error("Unexpected exception closing connection", unae);
-        }
-    }
-
-    /**
-     * Gets the COPS error
-     * @return  <tt>COPSError</tt> returned by PDP
-     */
-    protected COPSError getError() {
-        return _error;
-    }
-
-    /**
-     * Handle Keep Alive Message
-     *
-     * <Keep-Alive> ::= <Common Header>
-     *                  [<Integrity>]
-     *
-     * Not support [<Integrity>]
-     *
-     * @param    conn                a  Socket
-     * @param    msg                 a  COPSMsg
-     *
-     */
-    private void handleKeepAliveMsg(Socket conn, COPSMsg msg) {
-        COPSKAMsg cMsg = (COPSKAMsg) msg;
-
-        // COPSDebug.out(getClass().getName(),"Get KAlive Msg");
-
-        // Support
-        if (cMsg.getIntegrity() != null)
-            logger.warn("Unsupported objects (Integrity) to connection " + conn.getInetAddress());
-
-        // must we do anything else?
-    }
-
-    /**
-     * Method handleDecisionMsg
-     *
-     * <Decision Message> ::= <Common Header: Flag SOLICITED>
-     *                          <Client Handle>
-     *                          *(<Decision>) | <Error>
-     *                          [<Integrity>]
-     * <Decision> ::= <Context>
-     *                  <Decision: Flags>
-     *                  [<ClientSI Decision Data: Outsourcing>]
-     * <Decision: Flags> ::= <Command-Code> NULLFlag
-     * <Command-Code> ::= NULLDecision | Install | Remove
-     * <ClientSI Decision Data> ::= <<Install Decision> | <Remove Decision>>
-     * <Install Decision> ::= *(<PRID> <EPD>)
-     * <Remove Decision> ::= *(<PRID> | <PPRID>)
-     *
-     * @param    msg                 a  COPSMsg
-     *
-     */
-    private void handleDecisionMsg(final COPSMsg msg) throws COPSException {
-        final COPSDecisionMsg dMsg = (COPSDecisionMsg) msg;
-        final COPSHandle handle = dMsg.getClientHandle();
-        final COPSPepOSReqStateMan manager = _managerMap.get(handle.getId().str());
+    @Override
+    protected void handleDecisionMsg(final COPSDecisionMsg dMsg) throws COPSException {
+        final COPSPepOSReqStateMan manager = (COPSPepOSReqStateMan)_managerMap.get(dMsg.getClientHandle());
         manager.processDecision(dMsg);
     }
 
-    /**
-     * Method handleSyncStateReqMsg
-     *
-     *              <Synchronize State> ::= <Common Header>
-     *                                      [<Client Handle>]
-     *                                      [<Integrity>]
-     *
-     * @param    conn                a  Socket
-     * @param    msg                 a  COPSMsg
-     *
-     */
-    private void handleSyncStateReqMsg(final Socket conn, final COPSMsg msg) throws COPSException {
-        final COPSSyncStateMsg cMsg = (COPSSyncStateMsg) msg;
-        // COPSHandle handle = cMsg.getClientHandle();
-        // COPSHeader header = cMsg.getHeader();
-
-        // Support
-        if (cMsg.getIntegrity() != null)
-            logger.warn("Unsupported objects (Integrity) to connection " + conn.getInetAddress());
-
-        final COPSPepOSReqStateMan manager = _managerMap.get(cMsg.getClientHandle().getId().str());
-
-        if (manager == null)
-            logger.warn("Unable to find state manager with ID - " + cMsg.getClientHandle().getId().str());
-        else
-            manager.processSyncStateRequest(cMsg);
-    }
-
     /**
      * Adds a new request state
      * @param clientHandle  Client's handle
@@ -372,40 +47,13 @@ public class COPSPepOSConnection implements Runnable {
      */
     protected COPSPepOSReqStateMan addRequestState(final String clientHandle, final COPSPepOSDataProcess process,
                                                    final List<COPSClientSI> clientSIs) throws COPSException {
-        final COPSPepOSReqStateMan manager = new COPSPepOSReqStateMan(_clientType,
-                new COPSHandle(new COPSData(clientHandle)), process, clientSIs);
-        if (_managerMap.get(clientHandle) != null)
+        final COPSHandle handle = new COPSHandle(new COPSData(clientHandle));
+        final COPSPepOSReqStateMan manager = new COPSPepOSReqStateMan(_clientType, handle, process, clientSIs);
+        if (_managerMap.get(handle) != null)
             throw new COPSPepException("Duplicate Handle, rejecting " + clientHandle);
-        _managerMap.put(clientHandle, manager);
+        _managerMap.put(handle, manager);
         manager.initRequestState(_sock);
         return manager;
     }
 
-    /**
-     * Deletes a request state
-     * @param manager   Request state manager
-     * @throws COPSPepException
-     */
-    protected void deleteRequestState(COPSPepOSReqStateMan manager) throws COPSException {
-        manager.finalizeRequestState();
-    }
-
-    private void notifyCloseAllReqStateMan() throws COPSPepException {
-        for (final COPSPepOSReqStateMan man : _managerMap.values()) {
-                man.processClosedConnection(_error);
-        }
-    }
-
-    private void notifyNoKAAllReqStateMan() throws COPSPepException {
-        for (final COPSPepOSReqStateMan man : _managerMap.values()) {
-            man.processNoKAConnection();
-        }
-    }
-
-    private void notifyAcctAllReqStateMan() throws COPSPepException {
-        for (final COPSPepOSReqStateMan man : _managerMap.values()) {
-            man.processAcctReport();
-        }
-    }
-
 }
index ffcd54cf4e314bc24841a4a27eab4048f7642cbc..0361c7bda5de89e4f3e274d08bd40a206f82fc5f 100644 (file)
@@ -2,7 +2,7 @@ package org.umu.cops.ospep;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.umu.cops.COPSStateMan;
+import org.umu.cops.prpep.COPSPepReqStateMan;
 import org.umu.cops.stack.*;
 
 import java.net.Socket;
@@ -11,7 +11,7 @@ import java.util.*;
 /**
  * State manager class for outsourcing requests, at the PEP side.
  */
-public class COPSPepOSReqStateMan extends COPSStateMan {
+public class COPSPepOSReqStateMan extends COPSPepReqStateMan {
 
     private final static Logger logger = LoggerFactory.getLogger(COPSPepOSReqStateMan.class);
 
@@ -42,7 +42,7 @@ public class COPSPepOSReqStateMan extends COPSStateMan {
      */
     public COPSPepOSReqStateMan(final short clientType, final COPSHandle clientHandle, final COPSPepOSDataProcess process,
                                 final Collection<COPSClientSI> clientSIs) {
-        super(clientType, clientHandle);
+        super(clientType, clientHandle, process);
         this._process = process;
         this._clientSIs = new HashSet<>(clientSIs);
         _syncState = true;
index c6173cadd6c6e5612059e698e690a0c02116f695..d80bf63d6e37d4df881dbdc462278d6d2d49ae03 100644 (file)
@@ -11,7 +11,6 @@ import org.slf4j.LoggerFactory;
 import org.umu.cops.stack.*;
 import org.umu.cops.stack.COPSDecision.Command;
 import org.umu.cops.stack.COPSDecision.DecisionFlag;
-import org.umu.cops.stack.COPSHeader.OPCode;
 
 import java.io.IOException;
 import java.net.Socket;
@@ -29,23 +28,23 @@ public class COPSPepConnection implements Runnable {
     private final static Logger logger = LoggerFactory.getLogger(COPSPepConnection.class);
 
     /** Socket connected to PDP */
-    protected Socket _sock;
+    protected final Socket _sock;
 
     /** Time to wait responses (milliseconds), default is 10 seconds */
-    protected int _responseTime;
+    protected transient int _responseTime;
 
     /** COPS Client-type */
-    protected short _clientType;
+    protected final short _clientType;
 
     /**
         Accounting timer value (secs)
      */
-    protected short _acctTimer;
+    protected transient short _acctTimer;
 
     /**
         Keep-alive timer value (secs)
      */
-    protected short _kaTimer;
+    protected transient short _kaTimer;
 
     /**
      *  Time of the latest keep-alive received
@@ -60,7 +59,7 @@ public class COPSPepConnection implements Runnable {
     /**
         COPS error returned by PDP
      */
-    protected COPSError _error;
+    protected transient COPSError _error;
 
     /**
      * Creates a new PEP connection
@@ -78,14 +77,6 @@ public class COPSPepConnection implements Runnable {
         _managerMap = new ConcurrentHashMap<>();
     }
 
-    /**
-     * Gets the response time
-     * @return  Response time value (msecs)
-     */
-    public int getResponseTime() {
-        return _responseTime;
-    }
-
     /**
      * Gets the socket connected to the PDP
      * @return  Socket connected to PDP
@@ -94,22 +85,6 @@ public class COPSPepConnection implements Runnable {
         return _sock;
     }
 
-    /**
-     * Gets keep-alive timer
-     * @return  Keep-alive timer value (secs)
-     */
-    public short getKaTimer () {
-        return _kaTimer;
-    }
-
-    /**
-     * Gets accounting timer
-     * @return  Accounting timer value (secs)
-     */
-    public short getAcctTimer () {
-        return _acctTimer;
-    }
-
     /**
      * Checks whether the socket to the PDP is closed or not
      * @return  <tt>true</tt> if the socket is closed, <tt>false</tt> otherwise
@@ -123,17 +98,8 @@ public class COPSPepConnection implements Runnable {
      *
      * @throws java.io.IOException
      */
-    protected void close()
-    throws IOException {
-        _sock.close();
-    }
-
-    /**
-     * Sets response time
-     * @param respTime  Response time value (msecs)
-     */
-    public void setResponseTime(int respTime) {
-        _responseTime = respTime;
+    public void close() throws IOException {
+        if (! _sock.isClosed()) _sock.close();
     }
 
     /**
@@ -152,6 +118,14 @@ public class COPSPepConnection implements Runnable {
         _acctTimer = acctTimer;
     }
 
+    /**
+     * Method getError
+     * @return   a COPSError
+     */
+    protected COPSError getError()  {
+        return _error;
+    }
+
     /**
      * Message-processing loop
      */
@@ -222,7 +196,7 @@ public class COPSPepConnection implements Runnable {
         // Notify all Request State Managers
         try {
             notifyCloseAllReqStateMan();
-        } catch (COPSPepException e) {
+        } catch (COPSException e) {
             logger.error("Error closing state managers");
         }
     }
@@ -230,27 +204,25 @@ public class COPSPepConnection implements Runnable {
     /**
      * Gets a COPS message from the socket and processes it
      * @param conn  Socket connected to the PDP
-     * @return COPS message type
-     * @throws COPSPepException
      * @throws COPSException
      * @throws IOException
      */
-    protected byte processMessage(final Socket conn) throws COPSException, IOException {
+    protected void processMessage(final Socket conn) throws COPSException, IOException {
         final COPSMsg msg = COPSTransceiver.receiveMsg(conn);
 
         switch (msg.getHeader().getOpCode()) {
             case CC:
                 handleClientCloseMsg(conn, (COPSClientCloseMsg)msg);
-                return (byte)OPCode.CC.ordinal();
+                break;
             case DEC:
                 handleDecisionMsg((COPSDecisionMsg)msg);
-                return (byte)OPCode.DEC.ordinal();
+                break;
             case SSQ:
                 handleSyncStateReqMsg((COPSSyncStateMsg)msg);
-                return (byte)OPCode.SSQ.ordinal();
+                break;
             case KA:
                 handleKeepAliveMsg((COPSKAMsg)msg);
-                return (byte)OPCode.KA.ordinal();
+                break;
             default:
                 throw new COPSPepException("Message not expected (" + msg.getHeader().getOpCode() + ").");
         }
@@ -276,14 +248,6 @@ public class COPSPepConnection implements Runnable {
         }
     }
 
-    /**
-     * Method getError
-     * @return   a COPSError
-     */
-    protected COPSError getError()  {
-        return _error;
-    }
-
     /**
      * Handle Keep Alive Message
      * @param    cMsg                a  COPSKAMsg
@@ -307,7 +271,7 @@ public class COPSPepConnection implements Runnable {
      * Method handleDecisionMsg
      * @param    dMsg                 a  COPSDecisionMsg
      */
-    private void handleDecisionMsg(final COPSDecisionMsg dMsg) throws COPSException {
+    protected void handleDecisionMsg(final COPSDecisionMsg dMsg) throws COPSException {
         final COPSHandle handle = dMsg.getClientHandle();
         final Map<COPSContext, Set<COPSDecision>> decisions = dMsg.getDecisions();
 
@@ -353,7 +317,7 @@ public class COPSPepConnection implements Runnable {
      * Method handleSyncStateReqMsg
      * @param    cMsg                a  COPSSyncStateMsg
      */
-    private void handleSyncStateReqMsg(final COPSSyncStateMsg cMsg) throws COPSPepException {
+    private void handleSyncStateReqMsg(final COPSSyncStateMsg cMsg) throws COPSException {
         if (cMsg.getIntegrity() != null) {
             logger.warn("Unsupported objects (Integrity)");
         }
@@ -389,25 +353,24 @@ public class COPSPepConnection implements Runnable {
      * Method deleteRequestState
      * @param    manager             a  COPSPepReqStateMan
      * @throws   COPSException
-     * @throws   COPSPepException
      */
-    protected void deleteRequestState(COPSPepReqStateMan manager) throws COPSException {
+    public void deleteRequestState(COPSPepReqStateMan manager) throws COPSException {
         manager.finalizeRequestState();
     }
 
-    private void notifyCloseAllReqStateMan() throws COPSPepException {
+    private void notifyCloseAllReqStateMan() throws COPSException {
         for (final COPSPepReqStateMan man: _managerMap.values()) {
             man.processClosedConnection(_error);
         }
     }
 
-    private void notifyNoKAAllReqStateMan() throws COPSPepException {
+    private void notifyNoKAAllReqStateMan() throws COPSException {
         for (final COPSPepReqStateMan man: _managerMap.values()) {
             man.processNoKAConnection();
         }
     }
 
-    private void notifyAcctAllReqStateMan() throws COPSPepException {
+    private void notifyAcctAllReqStateMan() throws COPSException {
         for (final COPSPepReqStateMan man: _managerMap.values()) {
             man.processAcctReport();
         }
index ff07ce672e9ce6bef936fd31f967a24bf8e3135b..0c8024fbf0a3d90f119d22af7320b60cb8745db2 100644 (file)
@@ -260,7 +260,7 @@ public class COPSPepReqStateMan extends COPSStateMan {
      * @throws   COPSPepException
      *
      */
-    protected void processDeleteRequestState(final COPSDecisionMsg dMsg) throws COPSPepException {
+    protected void processDeleteRequestState(final COPSDecisionMsg dMsg) throws COPSException {
         if (_process != null)
             _process.closeRequestState(this);
 
@@ -278,7 +278,7 @@ public class COPSPepReqStateMan extends COPSStateMan {
      * @throws   COPSPepException
      *
      */
-    protected void processSyncStateRequest(final COPSSyncStateMsg ssMsg) throws COPSPepException {
+    protected void processSyncStateRequest(final COPSSyncStateMsg ssMsg) throws COPSException {
         _syncState = false;
         // If an object for retrieving PEP features exists,
         // use it for retrieving them
@@ -295,21 +295,21 @@ public class COPSPepReqStateMan extends COPSStateMan {
         _status = Status.ST_SYNC;
     }
 
-    protected void processClosedConnection(final COPSError error) throws COPSPepException {
+    protected void processClosedConnection(final COPSError error) throws COPSException {
         if (_process != null)
             _process.notifyClosedConnection(this, error);
 
         _status = Status.ST_CCONN;
     }
 
-    protected void processNoKAConnection() throws COPSPepException {
+    protected void processNoKAConnection() throws COPSException {
         if (_process != null)
             _process.notifyNoKAliveReceived(this);
 
         _status = Status.ST_NOKA;
     }
 
-    protected void processAcctReport() throws COPSPepException {
+    protected void processAcctReport() throws COPSException {
         final Map<String, String> report;
         if (_process != null) report = _process.getAcctData(this);
         else report = new HashMap<>();