|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.shephertz.app42.paas.sdk.jme.storage.StorageService
public class StorageService
Storage service on cloud provides the way to store the JSON document in NoSQL database running on cloud. One can store the JSON document, update it , search it and can apply the map-reduce search on stored documents. Example : If one will store JSON doc {"date":"5Feb"} it will be stored with unique Object Id and stored JSON object will look like { "date" : "5Feb" , "_id" : { "$oid" : "4f423dcce1603b3f0bd560cf"}}. This oid can further be used to access/search the document.
Storage
,
App42Response
Constructor Summary | |
---|---|
StorageService(java.lang.String apiKey,
java.lang.String secretKey,
java.lang.String baseURL)
this is a constructor that takes |
Method Summary | |
---|---|
App42Response |
deleteDocumentById(java.lang.String dbName,
java.lang.String collectionName,
java.lang.String docId)
Delete target document using Object Id from given db and collection. |
Storage |
findAllDocuments(java.lang.String dbName,
java.lang.String collectionName)
Find all documents stored in given database and collection. |
Storage |
findAllDocuments(java.lang.String dbName,
java.lang.String collectionName,
java.lang.Integer max,
java.lang.Integer offset)
Find all documents stored in given database and collection. |
App42Response |
findAllDocumentsCount(java.lang.String dbName,
java.lang.String collectionName)
Gets the count of all documents stored in given database and collection. |
Storage |
findDocsWithQueryPagingOrderBy(java.lang.String dbName,
java.lang.String collectionName,
Query query,
java.lang.Integer max,
java.lang.Integer offset,
java.lang.String orderByKey,
java.lang.String type)
Find target document using Custom Query with paging and orderby. |
Storage |
findDocumentById(java.lang.String dbName,
java.lang.String collectionName,
java.lang.String docId)
Find target document by given unique object id. |
Storage |
findDocumentByKeyValue(java.lang.String dbName,
java.lang.String collectionName,
java.lang.String key,
java.lang.String value)
Find target document using key value search parameter. |
Storage |
findDocumentsByQuery(java.lang.String dbName,
java.lang.String collectionName,
Query query)
Find target document using Custom Query. |
Storage |
findDocumentsByQueryWithPaging(java.lang.String dbName,
java.lang.String collectionName,
Query query,
java.lang.Integer max,
java.lang.Integer offset)
Find target document using Custom Query with paging. |
java.lang.String |
getJsonFromMap(java.util.Hashtable map)
|
Storage |
insertJSONDocument(java.lang.String dbName,
java.lang.String collectionName,
java.lang.String json)
Save the JSON document in given database name and collection name. |
Storage |
insertJsonDocUsingMap(java.lang.String dbName,
java.lang.String collectionName,
java.util.Hashtable map)
Save the JSON document in given database name and collection name. |
java.lang.String |
mapReduce(java.lang.String dbName,
java.lang.String collectionName,
java.lang.String mapFunction,
java.lang.String reduceFunction)
Map reduce function to search the target document. |
Storage |
updateDocumentByDocId(java.lang.String dbName,
java.lang.String collectionName,
java.lang.String docId,
java.lang.String newJsonDoc)
Update target document using the document id. |
Storage |
updateDocumentByKeyValue(java.lang.String dbName,
java.lang.String collectionName,
java.lang.String key,
java.lang.String value,
java.lang.String newJsonDoc)
Update target document using key value search parameter. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StorageService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
apiKey
- secretKey
- baseURL
- Method Detail |
---|
public App42Response deleteDocumentById(java.lang.String dbName, java.lang.String collectionName, java.lang.String docId) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searcheddocId
- - Unique Object Id handler
App42Exception
public Storage findAllDocuments(java.lang.String dbName, java.lang.String collectionName) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searched
App42Exception
public Storage findAllDocuments(java.lang.String dbName, java.lang.String collectionName, java.lang.Integer max, java.lang.Integer offset) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searchedmax
- - Maximum number of records to be fetchedoffset
- - From where the records are to be fetched
App42Exception
public App42Response findAllDocumentsCount(java.lang.String dbName, java.lang.String collectionName) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searched
App42Exception
public Storage findDocsWithQueryPagingOrderBy(java.lang.String dbName, java.lang.String collectionName, Query query, java.lang.Integer max, java.lang.Integer offset, java.lang.String orderByKey, java.lang.String type) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searchedQuery
- - Query Object containing custom query for searching docsmax
- - max result parameteroffset
- - offset result parameter
App42Exception
public Storage findDocumentById(java.lang.String dbName, java.lang.String collectionName, java.lang.String docId) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searcheddocId
- - Unique Object Id handler
App42Exception
public Storage findDocumentByKeyValue(java.lang.String dbName, java.lang.String collectionName, java.lang.String key, java.lang.String value) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searchedkey
- - Key to be searched for target JSON docvalue
- - Value to be searched for target JSON doc
App42Exception
public Storage findDocumentsByQuery(java.lang.String dbName, java.lang.String collectionName, Query query) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searchedQuery
- - Query Object containing custom query for searching docs
App42Exception
public Storage findDocumentsByQueryWithPaging(java.lang.String dbName, java.lang.String collectionName, Query query, java.lang.Integer max, java.lang.Integer offset) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searchedQuery
- - Query Object containing custom query for searching docsmax
- - max result parameteroffset
- - offset result parameter
App42Exception
public java.lang.String getJsonFromMap(java.util.Hashtable map) throws App42Exception
map
-
App42Exception
public Storage insertJSONDocument(java.lang.String dbName, java.lang.String collectionName, java.lang.String json) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc has to be savedjson
- - Target JSON document to be saved
App42Exception
public Storage insertJsonDocUsingMap(java.lang.String dbName, java.lang.String collectionName, java.util.Hashtable map) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc has to be savedmap
- - HashMap containing key-value pairs
App42Exception
public java.lang.String mapReduce(java.lang.String dbName, java.lang.String collectionName, java.lang.String mapFunction, java.lang.String reduceFunction) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searchedmapFunction
- - Map function to be used to search the documentreduceFunction
- - Reduce function to be used to search the document
App42Exception
public Storage updateDocumentByDocId(java.lang.String dbName, java.lang.String collectionName, java.lang.String docId, java.lang.String newJsonDoc) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searcheddocId
- - Id of the document to be searched for target JSON docnewJsonDoc
- - New Json document to be added
App42Exception
public Storage updateDocumentByKeyValue(java.lang.String dbName, java.lang.String collectionName, java.lang.String key, java.lang.String value, java.lang.String newJsonDoc) throws App42Exception
dbName
- - Unique handler for storage namecollectionName
- - Name of collection under which JSON doc needs to be searchedkey
- - Key to be searched for target JSON docvalue
- - Value to be searched for target JSON docnewJsonDoc
- - New Json document to be added
App42Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |