Constructor and Description |
---|
MasonPlatform(android.content.Context context,
OnConnectListener listener)
Initializes the Mason Platform library by starting the connection to the Core service
|
Modifier and Type | Method and Description |
---|---|
void |
createObject(Callback<VaultObject> callback,
java.lang.String collection,
JsonObject object)
|
void |
createObject(Callback<VaultObject> callback,
java.lang.String collection,
java.lang.String objectId,
JsonObject object)
|
void |
deleteObject(Callback<java.lang.Boolean> callback,
java.lang.String collection,
java.lang.String objectId)
Deletes a
VaultObject in the given collection |
void |
destroy(android.content.Context context)
Disconnects from the service.
|
void |
getCollection(Callback<VaultCollection> callback,
java.lang.String collection)
Fetches a collection from the vault service
|
void |
getCollections(Callback<VaultCollections> callback) |
void |
getDevice(Callback<Device> callback)
Fetches info about this device from the Mason Platform
|
void |
getDeviceInfo(Callback<DeviceInfo> callback)
Gets
DeviceInfo that is stored on the device |
void |
getObject(Callback<VaultObject> callback,
java.lang.String collection,
java.lang.String objectId)
Fetches a
VaultObject by ID |
boolean |
isConnected() |
void |
updateDeviceMetadata(Callback<Device> callback,
java.lang.String name,
java.lang.String[] tags)
Update metadata for this device in the Mason Platform
|
void |
updateObject(Callback<VaultObject> callback,
java.lang.String collection,
java.lang.String objectId,
JsonObject object)
Updates a
VaultObject in the given collection |
public MasonPlatform(android.content.Context context, OnConnectListener listener)
context
- public boolean isConnected()
isConnected
in interface Platform
public void destroy(android.content.Context context)
Platform
public void getDeviceInfo(Callback<DeviceInfo> callback)
Platform
DeviceInfo
that is stored on the devicegetDeviceInfo
in interface Platform
callback
- returns DeviceInfo
public void getDevice(Callback<Device> callback)
Platform
public void updateDeviceMetadata(Callback<Device> callback, java.lang.String name, java.lang.String[] tags)
Platform
updateDeviceMetadata
in interface Platform
callback
- returns the updated Device
name
- unique name to assign to the device (optional)tags
- tag(s) to assign to the device (optional)public void getCollections(Callback<VaultCollections> callback)
getCollections
in interface Platform
callback
- returns all VaultCollections
public void getCollection(Callback<VaultCollection> callback, java.lang.String collection)
Platform
getCollection
in interface Platform
callback
- returns the VaultCollection
collection
- name of the collection to fetchpublic void getObject(Callback<VaultObject> callback, java.lang.String collection, java.lang.String objectId)
Platform
VaultObject
by IDgetObject
in interface Platform
callback
- returns the VaultObject
collection
- the collection containing the VaultObject
objectId
objectId
- ID of the VaultObject
to fetchpublic void createObject(Callback<VaultObject> callback, java.lang.String collection, JsonObject object)
Platform
createObject
in interface Platform
callback
- returns the VaultObject
collection
- name of the collection where the object
should be storedobject
- data stored in the VaultObject
public void createObject(Callback<VaultObject> callback, java.lang.String collection, java.lang.String objectId, JsonObject object)
Platform
createObject
in interface Platform
callback
- returns the VaultObject
collection
- name of the collection where the object
should be storedobjectId
- unique ID of this object
object
- data stored in the VaultObject
public void updateObject(Callback<VaultObject> callback, java.lang.String collection, java.lang.String objectId, JsonObject object)
Platform
VaultObject
in the given collection
updateObject
in interface Platform
callback
- returns the VaultObject
collection
- name of the collection where the object
is storedobjectId
- unique ID of the VaultObject
to be updatedobject
- new data to update the VaultObject
withpublic void deleteObject(Callback<java.lang.Boolean> callback, java.lang.String collection, java.lang.String objectId)
Platform
VaultObject
in the given collection
deleteObject
in interface Platform
callback
- true
if the VaultObject
was deleted, false
otherwisecollection
- name of the collection where the VaultObject
with ID objectId
is storedobjectId
- unique ID of the VaultObject
to be deleted