|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netmera.mobile.BaseContent
com.netmera.mobile.NetmeraContent
public class NetmeraContent
The NetmeraContent object is used to run CRUD operations over the data.
After creating object use add() method to fill data and call create() method to add data into cloud.
Constructor Summary | |
---|---|
NetmeraContent(java.lang.String objectName)
Constructor that takes content name as parameter. |
Method Summary | |
---|---|
void |
create()
Adds data to the cloud. |
void |
createInBackground()
Adds data to the cloud in the background thread.Since it runs on the background thread it does not block program.It is recommended over create() method. |
void |
createInBackground(NetmeraCallback<NetmeraContent> callback)
Adds data to the cloud in the background thread. |
boolean |
delete()
Deletes data from the cloud.Before calling this method path of the data should be setted by calling setPath(String)
method. |
void |
deleteInBackground()
Deletes data from the cloud in the background thread.Since it runs on the background thread it does not block program.It is recommended over delete() method. |
void |
deleteInBackground(NetmeraCallback<java.lang.Boolean> netmeraCallback)
Deletes data from the cloud in the background thread.Since it runs on the background thread it does not block program.It is recommended over delete() method. |
boolean |
equals(java.lang.Object obj)
|
java.util.Date |
getCreateDate()
Gets the createDate of the content. |
java.lang.String |
getObjectName()
Returns the name of the content. |
java.lang.String |
getPath()
Returns the path of the content. |
NetmeraPrivacy |
getPrivacy()
|
java.util.Date |
getUpdateDate()
Gets the updateDate of the content. |
int |
hashCode()
|
void |
setOwner(NetmeraUser user)
Sets the owner to the content. |
void |
setPath(java.lang.String path)
Sets the path of the content.This is used to find the content to delete and update. |
void |
setPrivacy(NetmeraPrivacy privacy)
allows user to set the privacy of the content |
java.lang.String |
toString()
|
void |
update()
Updates data |
void |
updateInBackground()
Updates data in the background thread.Since it runs on the background thread it does not block program.It is recommended over update() method. |
void |
updateInBackground(NetmeraCallback<NetmeraContent> callback)
Updates data in the background thread. |
Methods inherited from class com.netmera.mobile.BaseContent |
---|
add, get, getBoolean, getDouble, getInt, getJSONArray, getJSONObject, getLong, getNetmeraGeoLocation, getNetmeraUser, getString, increment |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NetmeraContent(java.lang.String objectName)
objectName
- - Name of the contentMethod Detail |
---|
public void create() throws NetmeraException
NetmeraException
- Throws exception if it cannot access serverpublic void createInBackground(NetmeraCallback<NetmeraContent> callback)
create()
method.
callback
- NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when create operation finishes.public void createInBackground()
public void update() throws NetmeraException
NetmeraException
- Throws exception if it cannot access server.public void updateInBackground(NetmeraCallback<NetmeraContent> callback)
callback
- - NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when update operation finishes.public void updateInBackground()
public boolean delete() throws NetmeraException
setPath(String)
method.
NetmeraException
- - Throws exception if it cannot access server.
org.json.JSONException
public void deleteInBackground(NetmeraCallback<java.lang.Boolean> netmeraCallback)
Before calling this method path of the data should be setted by calling
setPath(String)
method.
netmeraCallback
- - NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when delete operation finishespublic void deleteInBackground()
Before calling this method path of the data should be setted by calling
setPath(String)
method.
public java.lang.String getPath() throws NetmeraException
NetmeraException
public void setPath(java.lang.String path)
path
- - path of the contentpublic void setOwner(NetmeraUser user) throws NetmeraException
user
- current logged user
NetmeraException
- Throws exception if user is null or type is different than
NetmeraUserpublic java.lang.String getObjectName()
public java.util.Date getCreateDate() throws NetmeraException
NetmeraException
- Throws exception if it cannot get objectpublic java.util.Date getUpdateDate() throws NetmeraException
NetmeraException
- Throws exception if it cannot get objectpublic NetmeraPrivacy getPrivacy()
public void setPrivacy(NetmeraPrivacy privacy)
privacy
- NetmeraPrivacy
to set the privacy of the contentpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |