User Guide: SDKs > Android SDK > Invoking an Object Service > OnlineObjectService Class
OnlineObjectService Class
OnlineObjectService Class provides methods that perform operations acting on the Volt MX Foundry endpoint, including basic CRUD. An instance of OnlineObjectService is returned by the getObjectService Method.
Methods
The following methods are used by the OnlineObjectService class and its instantiations.
Create
Creates an object in the Volt MX Foundry endpoint.
Syntax
Return Type
None
Parameters
Input Parameter | Type | Description | Required |
---|---|---|---|
dataObject | DataObject | An instance of the DataObject class that contains details about the object and its data | Yes |
headers | HashMap<String,String> | Key/value pairs of httpHeaders that are sent along with the network call. | Optional |
queryParams | HashMap<String,String> | Key/ value pairs of query parameters that are appended to the URL while making a network call | Optional |
objectServiceCallback | ObjectServiceCallback | Interface with onSuccess and onFailure methods onSuccess: Function invoked when the operation succeeds with the primary key of the created object. onFailure: Function invoked when the operation fails with cause of failure. | Yes |
Code
Update
Updates an object in the Volt MX Foundry endpoint.
Syntax
Parameters
Input Parameter | Type | Description | Required |
---|---|---|---|
dataObject | DataObject | An instance of the DataObject class that contains details about the object and its data | Yes |
headers | HashMap<String,String> | Key/value pairs of httpHeaders that are sent along with the network call. | Optional |
queryParams | HashMap<String,String> | Key/ value pairs of query parameters that are appended to the URL while making a network call | Optional |
objectServiceCallback | ObjectServiceCallback | Interface with onSuccess and onFailure methods onSuccess: Function invoked when the operation succeeds with the primary key of the created object. onFailure: Function invoked when the operation fails with cause of failure. | Yes |
Code
Delete
Deletes an object in the Volt MX Foundry endpoint.
Syntax
Parameters
Input Parameter | Type | Description | Required |
---|---|---|---|
dataObject | DataObject | An instance of the DataObject class that contains details about the object and its data | Yes |
headers | HashMap<String,String> | Key/ value pairs of httpHeaders that are sent along with the network call. | Optional |
queryParams | HashMap<String,String> | Key/ value pairs of query parameters that are appended to the URL while making a network call | Optional |
objectServiceCallback | ObjectServiceCallback | Interface with onSuccess and onFailure methods onSuccess: Function invoked when the operation succeeds with the primary key of the created object. onFailure: Function invoked when the operation fails with cause of failure. | Yes |
Code
Fetch
Fetches an object from the server.
Syntax
Parameters
Input Parameter | Type | Description | Required |
---|---|---|---|
dataObject | DataObject | An instance of the DataObject class that contains details about the object and its data | Yes |
headers | HashMap<String,String> | Key/ value pairs of httpHeaders that are sent along with the network call. | Optional |
queryParams | HashMap<String,String> | Key/ value pairs of query parameters that are appended to the URL while making a network call. | Optional |
objectServiceCallback | ObjectServiceCallback | Interface with onSuccess and onFailure methods onSuccess: Function invoked when the operation succeeds with the primary key of the created object. onFailure: Function invoked when the operation fails with cause of failure. | Yes |
Code
getMetaDataofAllObjects
Gets the metadata associated with the objects that are defined in the service from the server.
Syntax
Parameters
Input Parameter | Type | Description | Required |
---|---|---|---|
getFromServer | Boolean | Flag that retrieves the metadata of the object from the server or local store. True - from server False - from local store | Yes |
objectName | String | Name of the object | Yes |
headers | HashMap<String,String> | Key/ value pairs of httpHeaders that are sent along with the network call. | Optional |
queryParams | HashMap<String,String> | Key/ value pairs of query parameters that are appended to the URL while making a network call. | Optional |
objectServiceCallback | ObjectServiceCallback | Interface with onSuccess and onFailure methods onSuccess: Function invoked when the operation succeeds with the primary key of the created object. onFailure: Function invoked when the operation fails with cause of failure. | Yes |
Code
getMetaDataofObject
Gets the metadata associated with an object that is defined in the service from the server or local store.
Syntax
Parameters
Input Parameter | Type | Description | Required |
---|---|---|---|
getFromServer | Boolean | Flag that retrieves the metadata of the object from the server or local store. True from server False - from local store | Yes |
objectName | String | Name of the object | Yes |
headers | HashMap<String,String> | Key/ value pairs of httpHeaders that are sent along with the network call. | Optional |
queryParams | HashMap<String,String> | Key/ value pairs of query parameters that are appended to the URL while making a network call. | Optional |
objectServiceCallback | ObjectServiceCallback | Interface with onSuccess and onFailure methods onSuccess: Function invoked when the operation succeeds with the primary key of the created object. onFailure: Function invoked when the operation fails with cause of failure. | Yes |