Changes for checkstyle 8.32
[policy/apex-pdp.git] / core / core-infrastructure / src / main / java / org / onap / policy / apex / core / infrastructure / messaging / impl / ws / messageblock / RawMessageBlock.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.apex.core.infrastructure.messaging.impl.ws.messageblock;
22
23 import java.nio.ByteBuffer;
24 import org.java_websocket.WebSocket;
25
26 /**
27  * A container for a raw message block and the connection on which it is handled.
28  *
29  * @author Sajeevan Achuthan (sajeevan.achuthan@ericsson.com)
30  */
31 public final class RawMessageBlock {
32     // The raw message
33     private final ByteBuffer message;
34
35     // The web socket on which the message is handled
36     private final WebSocket webSocket;
37
38     /**
39      * Constructor, instantiate the bean.
40      *
41      * @param message {@link ByteBuffer} message from the web socket
42      * @param webSocket {@link WebSocket} the web socket on which the message is handled
43      */
44     public RawMessageBlock(final ByteBuffer message, final WebSocket webSocket) {
45         this.message = message;
46         this.webSocket = webSocket;
47     }
48
49     /**
50      * A getter method for message.
51      *
52      * @return the message
53      */
54     public ByteBuffer getMessage() {
55         return message;
56     }
57
58     /**
59      * A getter method for the web socket.
60      *
61      * @return the web socket
62      */
63     public WebSocket getConn() {
64         return webSocket;
65     }
66 }