Groovy Documentation

com.ace.mws.plugins.services
[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.

Authors:
bsaville


Method Summary
boolean addData(String pluginId, String collection, Map data)

Adds an entry to the collection.

boolean addData(String pluginId, String collection, List data)

Adds a list of entries to the collection.

List clearCollection(String pluginId, String collection)

Clears a collection completely and returns the contents.

boolean exists(String pluginId, String collection)

Returns true if the collection exists, false otherwise.

List getCollection(String pluginId, String collection)

Retrieves the entire contents of a collection.

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

Retrieves an entry in the collection where key = value.

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

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

boolean updateData(String pluginId, 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 pluginId, String collection, Map data)
Adds an entry to the collection. The collection will be created automatically if it does not already exist
Parameters:
pluginId
collection
data
Returns:
True on success, false on failure.


addData

public boolean addData(String pluginId, 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:
pluginId
collection
data
Returns:
True on success, false on failure.


clearCollection

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


exists

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


getCollection

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


getData

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


removeData

public boolean removeData(String pluginId, String collection, String key, Object value)
Removes and returns an entry from the collection where key = value.
Parameters:
pluginId
collection
key
value
Returns:
The entry removed, or null if it does not exist


updateData

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


 

Groovy Documentation