2 * Copyright (c) 2015 Cable Television Laboratories, Inc. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.pcmm.rcd.impl;
11 import static com.google.common.base.Preconditions.checkNotNull;
13 import org.pcmm.gates.IGateSpec.Direction;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16 import org.umu.cops.prpep.COPSPepConnection;
17 import org.umu.cops.prpep.COPSPepDataProcess;
18 import org.umu.cops.prpep.COPSPepException;
19 import org.umu.cops.prpep.COPSPepReqStateMan;
20 import org.umu.cops.stack.COPSException;
21 import org.umu.cops.stack.COPSHandle;
23 import java.net.Socket;
24 import java.util.Collections;
29 * The connection object for the PCMM CMTS
31 class PcmmCmtsConnection extends COPSPepConnection {
33 private static final Logger logger = LoggerFactory.getLogger(COPSPepConnection.class);
35 private final CMTSConfig config;
39 * @param clientType - the client-type
40 * @param sock - the socket connection
41 * @param config - emulator configuration
43 public PcmmCmtsConnection(final short clientType, final Socket sock, final CMTSConfig config) {
44 super(clientType, sock);
45 this.config = checkNotNull(config);
49 public COPSPepReqStateMan addRequestState(final COPSHandle clientHandle, final COPSPepDataProcess process)
50 throws COPSException {
51 final COPSPepReqStateMan manager = new CmtsPepReqStateMan(_clientType, clientHandle, (CmtsDataProcessor)process,
53 if (_managerMap.get(clientHandle) != null)
54 throw new COPSPepException("Duplicate Handle, rejecting " + clientHandle);
56 _managerMap.put(clientHandle, manager);
57 logger.info("Added state manager with key - " + clientHandle);
58 manager.initRequestState();