org.gcube.data.tmf.api
Interface Source

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractSource

public interface Source
extends Serializable

A model of a data source managed by the plugin.

This model provides information that the service uses to dispatch client requests to the plugin (SourceReader, SourceWriter), as well as to manage its lifetime (SourceLifecycle).
It also provides information about the source that the service publishes in the infrastructure on behalf of the plugin (identifier, data type, description, date of creation and last modification, cardinality, etc).
This information must be configured by the plugin prior to source initialisation and, when appropriate, managed over the source;s lifetime (e.g. updates to cardinality and last modification dates).

This model also accepts information from the service that the plugin uses to access the local environment (Environment) and to communicate back to the service events of the relevance about the source (SourceNotifier).
This information is set by the service prior to source initialisation (cf. SourceLifecycle.init() and the plugin should not use it until then.

Author:
Fabio Simeoni

Field Summary
static QName TREE_TYPE
           
 
Method Summary
 Long cardinality()
          Returns the cardinality of the source.
 Calendar creationTime()
          Returns the creation time of the source.
 String description()
          Returns the free-form description of the source.
 Environment environment()
          Returns the local Environment of the plugin.
 String id()
          Returns the identifier of the source.
 boolean isUser()
          Returns true if the source is a user-level source, false if it is instead system-level source.
 Calendar lastUpdate()
          Returns the time in which the source was last modified.
 SourceLifecycle lifecycle()
          Returns the SourceLifecycle.
 String name()
          Returns the name of the source.
 SourceNotifier notifier()
          Returns the SourceNotifier.
 List<Property> properties()
          Returns the properties of the source.
 SourceReader reader()
          Returns the SourceReader.
 void setEnvironment(Environment env)
          Sets the local Environment of the plugin.
 void setNotifier(SourceNotifier notifier)
          Returns the SourceNotifier.
 List<QName> types()
          Returns the tree types of the source.
 SourceWriter writer()
          Returns the SourceWriter.
 

Field Detail

TREE_TYPE

static final QName TREE_TYPE
Method Detail

id

String id()
Returns the identifier of the source.

Returns:
the identifier

types

List<QName> types()
Returns the tree types of the source.

Returns:
the types

name

String name()
Returns the name of the source.

Returns:
the name

description

String description()
Returns the free-form description of the source.

Returns:
the description

properties

List<Property> properties()
Returns the properties of the source.

Returns:
the properties

creationTime

Calendar creationTime()
Returns the creation time of the source.

Returns:
the creation time

isUser

boolean isUser()
Returns true if the source is a user-level source, false if it is instead system-level source.

Returns:
true if the source is a user-level source, false otherwise

cardinality

Long cardinality()
Returns the cardinality of the source.

Returns:
the cardinality

lastUpdate

Calendar lastUpdate()
Returns the time in which the source was last modified.

Returns:
the last modification time

lifecycle

SourceLifecycle lifecycle()
Returns the SourceLifecycle.

Returns:
the lifecycle

reader

SourceReader reader()
Returns the SourceReader.

Returns:
the reader, or null if the source is write-only

writer

SourceWriter writer()
Returns the SourceWriter.

Returns:
the writer, or null if the source is read-only

setNotifier

void setNotifier(SourceNotifier notifier)
Returns the SourceNotifier.

This is invoked by the service prior to source initialisation. The service subscribes to the provider so as to receive notification of events fired from the plugin.

Parameters:
notifier - the notifier

notifier

SourceNotifier notifier()
Returns the SourceNotifier.

Returns:
the notifier

environment

Environment environment()
Returns the local Environment of the plugin.

Returns:
the environment

setEnvironment

void setEnvironment(Environment env)
Sets the local Environment of the plugin.

It is invoked by the service prior to source initialisation.

Parameters:
env - the environment


Copyright © 2012. All Rights Reserved.