Package rasj.clientcommhttp
Class RasHttpRequest
java.lang.Object
rasj.clientcommhttp.RasHttpRequest
- All Implemented Interfaces:
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.
-
Field Summary
Fields inherited from interface rasj.clientcommhttp.RasCommDefs
BIG_ENDIAN, BROWSER, LITTLE_ENDIAN, RASCLIENT, RESPONSE_ERROR, RESPONSE_INT, RESPONSE_MDDS, RESPONSE_OID, RESPONSE_OK, RESPONSE_OK_NEGATIVE, RESPONSE_SKALARSFields inherited from interface rasj.global.RasGlobalDefs
ACC_DEN_CAPABILITY_WRONG, ACC_DEN_INC_LOGIN, ACC_DEN_NO_PERMISSION, BASE_DBS_ERROR, CREATED, DATABASE_NOT_DEFINED, DB_CONN_FAILED, DB_NOT_OPEN, DELETED, DIMENSION_MISMATCH, FAST_PRE_SCALE_FACTORS, FAST_PRE_SCALE_SUFFIXES, GETFREESERVER_WAIT_INCREMENT, GETFREESERVER_WAIT_INITIAL, GUESTIDENT_DEFAULT, ILLEGAL_ULONG_VALUE, ILLEGAL_USHORT_VALUE, INDEX_OUT_OF_BOUNDS, INTERNAL_CLIENT_ERROR, INTERNAL_DL_PARSE_EXCEPTION, INVALID_OBJECT_NAME_ERROR, KEYWORD_ATYPE, KEYWORD_BTYPE, KEYWORD_CLASS, KEYWORD_CODE, KEYWORD_COLNO, KEYWORD_DIM1, KEYWORD_DIM2, KEYWORD_ERRNO, KEYWORD_HIGH, KEYWORD_INDEX, KEYWORD_INVNAME, KEYWORD_LINENO, KEYWORD_LOW, KEYWORD_METHOD, KEYWORD_TAB, KEYWORD_TOKEN, KEYWORD_TYPE, KEYWORD_URL, KEYWORD_VAL, MANAGER_BUSY, MANAGER_CONN_FAILED, MAX_GETFREESERVER_ATTEMPTS, MODIFIED, NO_ACTIVE_SERVERS, NO_STATUS, NUM_FAST_PRE_SCALE, RAS_ARRAY, RAS_AUTO_COMPRESSION, RAS_BOOLEAN, RAS_BYTE, RAS_CHAR, RAS_COLLECTION, RAS_COMPLEX1, RAS_DOUBLE, RAS_FLOAT, RAS_HDF, RAS_INT, RAS_JPEG, RAS_LONG, RAS_MARRAY, RAS_MINTERVAL, RAS_OID, RAS_PNG, RAS_POINT, RAS_RGB, RAS_SHORT, RAS_SINTERVAL, RAS_STRING, RAS_STRUCTURE, RAS_TIFF, RAS_ULONG, RAS_UNKNOWN, RAS_USHORT, RAS_ZLIB, RASJ_VERSION, RASMGRPORT_DEFAULT, READ, REQUEST_FORMAT_ERROR, RESULT_IS_NO_CELL, RESULT_IS_NO_INTERVAL, SIZE_OF_BOOLEAN, SIZE_OF_BYTE, SIZE_OF_CHAR, SIZE_OF_DOUBLE, SIZE_OF_FLOAT, SIZE_OF_INTEGER, SIZE_OF_LONG, SIZE_OF_RAS_BOOLEAN, SIZE_OF_RAS_BYTE, SIZE_OF_RAS_CHAR, SIZE_OF_RAS_DOUBLE, SIZE_OF_RAS_FLOAT, SIZE_OF_RAS_LONG, SIZE_OF_RAS_SHORT, SIZE_OF_RAS_ULONG, SIZE_OF_RAS_USHORT, SIZE_OF_SHORT, STREAM_INPUT_OVERFLOW, TRANSIENT, TYPE_INVALID, TYPE_NOT_SUPPORTED, TYPE_UNKNOWN, URL_FORMAT_ERROR, WRITE_TRANS_IN_PROGRESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis method sends a query to the RasDaMan Server and retrieves the results.getDBag()returns the result of the query as a DBagreturns the result of the query as a DCollectionintreturns the result of the query as an Integerreturns the result of the querybytereturns the result type (MDDColl, SkalarColl, Error, Integer)voidsetClientType(String clientType) This method specifies the type of the client.
-
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:
RasQueryExecutionFailedExceptionRasConnectionFailedException
-
getResultType
public byte getResultType()returns the result type (MDDColl, SkalarColl, Error, Integer) -
getResult
returns the result of the query -
getIntegerResult
public int getIntegerResult()returns the result of the query as an Integer -
getDCollection
returns the result of the query as a DCollection -
getDBag
returns the result of the query as a DBag -
setClientType
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
-