COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification

org.eclipse.cosmos.rm.repository.internal.core
Class MetadataProcessor

java.lang.Object
  extended by org.eclipse.cosmos.rm.repository.internal.core.MetadataProcessor

public class MetadataProcessor
extends java.lang.Object

The meta-data processor loads in the meta-information of the repository. The meta information includes aliases, rule bindings, and SML-IF fields that are lost when importing an SML-IF document.


Field Summary
static byte FIELD_BASE_URI
          The fields
static byte FIELD_DESCRIPTION
          The fields
static byte FIELD_DISPLAY_NAME
          The fields
static byte FIELD_NAME
          The fields
static byte FIELD_VERSION
          The fields
 
Constructor Summary
MetadataProcessor(FileSystemSMLRepository repository)
          Constructor
 
Method Summary
 void addAliases(java.lang.String id, java.lang.String[] aliases)
          Binds the set of aliases with the documents represented by the id argument.
 void addRuleBinding(java.lang.String alias, java.lang.String[] rules)
          Binds a rule with a set of aliases passed in
 MetadataFileHandler getMetadataHandler()
           
 java.lang.String[] retrieveAliases(java.lang.String id)
          Retrieves and returns the aliases of the document with the id passed in.
 java.util.Map retrieveBoundRules(java.lang.String id)
          Retrieve the bound rule of the document with the ID passed in.
 java.util.List retrieveDocuments(java.util.Map data, boolean isAlias)
           
 void setField(byte field, java.lang.String value)
          Sets the value of a field
 void setFields(byte[] fields, java.lang.String[] values)
          Equivalent to setField(fields[i], values[i]);
 void write()
          Serializes the meta information into XML and writes it to a file that resides in the context root directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_NAME

public static final byte FIELD_NAME
The fields

See Also:
Constant Field Values

FIELD_DISPLAY_NAME

public static final byte FIELD_DISPLAY_NAME
The fields

See Also:
Constant Field Values

FIELD_VERSION

public static final byte FIELD_VERSION
The fields

See Also:
Constant Field Values

FIELD_DESCRIPTION

public static final byte FIELD_DESCRIPTION
The fields

See Also:
Constant Field Values

FIELD_BASE_URI

public static final byte FIELD_BASE_URI
The fields

See Also:
Constant Field Values
Constructor Detail

MetadataProcessor

public MetadataProcessor(FileSystemSMLRepository repository)
Constructor

Parameters:
contextDirectory - The context directory of the repository
Method Detail

retrieveDocuments

public java.util.List retrieveDocuments(java.util.Map data,
                                        boolean isAlias)

retrieveAliases

public java.lang.String[] retrieveAliases(java.lang.String id)
Retrieves and returns the aliases of the document with the id passed in.

Parameters:
id - The id of the document (aka the file name)
Returns:
The aliases of the document

retrieveBoundRules

public java.util.Map retrieveBoundRules(java.lang.String id)
Retrieve the bound rule of the document with the ID passed in.

Parameters:
id - The id of the document (aka the path to the file name)
Returns:
The bound rules

addAliases

public void addAliases(java.lang.String id,
                       java.lang.String[] aliases)
Binds the set of aliases with the documents represented by the id argument.

Parameters:
id - The id of the document
aliases - The aliases of the document

addRuleBinding

public void addRuleBinding(java.lang.String alias,
                           java.lang.String[] rules)
Binds a rule with a set of aliases passed in

Parameters:
rule - The rule alias
aliases - The aliases that the rule should be bound to

setField

public void setField(byte field,
                     java.lang.String value)
Sets the value of a field

Parameters:
field - The field. See FIELD_* constants.
value - The value of the field.

setFields

public void setFields(byte[] fields,
                      java.lang.String[] values)
Equivalent to setField(fields[i], values[i]);


write

public void write()
Serializes the meta information into XML and writes it to a file that resides in the context root directory.


getMetadataHandler

public MetadataFileHandler getMetadataHandler()
Returns:
the metadataHandler

COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification