Class Client
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final recordStructure to wrap anInputStreamand its content-type.
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor that defines a secured connection.Constructor that defines a secured connection.Constructor that defines a secured connection.Constructor.Constructor that defines a secured connection.Constructor that defines a secured connection.Constructor that defines a secured connection.Client(String host, String application, String apiKey, int deviceWidth, int deviceHeight, boolean secured) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionchangePassword(String currentPassword, String newPassword) Change password.voidclose()Close this instance.Send a command and receive a response.Send a command and receive a response.Retrieve the stream of data for the give file [name].getError()Get the current error, if any.static FaultExtract fault if any from the given JSON object.Login method.Login method.voidlogout()Logout method.voidReconnect the client.Run a report and retrieve its output.Run a report and retrieve its output.Retrieve the stream of data for the [name].upload(String mimeType, InputStream data) Upload new binary content to the server.upload(String mimeType, InputStream data, String streamNameOrID) Upload some binary content to the server.
- 
Field Details- 
NOT_CONNECTED
 
- 
- 
Constructor Details- 
Client
- 
Client
- 
ClientConstructor that defines a secured connection.- Parameters:
- host- Host where the SO is hosted.
- application- Name of the application (typically, the database name).
- secured- Whether a secured connection (TLS encryption) is required or not.
 
- 
ClientConstructor that defines a secured connection.- Parameters:
- host- Host where the SO is hosted.
- application- Name of the application (typically, the database name).
- apiKey- API key (if any).
- secured- Whether a secured connection (TLS encryption) is required or not.
 
- 
ClientConstructor that defines a secured connection.- Parameters:
- host- Host where the SO is hosted.
- application- Name of the application (typically, the database name).
- deviceWidth- Device width (applicable if you are connecting from a device that has a view-width).
- deviceHeight- Device height (applicable if you are connecting from a device that has a view-height).
 
- 
ClientConstructor that defines a secured connection.- Parameters:
- host- Host where the SO is hosted.
- application- Name of the application (typically, the database name).
- apiKey- API key (if any).
- deviceWidth- Device width (applicable if you are connecting from a device that has a view-width).
- deviceHeight- Device height (applicable if you are connecting from a device that has a view-height).
 
- 
ClientConstructor.- Parameters:
- host- Host where the SO is hosted.
- application- Name of the application (typically, the database name).
- deviceWidth- Device width (applicable if you are connecting from a device that has a view-width).
- deviceHeight- Device height (applicable if you are connecting from a device that has a view-height).
- secured- Whether a secured connection (TLS encryption) is required or not.
 
- 
Clientpublic Client(String host, String application, String apiKey, int deviceWidth, int deviceHeight, boolean secured) Constructor.- Parameters:
- host- Host where the SO is hosted.
- application- Name of the application (typically, the database name).
- apiKey- API key (if any).
- deviceWidth- Device width (applicable if you are connecting from a device that has a view-width).
- deviceHeight- Device height (applicable if you are connecting from a device that has a view-height).
- secured- Whether a secured connection (TLS encryption) is required or not.
 
 
- 
- 
Method Details- 
reconnectpublic void reconnect()Reconnect the client.Note: This will reset everything. However, it knows how to re-log in to the server if required. 
- 
getErrorGet the current error, if any.- Returns:
- Error or null if in any error state.
 
- 
login
- 
login
- 
logoutpublic void logout()Logout method. This should be invoked if theClientis no more required. If you try to use this instance afterward, it may give unexpected results.
- 
close
- 
changePassword
- 
commandSend a command and receive a response.The [attributes] should contain a map of the parameters. Please refer to the SO Connector documentation for parameter details. Please note that [command] is passed as the first parameter and thus, it need not be specified in the [attributes]. Also, "session" is not required because [Client] will automatically add that. - Parameters:
- command- Command.
- attributes- Attributes.
- Returns:
- Response as a JSON instance is returned.
 
- 
commandSend a command and receive a response.The [attributes] should contain a map of the parameters. Please refer to the SO Connector documentation for parameter details. Please note that [command] is passed as the first parameter and thus, it need not be specified in the [attributes]. Also, "session" is not required because [Client] will automatically add that. If the optional [preserveServerState] value is true, the "continue" attribute will be set to preserve the server state (See documentation). - Parameters:
- command- Command.
- attributes- Attributes.
- preserveServerState- Whether preserve the server state or not.
- Returns:
- Response as a JSON instance is returned.
 
- 
uploadUpload new binary content to the server.- Parameters:
- mimeType- Mime-type should be correctly specified because it will not be verified by the server.
- data- Data to be uploaded.
- Returns:
- If successfully uploaded (Status == "OK"), the "id" attribute will contain the ID of the new content created.
 
- 
uploadUpload some binary content to the server.- Parameters:
- mimeType- Mime-type should be correctly specified because it will not be verified by the server.
- data- Data to be uploaded.
- streamNameOrID- If not blank or null, the corresponding content will be overwritten. It could be specified as the content-name or the ID of the content.
- Returns:
- If successfully uploaded (Status == "OK"), the "id" attribute will contain the ID of the content.
 
- 
getFault
- 
streamRetrieve the stream of data for the [name].You should have got the [name] from a previous request. - Parameters:
- name- Name of the stream. (Mostly as a stringified Id).
- Returns:
- An instance of Client.Data. This contains anInputStreamcontaining binary data if theClient.Data.error()isnull.Client.Data.mimeType()provides the content-type.
 
- 
fileRetrieve the stream of data for the give file [name].You should have got the [name] from a previous request, or it could be the name of a file in the SO platform. - Parameters:
- name- Name of the stream.
- Returns:
- An instance of Client.Data. This contains anInputStreamcontaining binary data if theClient.Data.error()isnull.Client.Data.mimeType()provides the content-type.
 
- 
reportRun a report and retrieve its output.- Parameters:
- logic- Name of the report logic.
- parameters- Parameters for the report.
- Returns:
- An instance of Client.Data. This contains anInputStreamcontaining binary data if theClient.Data.error()isnull.Client.Data.mimeType()provides the content-type.
 
- 
reportRun a report and retrieve its output.- Parameters:
- logic- Name of the report logic.
- Returns:
- An instance of Client.Data. This contains anInputStreamcontaining binary data if theClient.Data.error()isnull.Client.Data.mimeType()provides the content-type.
 
 
-