7830b5b0b864cd0c0b3dfecda6b5c4e1894f6adb
[packetcable.git] / packetcable-driver / src / main / java / org / pcmm / rcd / IPCMMClient.java
1 /*
2  * Copyright (c) 2014, 2015 Cable Television Laboratories, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.pcmm.rcd;
10
11 import org.umu.cops.stack.COPSHandle;
12 import org.umu.cops.stack.COPSMsg;
13
14 import java.io.IOException;
15
16 /**
17  * <p>
18  * This is a Client Type 1, which represents existing "legacy" endpoints (e.g.,
19  * PC applications, gaming consoles) that lack specific QoS awareness or
20  * signaling capabilities. This client has no awareness of DOCSIS, CableHome, or
21  * PacketCable messaging, and hence no related requirements can be placed upon
22  * it. Client Type 1 communicates with an Application Manager to request
23  * service, and does not (cannot) request QoS resources directly from the MSO
24  * access network.
25  * </p>
26  *
27  *
28  */
29 public interface IPCMMClient {
30
31         /**
32          * PCMM client-type
33          */
34         short CLIENT_TYPE = (short) 0x800A;
35
36         /**
37          * sends a message to the server.
38          *
39          * @param requestMessage
40          *            request message.
41          */
42         void sendRequest(COPSMsg requestMessage);
43
44         /**
45          * Reads message from server
46          *
47          * @return COPS message
48          */
49         COPSMsg readMessage();
50
51         /**
52          * tries to connect to the server.
53          * @throws IOException
54          */
55         void connect() throws IOException;
56
57         /**
58          * disconnects from server.
59          *
60          * @return disconnection status.
61          */
62         boolean disconnect();
63
64         /**
65          *
66          * @return whether the client is connected to the server of not.
67          */
68         boolean isConnected();
69
70         /**
71          * gets the client handle
72          *
73          * @return client handle
74          */
75         COPSHandle getClientHandle();
76
77         void setClientHandle(COPSHandle handle);
78
79 }