Package org.apache.cayenne.rop.http
Class HttpROPConnector
- java.lang.Object
-
- org.apache.cayenne.rop.http.HttpROPConnector
-
- All Implemented Interfaces:
ROPConnector
public class HttpROPConnector extends Object implements ROPConnector
-
-
Field Summary
Fields Modifier and Type Field Description static StringSESSION_COOKIE_NAME
-
Constructor Summary
Constructors Constructor Description HttpROPConnector(String url, String username, String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAuthHeader(URLConnection connection)protected voidaddSessionCookie(URLConnection connection)voidclose()Close all resources related to ROP Connector.protected InputStreamdoRequest(byte[] data)protected InputStreamdoRequest(Map<String,String> params)InputStreamestablishSession()Establishes a dedicated session with Cayenne DataChannel, returning session id.InputStreamestablishSharedSession(String sharedSessionName)Creates a new session with the specified or joins an existing one.InputStreamsendMessage(byte[] message)Processes message on a remote server, returning the result of such processing.voidsetClientConnection(HttpClientConnection clientConnection)voidsetReadTimeout(Long readTimeout)
-
-
-
Field Detail
-
SESSION_COOKIE_NAME
public static final String SESSION_COOKIE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
setClientConnection
public void setClientConnection(HttpClientConnection clientConnection)
-
setReadTimeout
public void setReadTimeout(Long readTimeout)
-
establishSession
public InputStream establishSession() throws IOException
Description copied from interface:ROPConnectorEstablishes a dedicated session with Cayenne DataChannel, returning session id.- Specified by:
establishSessionin interfaceROPConnector- Throws:
IOException
-
establishSharedSession
public InputStream establishSharedSession(String sharedSessionName) throws IOException
Description copied from interface:ROPConnectorCreates a new session with the specified or joins an existing one. This method is used to bootstrap collaborating clients of a single "group chat".- Specified by:
establishSharedSessionin interfaceROPConnector- Throws:
IOException
-
sendMessage
public InputStream sendMessage(byte[] message) throws IOException
Description copied from interface:ROPConnectorProcesses message on a remote server, returning the result of such processing.- Specified by:
sendMessagein interfaceROPConnector- Throws:
IOException
-
close
public void close() throws IOExceptionDescription copied from interface:ROPConnectorClose all resources related to ROP Connector.- Specified by:
closein interfaceROPConnector- Throws:
IOException
-
doRequest
protected InputStream doRequest(Map<String,String> params) throws IOException
- Throws:
IOException
-
doRequest
protected InputStream doRequest(byte[] data) throws IOException
- Throws:
IOException
-
addAuthHeader
protected void addAuthHeader(URLConnection connection)
-
addSessionCookie
protected void addSessionCookie(URLConnection connection)
-
-