xref: /unit/src/java/nginx/unit/websocket/WsRemoteEndpointBasic.java (revision 1157:7ae152bda303)
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  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 package nginx.unit.websocket;
18 
19 import java.io.IOException;
20 import java.io.OutputStream;
21 import java.io.Writer;
22 import java.nio.ByteBuffer;
23 
24 import javax.websocket.EncodeException;
25 import javax.websocket.RemoteEndpoint;
26 
27 public class WsRemoteEndpointBasic extends WsRemoteEndpointBase
28         implements RemoteEndpoint.Basic {
29 
WsRemoteEndpointBasic(WsRemoteEndpointImplBase base)30     WsRemoteEndpointBasic(WsRemoteEndpointImplBase base) {
31         super(base);
32     }
33 
34 
35     @Override
sendText(String text)36     public void sendText(String text) throws IOException {
37         base.sendString(text);
38     }
39 
40 
41     @Override
sendBinary(ByteBuffer data)42     public void sendBinary(ByteBuffer data) throws IOException {
43         base.sendBytes(data);
44     }
45 
46 
47     @Override
sendText(String fragment, boolean isLast)48     public void sendText(String fragment, boolean isLast) throws IOException {
49         base.sendPartialString(fragment, isLast);
50     }
51 
52 
53     @Override
sendBinary(ByteBuffer partialByte, boolean isLast)54     public void sendBinary(ByteBuffer partialByte, boolean isLast)
55             throws IOException {
56         base.sendPartialBytes(partialByte, isLast);
57     }
58 
59 
60     @Override
getSendStream()61     public OutputStream getSendStream() throws IOException {
62         return base.getSendStream();
63     }
64 
65 
66     @Override
getSendWriter()67     public Writer getSendWriter() throws IOException {
68         return base.getSendWriter();
69     }
70 
71 
72     @Override
sendObject(Object o)73     public void sendObject(Object o) throws IOException, EncodeException {
74         base.sendObject(o);
75     }
76 }
77