| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<String> |
_modifiedColumns |
ACL |
acl |
protected JSONObject |
document |
| Constructor and Description |
|---|
CloudObject(String tableName)
Create a new CloudObject
Constructor
|
CloudObject(String tableName,
String id)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(CloudObjectCallback callbackObject)
Delete
|
void |
deleteAll(CloudObject[] array,
CloudObjectArrayCallback callback)
delete an array of cloudobjects
|
void |
fetch(CloudObjectCallback callbackObject)
Fetch
|
Object |
get(String columnName)
Get
|
ACL |
getAcl()
returns the underlying permission object of this object
|
Object[] |
getArray(String columnName)
get a value from this object as an array, cast to
JSONArray |
Boolean |
getBoolean(String columnName) |
CloudObject |
getCloudObject(String columnName)
get a cloud object saved in this cloudobject
|
CloudObject[] |
getCloudObjectArray(String columnName)
get an array of cloudobjects in this cloudobject
|
Date |
getCreatedAt()
get the date of creation of this object
|
JSONObject |
getDocument()
returns the underlying json document with all data about the record, do not modify this object unless you are absolutely sure
of what you are doing
|
Double |
getDouble(String columnName) |
Calendar |
getExpires()
get when this cloudobject will expire
|
CloudFile |
getFile(String columnName) |
String |
getId()
get the id of this object if its already saved, otherwise null
|
Integer |
getInteger(String columnName) |
boolean |
getIsSearchable()
returns true if search can be performed on this object
|
String |
getString(String columnName) |
Date |
getUpdatedAt()
get the last update date of this object
|
boolean |
hasKey(String key)
returns true if this cloudobject contains a given key
|
static void |
off(String tableName,
String[] eventType,
CloudStringCallback callbackObject) |
static void |
off(String tableName,
String eventType,
CloudStringCallback callbackObj)
stop listening to events
|
static void |
on(String tableName,
String[] eventType,
CloudObjectCallback callbackObject)
start listening to an array of events
|
static void |
on(String tableName,
String[] eventType,
CloudQuery query,
CloudObjectCallback callbackObject)
start listening to an array of events
|
static void |
on(String tableName,
String eventType,
CloudObjectCallback callbackObject)
start listening to an event
|
static void |
on(String tableName,
String eventType,
CloudQuery cloudQuery,
CloudObjectCallback callbackObject)
start listening to events
|
void |
relate(String columnName,
String tableName,
String objectId)
Relates another CloudObject to this one
|
void |
save(CloudObjectCallback callbackObject)
writes this cloudobject to the database
|
void |
saveAll(CloudObject[] array,
CloudObjectArrayCallback callback)
save an array of cloudobjects at once
|
void |
set(String columnName,
CloudObject[] data) |
void |
set(String columnName,
Object data)
Set a value to this cloudobject as object
|
void |
set(String columnName,
Object[] data)
Set a value as an array
|
void |
setAcl(ACL acl)
set the Access Control List for this record
|
void |
setDocument(JSONObject document)
replaces the underlying json object
|
void |
setExpires(Calendar value)
set expiry time for this cloudobject, after which it will not appear in queries and searches
|
void |
setIsSearchable(boolean value)
should this object appear in searches
|
void |
unset(String columnName)
UnSet
|
protected static boolean |
validateNotificationQuery(CloudObject object,
CloudQuery query) |
public ACL acl
protected JSONObject document
public CloudObject(String tableName)
tableName - -name of table to wrappublic JSONObject getDocument()
public void setDocument(JSONObject document)
document - public void setAcl(ACL acl)
acl - public String getId()
public Date getCreatedAt()
public Date getUpdatedAt()
public boolean getIsSearchable()
public void setIsSearchable(boolean value)
value - public Calendar getExpires()
public void setExpires(Calendar value)
value - public boolean hasKey(String key)
key - key to search forpublic void set(String columnName, Object data) throws CloudException
columnName - data - CloudExceptionpublic void set(String columnName, Object[] data) throws CloudException
columnName - data - CloudExceptionpublic void set(String columnName, CloudObject[] data) throws CloudException
CloudExceptionpublic CloudObject getCloudObject(String columnName)
columnName - public CloudObject[] getCloudObjectArray(String columnName)
columnName - column name under which they are savedpublic Object[] getArray(String columnName)
JSONArraycolumnName - public void unset(String columnName)
columnName - public void relate(String columnName, String tableName, String objectId) throws CloudException
columnName - column name to save to, should be of type relate and related to table in parametertableName - table the relation column is related toobjectId - the object's ID, it should have been already savedCloudExceptionpublic static void on(String tableName, String eventType, CloudQuery cloudQuery, CloudObjectCallback callbackObject) throws CloudException
tableName - table to listen to events fromeventType - one of created, deleted, updatedcloudQuery - filter to apply on the datacallbackObject - CloudExceptionpublic static void on(String tableName, String eventType, CloudObjectCallback callbackObject) throws CloudException
tableName - tablename to listen fromeventType - one of "created","deleted" and "updated"callbackObject - fired when event occursCloudExceptionpublic static void on(String tableName, String[] eventType, CloudObjectCallback callbackObject) throws CloudException
tableName - tablename to listen fromeventType - one of "created","deleted" and "updated"callbackObject - fired when event occursCloudExceptionpublic static void on(String tableName, String[] eventType, CloudQuery query, CloudObjectCallback callbackObject) throws CloudException
tableName - tablename to listen fromeventType - any of "created","deleted" and "updated"query - a filter to specify details of the record to receive notifications forcallbackObject - CloudExceptionpublic static void off(String tableName, String[] eventType, CloudStringCallback callbackObject) throws CloudException
CloudExceptionpublic static void off(String tableName, String eventType, CloudStringCallback callbackObj) throws CloudException
tableName - table name to stop listening fromeventType - one of "created","deleted" and "updated"callbackObj - callback fired when the event is cancelledCloudExceptionpublic void save(CloudObjectCallback callbackObject) throws CloudException
callbackObject - CloudExceptionpublic void deleteAll(CloudObject[] array, CloudObjectArrayCallback callback) throws CloudException
array - callback - CloudExceptionpublic void saveAll(CloudObject[] array, CloudObjectArrayCallback callback) throws CloudException
array - callback - CloudExceptionpublic void fetch(CloudObjectCallback callbackObject) throws CloudException
callbackObject - CloudExceptionpublic void delete(CloudObjectCallback callbackObject) throws CloudException
callbackObject - CloudExceptionprotected static boolean validateNotificationQuery(CloudObject object, CloudQuery query)
public CloudFile getFile(String columnName) throws CloudException
CloudExceptionpublic ACL getAcl()
Copyright © 2016. All rights reserved.