Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.3)

Part Number E41849-02

weblogic.websocket
Interface WebSocketConnection


Deprecated. As of release 12.1.3, replaced by JSR356: Java API for WebSocket

@Deprecated
public interface WebSocketConnection

This class represents the WebSocket connection established between the client and server. It provides methods which can be used by an application to manipulate the connection.


Method Summary
 void close(int code)
          Deprecated. Initiating closing handshake with specified status code.
 void close(int code, String reason)
          Deprecated. Initiating closing handshake with specified status code and reason string.
 String getRemoteAddress()
          Deprecated. Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
 int getRemotePort()
          Deprecated. Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
 String getRemoteUser()
          Deprecated. Returns the login of the user making websocket handshake request if the user has been authenticated, or null if the user has not been authenticated.
 String getRequestURI()
          Deprecated. Returns the part of websocket handshake request's URL from the protocol name up to the query string.
 Principal getUserPrincipal()
          Deprecated. Returns a java.security.Principal object containing the name of the authenticated user making websocket handshake request, or null if the user has not been authenticated.
 WebSocketContext getWebSocketContext()
          Deprecated. Returns the WebSocketContext instance associated with this WebSocket connection.
 boolean isOpen()
          Deprecated. Returns the open state of the WebSocket connection.
 boolean isSecure()
          Deprecated. Returns a boolean indicating whether this request was made using a secure channel.
 void send(byte[] message)
          Deprecated. Send binary data to client.
 void send(String message)
          Deprecated. Send "UTF-8" encoded text data to client.
 void sendPing(byte[] message)
          Deprecated. Send a ping frame with the specified data (if any).
 void sendPong(byte[] message)
          Deprecated. Send a pong frame with the specified data (if any).
 void stream(boolean last, byte[] fragment, int off, int length)
          Deprecated. Send a fragment of a complete message.
 void stream(boolean last, String fragment)
          Deprecated. Send a fragment of a complete message.
 

Method Detail

send

void send(String message)
          throws IOException,
                 IllegalStateException
Deprecated. 
Send "UTF-8" encoded text data to client.

Parameters:
message - "UTF-8" encoded text data.
Throws:
IOException - if error occurs when writing data to the WebSocket.
IllegalStateException - if connection is closed.

send

void send(byte[] message)
          throws IOException,
                 IllegalStateException
Deprecated. 
Send binary data to client.

Parameters:
message - binary data.
Throws:
IOException - if error occurs when writing data to the WebSocket.
IllegalStateException - if connection is closed.

sendPing

void sendPing(byte[] message)
              throws IOException,
                     IllegalStateException
Deprecated. 
Send a ping frame with the specified data (if any).

Parameters:
message - optional data.
Throws:
IOException - if error occurs when writing data to the WebSocket.
IllegalStateException - if connection is closed.

sendPong

void sendPong(byte[] message)
              throws IOException,
                     IllegalStateException
Deprecated. 
Send a pong frame with the specified data (if any).

Parameters:
message - optional data.
Throws:
IOException - if error occurs when writing data to the WebSocket.
IllegalStateException - if connection is closed.

stream

void stream(boolean last,
            String fragment)
            throws IOException,
                   IllegalStateException
Deprecated. 
Send a fragment of a complete message.

Parameters:
last - boolean indicating if this message fragment is the last.
fragment - the textual fragment to send.
Throws:
IOException - if error occurs when sending fragment to the WebSocket.
IllegalStateException - if connection is closed.

stream

void stream(boolean last,
            byte[] fragment,
            int off,
            int length)
            throws IOException,
                   IllegalStateException
Deprecated. 
Send a fragment of a complete message.

Parameters:
last - boolean indicating if this message fragment is the last.
fragment - the binary fragment to send.
off - the offset within the fragment to send.
length - the number of bytes of the fragment to send.
Throws:
IOException - if error occurs when sending the fragment to the WebSocket.
IllegalStateException - if connection is closed.

close

void close(int code)
           throws IOException
Deprecated. 
Initiating closing handshake with specified status code.

Parameters:
code - closing status code.
Throws:
IOException - if error occurs when sending the closing message.
See Also:
ClosingMessage

close

void close(int code,
           String reason)
           throws IOException
Deprecated. 
Initiating closing handshake with specified status code and reason string.

Parameters:
code - closing status code.
reason - string for closing.
Throws:
IOException - if error occurs when sending the closing message.
See Also:
ClosingMessage

isOpen

boolean isOpen()
Deprecated. 
Returns the open state of the WebSocket connection.

Returns:
true if the WebSocket connection is at open state.

isSecure

boolean isSecure()
Deprecated. 
Returns a boolean indicating whether this request was made using a secure channel.

Returns:
a boolean indicating if the request was made using a secure channel.

getRemoteAddress

String getRemoteAddress()
Deprecated. 
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.

Returns:
a String containing the IP address of the client that sent the request.

getRemotePort

int getRemotePort()
Deprecated. 
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.

Returns:
an integer specifying the port number.

getRemoteUser

String getRemoteUser()
Deprecated. 
Returns the login of the user making websocket handshake request if the user has been authenticated, or null if the user has not been authenticated.

Returns:
a String specifying the login of the user making websocket handshake request, or null if the user login is unknown.

getRequestURI

String getRequestURI()
Deprecated. 
Returns the part of websocket handshake request's URL from the protocol name up to the query string. This value is same as the return value of javax.servlet.http.HttpServletRequest.getRequestURI() method.

Returns:
a String containing the part of websocket handshake request's URL from the protocol name up to the query string.

getUserPrincipal

Principal getUserPrincipal()
Deprecated. 
Returns a java.security.Principal object containing the name of the authenticated user making websocket handshake request, or null if the user has not been authenticated.

Returns:
a java.security.Principal containing the name of the authenticated user making websocket handshake request; or null if the user has not been authenticated.

getWebSocketContext

WebSocketContext getWebSocketContext()
Deprecated. 
Returns the WebSocketContext instance associated with this WebSocket connection.

Returns:
instance of WebSocketContext.

Copyright 1996, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.3)

Part Number E41849-02