public interface CyJobDataService
CyJobDataService
may be used for multiple backend services). Not all of the methods will be
provided by every implementation (see the default methods below).Module: jobs-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>jobs-api</artifactId> </dependency>
Modifier and Type | Method and Description |
---|---|
default CyJobData |
addData(CyJobData data,
String key,
CyNetwork network,
List<? extends CyIdentifiable> nodesAndEdges,
List<String> nodeColumns,
List<String> edgeColumns)
An optional method to add
network data to a
CyJobData item. |
default CyJobData |
addData(CyJobData data,
String key,
CyNetworkView networkView,
List<? extends CyIdentifiable> nodesAndEdges,
List<VisualProperty<?>> properties)
An optional method to
add network view data to a
CyJobData item. |
default CyJobData |
addData(CyJobData data,
String key,
CyTable table,
List<CyRow> rows,
List<String> columns)
An optional method to
add table data to a
CyJobData item. |
CyJobData |
addData(CyJobData data,
String key,
Map<Object,Object> mapData)
Add generic key, value pairs to a
CyJobData item. |
CyJobData |
addData(CyJobData data,
String key,
Object mapData)
Add a single data item to a
CyJobData object. |
CyJobData |
deserialize(InputStream inputStream)
This method is used to create a new
CyJobData object from a serialized
data stream retrieved from a remote execution. |
CyJobData |
deserialize(Object object)
This method is used to create a new
CyJobData object from a serialized
data object retrieved from a remote execution. |
CyJobData |
deserialize(Reader reader)
This method is used to create a new
CyJobData object from a serialized
data stream retrieved from a remote execution. |
Object |
getData(CyJobData data,
String key)
Extract data from a
CyJobData object. |
CyJobData |
getDataInstance()
Returns an empty instance of
CyJobData that may be used with this service. |
Map<Object,Object> |
getMapData(CyJobData data,
String key)
Extract a map from a
CyJobData object. |
default CyNetwork |
getNetworkData(CyJobData data,
String key)
Optional method to extract network data from a
CyJobData object. |
Object |
getSerializedData(CyJobData data)
This method is used to extract the data from the
CyJobData object
in a form that is appropriate for use by the job execution service. |
String |
getServiceName()
The name of the service.
|
default CyTable |
getTableData(CyJobData data,
String key)
Optional method to extract table data (usually not model associated tables)
from a
CyJobData object. |
default CyNetworkView |
getViewData(CyJobData data,
String key)
Optional method to extract data for a
CyNetworkView
from a CyJobData object. |
String getServiceName()
CyJobData getDataInstance()
CyJobData
that may be used with this service. Note
that implementations of CyJobData
are not meant to be compatible even though they
implement a small common subset of methods.CyJobData
CyJobData addData(CyJobData data, String key, Map<Object,Object> mapData)
CyJobData
item. If the data
argument is null, create a new CyJobData
object initialized
with mapData.data
- if not null, add mapData to this data object.key
- a key string used to retrieve the datamapData
- the data to add.CyJobData
objectCyJobData addData(CyJobData data, String key, Object mapData)
CyJobData
object. If the data
argument is null, create a new CyJobData
object initialized
with mapData.data
- if not null, add item to this data object.key
- a key string used to retrieve the dataitem
- the data to add.CyJobData
objectdefault CyJobData addData(CyJobData data, String key, CyNetwork network, List<? extends CyIdentifiable> nodesAndEdges, List<String> nodeColumns, List<String> edgeColumns)
CyJobData
item. If the data
argument is null, create a new CyJobData
object initialized
with the network data. If the list of nodes and edges (nodesAndEdges
is provided, the network data will be restricted to this list. The list
of nodeColumns and edgeColumns will restrict the attributes
to those columns. For implementations that intent to use a column other
than the SUID to map the data back, by convention the key column should be
the first column in the list and the list should not be empty.SUIDUtil
is provided to support one possible
mechanism to do thisdata
- if not null, add the model data to this data object.key
- a key string used to retrieve the datanetwork
- the CyNetwork
to extract the data from.nodesAndEdges
- the list of org.cytoscape.modelCyNode
s and org.cytoscape.modelCyEdge
s
to encode. If null or empty, the entire network will be addednodeColumns
- the list of columns to include for node dataedgeColumns
- the list of columns to include for edge dataCyJobData
objectdefault CyJobData addData(CyJobData data, String key, CyTable table, List<CyRow> rows, List<String> columns)
CyJobData
item. If the data
argument is null, create a new CyJobData
object initialized
with the table data. If the list of CyRow
s (rows is
is provided, the table data will be restricted to these rows. The list
of columns will restrict the data
to those columns. For implementations that intent to use a column other
than the SUID to map the data back, by convention the key column should be
the first column in the list and the list should not be empty.SUIDUtil
is provided to support one possible
mechanism to do thisdata
- if not null, add the model data to this data object.key
- a key string used to retrieve the datatable
- the CyTable
to extract the data from.rows
- the list of CyRow
s
to encode. If null or empty, the entire table will be addedcolumns
- the list of columns to include from tableCyJobData
objectdefault CyJobData addData(CyJobData data, String key, CyNetworkView networkView, List<? extends CyIdentifiable> nodesAndEdges, List<VisualProperty<?>> properties)
CyJobData
item. If the data
argument is null, create a new CyJobData
object initialized
with the network view data. If the list of nodes and edges (nodesAndEdges
is provided, the view data will be restricted to this list. The list
of properties will restrict the VisualProperty
s to only those
in the list.
NOTE: it is important that implementations of this method deal with
the mapping of network, node, and edge SUIDs, which will change
across sessions. Typically, this will be done by adding a new column
in the appropriate HIDDEN_ATTRS table with the name or id of the job. A
utility class SUIDUtil
is provided to support one possible
mechanism to do thisdata
- if not null, add the model data to this data object.key
- a key string used to retrieve the datanetworkView
- the CyNetworkView
to extract the data from.nodesAndEdges
- the list of CyNode
s and CyEdge
s
to encode. If null or empty, the entire network view will be addedproperties
- the list of visual properties to includeCyJobData
objectObject getData(CyJobData data, String key)
CyJobData
object.data
- the CyJobData
object that has the datakey
- the key that accesses the dataMap<Object,Object> getMapData(CyJobData data, String key)
CyJobData
object.data
- the CyJobData
object that has the mapkey
- the key that accesses the mapdefault CyNetwork getNetworkData(CyJobData data, String key)
CyJobData
object.default CyTable getTableData(CyJobData data, String key)
CyJobData
object.default CyNetworkView getViewData(CyJobData data, String key)
CyNetworkView
from a CyJobData
object.data
- the CyJobData
object that has the CyNetworkView
key
- the key that accesses the tableCyJobData
store. All VisualProperty
values will be default unless explicitly included, in which case they
will be overrides.Object getSerializedData(CyJobData data)
CyJobData
object
in a form that is appropriate for use by the job execution service. This
method will be called by
CyJobExecutionService.executeJob(CyJob, String, Map, CyJobData)
method
to serialize all of the data in the CyJobData
object for submission
to the remote service.data
- the input dataCyJobData deserialize(Object object)
CyJobData
object from a serialized
data object retrieved from a remote execution.
This method will be called from the
CyJobExecutionService.fetchResults(CyJob, CyJobData)
to unmarshal the data sent by the finished job.object
- the serialized data objectCyJobData
object containing the unserialized dataCyJobData deserialize(Reader reader)
CyJobData
object from a serialized
data stream retrieved from a remote execution.
This method will be called from the
CyJobExecutionService.fetchResults(CyJob, CyJobData)
to unmarshal the data sent by the finished job.object
- the serialized data streamCyJobData
object containing the unserialized dataCyJobData deserialize(InputStream inputStream)
CyJobData
object from a serialized
data stream retrieved from a remote execution.
This method will be called from the
CyJobExecutionService.fetchResults(CyJob, CyJobData)
to unmarshal the data sent by the finished job.object
- the serialized data streamCyJobData
object containing the unserialized dataCopyright 2011-2015 Cytoscape Consortium. All rights reserved.