com.stackmob.sdkapi
Interface DatastoreService


Deprecated.

@Deprecated
public interface DatastoreService

The datastore service.


Method Summary
 Map<String,Object> createObject(String modelName, Map<String,Object> toCreate)
          Deprecated. Creates a new object in the datastore.
 Boolean deleteObject(String modelName, String objectId)
          Deprecated. Deletes an object in the datastore.
 Set<String> getObjectModelNames()
          Deprecated. Retrieves a list of the object models declared for the current application.
 List<Map<String,Object>> readObjects(String modelName, Map<String,List<String>> queryFields)
          Deprecated. Reads a list of objects matching the given query fields from the datastore.
 Map<String,Object> updateObject(String modelName, String objectId, Map<String,Object> newValue)
          Deprecated. Updates an object in the datastore.
 

Method Detail

createObject

Map<String,Object> createObject(String modelName,
                                Map<String,Object> toCreate)
                                throws InvalidSchemaException,
                                       DatastoreException
Deprecated. 
Creates a new object in the datastore. Each such object should be represented as a map of field names to objects, where each sub-object is a List, Map, String, Long, or Double depending on the type of the field in question.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
toCreate - the object to create; must match the schema declared for the relevant object type
Returns:
the object created
Throws:
InvalidSchemaException - if the object model specified does not exist, or the object to create does not match the expected schema for that object model
DatastoreException - if the connection to the datastore fails or the datastore encounters an error

readObjects

List<Map<String,Object>> readObjects(String modelName,
                                     Map<String,List<String>> queryFields)
                                     throws InvalidSchemaException,
                                            DatastoreException
Deprecated. 
Reads a list of objects matching the given query fields from the datastore.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
queryFields - a map from fields to query to the query values; takes the form of a map from field names to lists of possible string values for that field
Returns:
a list of all documents matching the query; each such document is represented as a map of field names to objects, where each sub-object is a List, Map, String, Long, or Double depending on the type of the field in question
Throws:
InvalidSchemaException - if the object model specified does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error

updateObject

Map<String,Object> updateObject(String modelName,
                                String objectId,
                                Map<String,Object> newValue)
                                throws InvalidSchemaException,
                                       DatastoreException
Deprecated. 
Updates an object in the datastore. Each such object should be represented as a map of field names to objects, where each sub-object is a List, Map, String, Long, or Double depending on the type of the field in question.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
objectId - the id of the object to update
newValue - the fields to update, and their intended values; must not contain the id field of the object
Returns:
the updated object
Throws:
InvalidSchemaException - if newValue contains illegal types or does not match fields in the object to update, or the object model does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error

deleteObject

Boolean deleteObject(String modelName,
                     String objectId)
                     throws InvalidSchemaException,
                            DatastoreException
Deprecated. 
Deletes an object in the datastore.

Parameters:
modelName - the name of the relevant object model; must be a type already declared for the current application
objectId - the id of the object to delete
Returns:
a Boolean object representing success (Boolean.TRUE) or failure (Boolean.FALSE)
Throws:
InvalidSchemaException - if the object model specified does not exist
DatastoreException - if the connection to the datastore fails or the datastore encounters an error

getObjectModelNames

Set<String> getObjectModelNames()
                                throws ConnectException
Deprecated. 
Retrieves a list of the object models declared for the current application.

Returns:
the set of all valid object model names
Throws:
ConnectException - if the list of object models cannot be retrieved


Copyright © 2012 StackMob. All Rights Reserved.