Class RasHttpRequest

java.lang.Object
rasj.clientcommhttp.RasHttpRequest
All Implemented Interfaces:
RasCommDefs, RasGlobalDefs

public class RasHttpRequest extends Object implements RasCommDefs, RasGlobalDefs
This class handles a HTTP-request to the RasDaMan server. The specified RasDaMan server is contacted, the specified command is sent to the server, and the result of the query is retrieved and stored in a byte array. The specification of the communication protocol is given below.

  • Constructor Details

    • RasHttpRequest

      public RasHttpRequest()
  • Method Details

    • execute

      public void execute(String serverURL, String parameters) throws RasQueryExecutionFailedException, RasConnectionFailedException
      This method sends a query to the RasDaMan Server and retrieves the results.
      Parameters:
      parameters - the parameters for the request as name/value pairs (for example "clientID=4354351invalid input: '&queryString'=select img from test")
      con - server connection
      Throws:
      RasQueryExecutionFailedException
      RasConnectionFailedException
    • getResultType

      public byte getResultType()
      returns the result type (MDDColl, SkalarColl, Error, Integer)
    • getResult

      public Object getResult()
      returns the result of the query
    • getIntegerResult

      public int getIntegerResult()
      returns the result of the query as an Integer
    • getDCollection

      public DCollection getDCollection()
      returns the result of the query as a DCollection
    • getDBag

      public DBag getDBag()
      returns the result of the query as a DBag
    • setClientType

      public void setClientType(String clientType)
      This method specifies the type of the client. The clientType determines how the results are coded and returned by the server. Default type and the only type supported right now is "RASCLIENT". The results are sent back using the "application/octet-stream" mime type and are coded as a byte stream as described in the class documentation.

      Future versions will support other types like, for example, "BROWSER", where the results will be coded as standard HTTP-responses of certain mime types (for example "image/gif").

      Parameters:
      clientType - currently only "RASCLIENT" supported