Groovy Documentation

com.ace.mws.plugins
[Java] Interface IPluginDatastoreService


public interface IPluginDatastoreService

The individual datastore service is provided to allow a plugin to persist data to the database that is isolated from all other persistent data. It is not designed to store Moab data such as nodes, jobs, or virtual machines, but custom, arbitrary data pertinent only to the individual plugin.

For more information on how to use this service, see the MWS Quick Reference page on Plugin Datastore Service.

Authors:
bsaville


Method Summary
boolean addData(String collection, Map data)

Adds an entry to the collection.

boolean addData(String collection, List data)

Adds a list of entries to the collection.

List clearCollection(String collection)

Clears a collection completely and returns the contents.

boolean exists(String collection)

Returns true if the collection exists, false otherwise.

List getCollection(String collection)

Retrieves the entire contents of a collection.

Map getData(String collection, String key, Object value)

Retrieves an entry in the collection where key = value.

boolean removeData(String collection, String key, Object value)

Removes and returns an entry from the collection where key = value.

boolean updateData(String collection, String key, Object value, Map data)

Updates a record in the datastore where key = value to the new data

 

Method Detail

addData

public boolean addData(String collection, Map data)
Adds an entry to the collection. The collection will be created automatically if it does not already exist
Parameters:
collection
data
Returns:
True on success, false on failure.


addData

public boolean addData(String collection, List data)
Adds a list of entries to the collection. The collection will be created automatically if it does not already exist
Parameters:
collection
data
Returns:
True on success, false on failure.


clearCollection

public List clearCollection(String collection)
Clears a collection completely and returns the contents.
Parameters:
collection
Returns:
The contents of the collection, or null if it does not exist


exists

public boolean exists(String collection)
Returns true if the collection exists, false otherwise.
Parameters:
collection
Returns:
True if it exists, false otherwise


getCollection

public List getCollection(String collection)
Retrieves the entire contents of a collection.
Parameters:
collection
Returns:
The contents of a collection, or null if it does not exist


getData

public Map getData(String collection, String key, Object value)
Retrieves an entry in the collection where key = value.
Parameters:
collection
key
value
Returns:
The matched entry or null if it does not exist


removeData

public boolean removeData(String collection, String key, Object value)
Removes and returns an entry from the collection where key = value.
Parameters:
collection
key
value
Returns:
True on success, false on failure


updateData

public boolean updateData(String collection, String key, Object value, Map data)
Updates a record in the datastore where key = value to the new data
Parameters:
collection
key
value
data
Returns:
True on success, false on failure


 

Groovy Documentation