|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.emi.dsr.db.mongodb.MongoDBServiceDatabase
public class MongoDBServiceDatabase
| Constructor Summary | |
|---|---|
MongoDBServiceDatabase()
|
|
MongoDBServiceDatabase(String hostname,
Integer port,
String dbName,
String colName)
|
|
| Method Summary | |
|---|---|
void |
deleteAll()
|
void |
deleteByUrl(String url)
Delete multiple items from the persistent store |
void |
dropCollection()
|
void |
dropDB()
|
List<ServiceObject> |
findAll()
|
void |
findAndDelete(String query)
Query and delete the matching documents |
String |
getDBVersion()
Get version of the database |
ServiceObject |
getServiceByUrl(String identifier)
Get an item from the persistent store |
void |
insert(com.mongodb.DBObject item)
|
void |
insert(ServiceObject item)
Insert service description to the persistent store. |
org.codehaus.jettison.json.JSONArray |
paginatedQuery(String query,
Integer pageSize,
String id)
|
List<ServiceObject> |
query(String query)
Query the persistent store |
List<ServiceObject> |
query(String query,
Integer skip)
Querying the collection |
List<ServiceObject> |
query(String query,
Integer limit,
Integer skip)
Querying the collection |
org.codehaus.jettison.json.JSONArray |
queryDistinctJSON(String attributeName)
Get distinct values for a given attribute |
org.codehaus.jettison.json.JSONArray |
queryJSON(String query)
|
org.codehaus.jettison.json.JSONArray |
queryJSON(String query,
Integer skip)
|
org.codehaus.jettison.json.JSONArray |
queryJSON(String query,
Integer limit,
Integer skip)
|
org.codehaus.jettison.json.JSONArray |
queryJSONWithLimit(String s,
Integer limit)
|
void |
update(ServiceObject sObj)
Update an existing item in the persistent store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MongoDBServiceDatabase()
public MongoDBServiceDatabase(String hostname,
Integer port,
String dbName,
String colName)
hostname - - default localhostport - - default 27017dbName - - default emiregistrycolName - - default services| Method Detail |
|---|
public void insert(ServiceObject item)
throws ExistingResourceException,
PersistentStoreFailureException
ServiceDatabase
insert in interface ServiceDatabaseitem - an item to insert into the database
ExistingResourceException - throws exception if the element already exists
PersistentStoreFailureException - throws exception if the persistent store is unavailable
public void insert(com.mongodb.DBObject item)
throws ExistingResourceException,
PersistentStoreFailureException
ExistingResourceException
PersistentStoreFailureException
public ServiceObject getServiceByUrl(String identifier)
throws MultipleResourceException,
NonExistingResourceException,
PersistentStoreFailureException
ServiceDatabase
getServiceByUrl in interface ServiceDatabaseidentifier - unique identifier of an object in the persistent store (url)
MultipleResourceException - throws exception if the identifier specifies more than one
item
NonExistingResourceException - throws exception if the item specified by identifier is not
existing in the persistent store
PersistentStoreFailureException - throws exception if persistent store level error occurs
public void deleteByUrl(String url)
throws MultipleResourceException,
NonExistingResourceException,
PersistentStoreFailureException
ServiceDatabase
deleteByUrl in interface ServiceDatabaseMultipleResourceException - throws exception if the identifier specifies more than one
item
NonExistingResourceException - throws exception if the item specified by identifier is not
existing in the persistent store
PersistentStoreFailureException - throws exception if persistent store level error occurs TODO:
support list of urls
public void update(ServiceObject sObj)
throws MultipleResourceException,
NonExistingResourceException,
PersistentStoreFailureException
ServiceDatabase
update in interface ServiceDatabaseMultipleResourceException - throws exception if the identifier specifies more than one
item
NonExistingResourceException - throws exception if the item specified by identifier is not
existing in the persistent store
PersistentStoreFailureException - throws exception if persistent store level error occurs
public List<ServiceObject> query(String query)
throws QueryException,
PersistentStoreFailureException
ServiceDatabase
query in interface ServiceDatabasequery - (a JSON String)
QueryException - throws exception if the query contains any query specific
error
PersistentStoreFailureException - throws exception if persistent store level error occurs
public List<ServiceObject> query(String query,
Integer limit,
Integer skip)
throws QueryException,
PersistentStoreFailureException
ServiceDatabase
query in interface ServiceDatabasequery - the json string containing the querylimit - total number of results to returnskip - skipping the query result
QueryException
PersistentStoreFailureException
public List<ServiceObject> query(String query,
Integer skip)
throws QueryException,
PersistentStoreFailureException
ServiceDatabase
query in interface ServiceDatabasequery - the json string containing the queryskip - skipping the query result
ServiceObjects
QueryException
PersistentStoreFailureException
public org.codehaus.jettison.json.JSONArray queryJSON(String query)
throws QueryException,
PersistentStoreFailureException,
com.mongodb.MongoException,
org.codehaus.jettison.json.JSONException
queryJSON in interface ServiceDatabaseQueryException
PersistentStoreFailureException
com.mongodb.MongoException
org.codehaus.jettison.json.JSONException
public org.codehaus.jettison.json.JSONArray queryJSON(String query,
Integer limit,
Integer skip)
throws QueryException,
PersistentStoreFailureException
queryJSON in interface ServiceDatabaseQueryException
PersistentStoreFailureException
public org.codehaus.jettison.json.JSONArray queryJSON(String query,
Integer skip)
throws QueryException,
PersistentStoreFailureException
queryJSON in interface ServiceDatabaseQueryException
PersistentStoreFailureException
public org.codehaus.jettison.json.JSONArray queryJSONWithLimit(String s,
Integer limit)
queryJSONWithLimit in interface ServiceDatabasepublic org.codehaus.jettison.json.JSONArray queryDistinctJSON(String attributeName)
ServiceDatabase
queryDistinctJSON in interface ServiceDatabase
public org.codehaus.jettison.json.JSONArray paginatedQuery(String query,
Integer pageSize,
String id)
paginatedQuery in interface ServiceDatabasepublic void deleteAll()
deleteAll in interface ServiceDatabase
public List<ServiceObject> findAll()
throws org.codehaus.jettison.json.JSONException
findAll in interface ServiceDatabaseorg.codehaus.jettison.json.JSONExceptionpublic void findAndDelete(String query)
ServiceDatabase
findAndDelete in interface ServiceDatabasepublic void dropCollection()
public void dropDB()
public String getDBVersion()
ServiceDatabase
getDBVersion in interface ServiceDatabase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||