Package rasj.clientcommhttp
Class RasHttpRequest
- java.lang.Object
-
- rasj.clientcommhttp.RasHttpRequest
-
- All Implemented Interfaces:
RasCommDefs,RasGlobalDefs
public class RasHttpRequest extends java.lang.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.
-
-
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_SKALARS
-
Fields 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 Constructor Description RasHttpRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(java.lang.String serverURL, java.lang.String parameters)This method sends a query to the RasDaMan Server and retrieves the results.DBaggetDBag()returns the result of the query as a DBagDCollectiongetDCollection()returns the result of the query as a DCollectionintgetIntegerResult()returns the result of the query as an Integerjava.lang.ObjectgetResult()returns the result of the querybytegetResultType()returns the result type (MDDColl, SkalarColl, Error, Integer)voidsetClientType(java.lang.String clientType)This method specifies the type of the client.
-
-
-
Method Detail
-
execute
public void execute(java.lang.String serverURL, java.lang.String parameters) throws RasQueryExecutionFailedException, RasConnectionFailedExceptionThis method sends a query to the RasDaMan Server and retrieves the results.- Parameters:
con- server connectionparameters- the parameters for the request as name/value pairs (for example "clientID=4354351&queryString=select img from test")- Throws:
RasQueryExecutionFailedExceptionRasConnectionFailedException
-
getResultType
public byte getResultType()
returns the result type (MDDColl, SkalarColl, Error, Integer)
-
getResult
public java.lang.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(java.lang.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
-
-