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 and Description
    --- | ---
    `static String` | `SESSION_COOKIE_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpROPConnector(String url, String username, String password)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addAuthHeader(URLConnection connection)`
    `protected void` | `addSessionCookie(URLConnection connection)`
    `void` | `close()` Close all resources related to ROP Connector.
    `protected InputStream` | `doRequest(byte[] data)`
    `protected InputStream` | `doRequest(Map<String,String> params)`
    `InputStream` | `establishSession()` Establishes a dedicated session with Cayenne DataChannel, returning session id.
    `InputStream` | `establishSharedSession(String sharedSessionName)` Creates a new session with the specified or joins an existing one.
    `InputStream` | `sendMessage(byte[] message)` Processes message on a remote server, returning the result of such processing.
    `void` | `setClientConnection(HttpClientConnection clientConnection)`
    `void` | `setReadTimeout(Long readTimeout)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SESSION_COOKIE_NAME

          public static final String SESSION_COOKIE_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HttpROPConnector

          public HttpROPConnector(String url,
                                  String username,
                                  String password)

  - ### Method Detail

    - #### setClientConnection

          public void setClientConnection(HttpClientConnection clientConnection)

    - #### setReadTimeout

          public void setReadTimeout(Long readTimeout)

    - #### establishSession

          public InputStream establishSession()
                                       throws IOException

      Description copied from interface: `ROPConnector`
      Establishes a dedicated session with Cayenne DataChannel, returning session id.
      Specified by:
        `establishSession` in interface `ROPConnector`
      Throws:
        `IOException`

    - #### establishSharedSession

          public InputStream establishSharedSession(String sharedSessionName)
                                             throws IOException

      Description copied from interface: `ROPConnector`
      Creates 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:
        `establishSharedSession` in interface `ROPConnector`
      Throws:
        `IOException`

    - #### sendMessage

          public InputStream sendMessage(byte[] message)
                                  throws IOException

      Description copied from interface: `ROPConnector`
      Processes message on a remote server, returning the result of such processing.
      Specified by:
        `sendMessage` in interface `ROPConnector`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Description copied from interface: `ROPConnector`
      Close all resources related to ROP Connector.
      Specified by:
        `close` in interface `ROPConnector`
      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)

Copyright © 2001–2018 Apache Cayenne. All rights reserved.