commonj.connector.metadata.discovery
Interface MetadataTree


public interface MetadataTree

Represents the traversal of a single hierarchy of MetadataObjects as made available through a single MetadataConnection

Since:
1.0

Field Summary
static int MULTI_SELECT
          Constant indicating many nodes in the tree can be selected.
static int SINGLE_SELECT
          Constant indicating that only one node in the tree can be selected.
 
Method Summary
 PropertyGroup createFilterProperties()
          Creates a new instance of the set of properties that can be used to filter out the content of this MetadataTree.
 MetadataSelection createMetaDataSelection()
          Create a new instance of MetadataSelection that can be used to accumulate selections the user makes in the metadata tree.
 MetadataConnection getMetadataConnection()
          Get the MetadataConnection being used for this metadata tree.
 MetadataObject getMetadataObject(String objectLocationID)
          Get a specific MetadataObject instance from the metadata tree given the location identifier for the object.
 int getSelectionStyle()
          Returns one of the enumerated selection constants: SINGLE_SELECT, or MULTI_SELECT.
 MetadataObjectResponse listMetadataObjects(PropertyGroup filter)
          List all objects starting from the root of the metadata model for the EIS instance.
 

Field Detail

SINGLE_SELECT

static final int SINGLE_SELECT
Constant indicating that only one node in the tree can be selected.

See Also:
Constant Field Values

MULTI_SELECT

static final int MULTI_SELECT
Constant indicating many nodes in the tree can be selected.

See Also:
Constant Field Values
Method Detail

getMetadataConnection

MetadataConnection getMetadataConnection()
Get the MetadataConnection being used for this metadata tree.

Returns:
The non null active connection for this metadata tree

createFilterProperties

PropertyGroup createFilterProperties()
Creates a new instance of the set of properties that can be used to filter out the content of this MetadataTree. Tool environments should display this filter to users and allow them to filter the root content of the metadata tree. This property group only applies to the listMetadataObjects(commonj.connector.metadata.discovery.properties.PropertyGroup)method, and cannot be used with calls to MetadataObject.getChildren(commonj.connector.metadata.discovery.properties.PropertyGroup).

Returns:
A PropertyGroup containing filtering properties for the MetadataTree or null if none exist.

getSelectionStyle

int getSelectionStyle()
Returns one of the enumerated selection constants: SINGLE_SELECT, or MULTI_SELECT. This is used by tool environments to determine the selection behaviour to permit when displaying the metadata tree content to users.

The selection style does not enforce the selection behavior. This is inforced by the MetadataSelectionvia the MetadataSelection.add(commonj.connector.metadata.discovery.MetadataImportConfiguration)method. The selection style returned by this method only serves as a hint to the tool environment so that it may render the correct selection behaviour in its UI.

Returns:
Returns one of the enumerated selection constants. The default is SINGLE_SELECT.

createMetaDataSelection

MetadataSelection createMetaDataSelection()
Create a new instance of MetadataSelection that can be used to accumulate selections the user makes in the metadata tree. This selection object will ultimately be passed to MetadataDiscovery.createServiceDescription(commonj.connector.metadata.discovery.MetadataSelection).

Returns:
A non null MetadataSelection.
See Also:
MetadataDiscovery.createServiceDescription(MetadataSelection)

listMetadataObjects

MetadataObjectResponse listMetadataObjects(PropertyGroup filter)
                                           throws MetadataException
List all objects starting from the root of the metadata model for the EIS instance. The list can be filtered and controlled using optional filtering parameters obtained via createFilterProperties(). The returned metadata objects describe the objects at the specified location in the EIS metadata model.

Parameters:
filter - A PropertyGroup instance whose properties are used to control the items in the MetadataObjectResponse. The PropertyGroup instance should be created via a call to the getFilterProperties() method. If this parameter is null then no filtering is applied.
Returns:
A non null MetadataObjectResponse object.
Throws:
MetadataException - if an error occured during execution. A MetadataException should only be thrown if it is impossible to create a MetadataObjectResponse. If the request for objects failed, this method should still return an empty MetadataObjectResponse and include an error message to be returned on the MetadataObjectResponse.getMessage() method.
See Also:
createFilterProperties()

getMetadataObject

MetadataObject getMetadataObject(String objectLocationID)
                                 throws MetadataException
Get a specific MetadataObject instance from the metadata tree given the location identifier for the object.

Parameters:
objectLocationID - A non null location identifier for the desired MetadataObject. This identifier would have been obtained previously from a call to MetadataObject.getLocation().
Returns:
A non null MetadataObject instance.
Throws:
MetadataException - if an error occured.
See Also:
MetadataObject.getLocation()