public class DatasetCollectionManagement extends java.lang.Object implements DatasetCollection, DataAvailabilityObserver
DataCollection
Interface.Modifier | Constructor and Description |
---|---|
protected |
DatasetCollectionManagement() |
protected |
DatasetCollectionManagement(byte[] marshalledBytes) |
Modifier and Type | Method and Description |
---|---|
int |
addDataset(Dataset dataset)
Add a dataset to this collection.
|
byte[] |
getBytes()
Returns this collection as a stream of bytes.
|
Dataset |
getDataset(java.lang.String datasetIdentifier)
Retrieve a specific dataset
|
java.util.Iterator<Dataset> |
getDatasets()
Retrieve an iterator to iterate over the datasets.
|
java.lang.String |
getIdentifier()
This retrieves the identifier associated with the observer.
|
int |
getNumberOfDatasets()
Get the number of datasets in this collection.
|
boolean |
hasDataset()
Check to see if any dataset is part of this collection.
|
boolean |
hasDataset(java.lang.String datasetIdentifier)
Check to see if a dataset with the specified identifier is part of this
collection
|
void |
initializeDatasets()
Initializes all the constituent datasets in this collection.
|
boolean |
isClosed()
This method indicates whether this dataset collection is closed.
|
boolean |
isDataAvailable()
Reports on the availability of data in any of the underlying datasets
that are part of this collection.
|
static void |
main(java.lang.String[] args) |
void |
onDataAvailability(java.lang.String datasetIdentifier)
This method is invoked on the observers to reflect the availability of
new data in the input dataset
|
void |
onDatasetClosure(java.lang.String datasetIdentifier)
This method is invoked on the observer when the dataset will be closed
and thus no more data will be available.
|
int |
removeDataset(java.lang.String datasetIdentifier)
Remove a dataset from this collection
|
void |
resumeAvailabilityNotifications()
Resume data availability notifications for this collection.
|
void |
setDatasetCollectionObserver(DatasetCollectionObserver observer)
Register an observer for the DatasetCollection
|
java.lang.String |
toString() |
protected DatasetCollectionManagement()
protected DatasetCollectionManagement(byte[] marshalledBytes) throws java.io.IOException, DatasetException
java.io.IOException
DatasetException
public boolean isClosed()
DatasetCollection
isClosed
in interface DatasetCollection
true
if this dataset is closed;false
otherwise.public void initializeDatasets() throws DatasetException
DatasetCollection
initializeDatasets
in interface DatasetCollection
DatasetException
- If there are problems initializing any of the datasets within
the dataset collection.public int addDataset(Dataset dataset) throws DatasetException
DatasetCollection
addDataset
in interface DatasetCollection
dataset
- The dataset to be added to the collection in question.DatasetException
- If there are problems adding this dataset to the collectionpublic Dataset getDataset(java.lang.String datasetIdentifier) throws DatasetException
DatasetCollection
getDataset
in interface DatasetCollection
datasetIdentifier
- The identifier of the dataset.DatasetException
- If there are problems retrieving the dataset.public java.util.Iterator<Dataset> getDatasets()
DatasetCollection
getDatasets
in interface DatasetCollection
public int getNumberOfDatasets()
DatasetCollection
getNumberOfDatasets
in interface DatasetCollection
public boolean hasDataset()
DatasetCollection
hasDataset
in interface DatasetCollection
true
if there are registered datasets, and
false
otherwise.public boolean hasDataset(java.lang.String datasetIdentifier) throws DatasetException
DatasetCollection
hasDataset
in interface DatasetCollection
true
if the dataset with specified identifier is
part of this collection;false
otherwise.DatasetException
- If the specified datasetIdentifier is a NULLpublic int removeDataset(java.lang.String datasetIdentifier) throws DatasetException
DatasetCollection
removeDataset
in interface DatasetCollection
datasetIdentifier
- The identifier of the dataset that needs to be removed.DatasetException
- If there are problems removing this dataset from the
collection.public byte[] getBytes() throws java.io.IOException
DatasetCollection
getBytes
in interface DatasetCollection
java.io.IOException
- If there are problems marshalling this dataset.public boolean isDataAvailable()
DatasetCollection
isDataAvailable
in interface DatasetCollection
true
if data is available on any of the underlying
datasets;false
otherwise.public void setDatasetCollectionObserver(DatasetCollectionObserver observer)
DatasetCollection
setDatasetCollectionObserver
in interface DatasetCollection
observer
- The observer being registered.public java.lang.String getIdentifier()
DataAvailabilityObserver
getIdentifier
in interface DataAvailabilityObserver
public void onDataAvailability(java.lang.String datasetIdentifier)
DataAvailabilityObserver
onDataAvailability
in interface DataAvailabilityObserver
datasetIdentifier
- The identifier of the dataset whose availability is being
reported onpublic void onDatasetClosure(java.lang.String datasetIdentifier)
DataAvailabilityObserver
onDatasetClosure
in interface DataAvailabilityObserver
datasetIdentifier
- The identifier of the dataset whose availability is being
reported onpublic void resumeAvailabilityNotifications()
DatasetCollection
resumeAvailabilityNotifications
in interface DatasetCollection
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
-