org.nees.metadata.schema
Class SystemSchema

java.lang.Object
  extended byorg.nees.metadata.schema.SystemSchema

public class SystemSchema
extends java.lang.Object

Contains special constants and schema facilities related to low-level MD operations, for instance dealing with containers and the representation of classes.

Also manages a singleton Schema. The initialization process for an application should create a schema and pass it to SystemSchema.setSchema.

Note that this class does not extend Schema.

See Also:
Schema

Field Summary
static Identifier ALL_USERS_GROUP_ID
           
static java.lang.String AUTO_ID_NAMESPACE_PREFIX
          this is the namespace URI prefix for auto-generated IDs
static Identifier BASE_CLASS_ID
           
static Identifier CLASS_CLASS_ID
           
static Identifier CLASS_RELATION_ID
          the relation identifying the class of an object
static java.lang.String CLASSES_NS
           
static Identifier CONTAINER_CLASS_ID
          the class id for the container class
static Identifier CONTAINS_RELATION_ID
          the relation containing the contents of a container
static Identifier EVERYTHING_CLASS_ID
          the class id for the example "everything class"
static java.lang.String EXAMPLE_CLASSES_NS
           
static java.lang.String NEES_NAMESPACE_PREFIX
          this is the prefix for all system-defined class and relation identifiers
static Identifier NFMS_AVAILABLE_RELATION_ID
           
static Identifier NFMS_FILE_VERSION_CLASS_ID
           
static Identifier NFMS_FILE_VERSIONS_RELATION_ID
           
static Identifier NFMS_LOGICAL_FILE_CLASS_ID
           
static java.lang.String NFMS_LOGICAL_NAME_ID_PREFIX
           
static java.lang.String NFMS_NAMESPACE
           
static Identifier NFMS_PERMANENT_URI_RELATION_ID
           
static Identifier RANGE_MAX_DATE_RID
           
static Identifier RANGE_MAX_DOUBLE_RID
           
static Identifier RANGE_MAX_INCLUSIVE_RID
           
static Identifier RANGE_MAX_INT_RID
           
static Identifier RANGE_MAX_LONG_RID
           
static Identifier RANGE_MIN_DATE_RID
           
static Identifier RANGE_MIN_DOUBLE_RID
           
static Identifier RANGE_MIN_INCLUSIVE_RID
           
static Identifier RANGE_MIN_INT_RID
           
static Identifier RANGE_MIN_LONG_RID
           
static Identifier RELATION_ALLOWED_CLASSES_RID
           
static Identifier RELATION_ALLOWED_DATES_RID
           
static Identifier RELATION_ALLOWED_DOUBLES_RID
           
static Identifier RELATION_ALLOWED_INTS_RID
           
static Identifier RELATION_ALLOWED_LONGS_RID
           
static Identifier RELATION_ALLOWED_RANGES_RID
           
static Identifier RELATION_ALLOWED_REFERENCES_RID
           
static Identifier RELATION_ALLOWED_STRINGS_RID
           
static Identifier RELATION_CONSTRAINT_CLASS_ID
           
static java.lang.String RELATION_CONSTRAINT_NS
           
static Identifier RELATION_CONSTRAINTS_RID
           
static Identifier RELATION_DEFAULT_DATES_RID
           
static Identifier RELATION_DEFAULT_DOUBLES_RID
           
static Identifier RELATION_DEFAULT_INTS_RID
           
static Identifier RELATION_DEFAULT_LONGS_RID
           
static Identifier RELATION_DEFAULT_REFERENCES_RID
           
static Identifier RELATION_DEFAULT_STRINGS_RID
           
static Identifier RELATION_MAX_CARD_RID
           
static Identifier RELATION_MIN_CARD_RID
           
static Identifier RELATION_RANGE_CONSTRAINT_CLASS_ID
           
static Identifier RELATION_TITLE_RID
           
static Identifier RELATION_TYPE_RID
           
static java.lang.String RELATIONS_NS
          the namespace for special relations
static Identifier ROOT_CONTAINER_ID
          the id of the root container
static Identifier SOMETHING_CLASS_ID
           
static java.lang.String SPECIAL_INSTANCE_NS
          the namespace for special instances
static Identifier SUPERCLASS_RID
           
static Identifier TITLE_RELATION_ID
          the relation containing the title of an object
 
Constructor Summary
SystemSchema()
           
 
Method Summary
static MetadataClass getBaseClass()
           
static MetadataClass getClassClass()
           
static MetadataClass getContainerClass()
           
static MetadataClass getEverythingClass()
          Get an example class which uses every feature of classes, including every relation type and constraint type.
static MetadataClass getFileVersionClass()
           
static MetadataClass getLogicalFileClass()
           
static MetadataClass getRelationConstraintClass()
           
static MetadataClass getRelationRangeConstraintClass()
           
static MetadataObject getRootContainer()
          warning, callers should only use this when creating the root container
static Schema getSchema()
          Return the singleton schema; if one does not exist, create a simple, default one.
static MetadataClass getSomethingClass()
          Get an example class which uses many features of classes, including every relation type.
static boolean isSpecial(Identifier id)
          Is this identifier in a "system" namespace?
static MetadataObject newMetadataInstance(Identifier classId)
          Create a new metadata object of the given class based on the system schema.
static MetadataObject newMetadataInstance(MetadataClass cls)
          Create a new metadata object of the given class based on the system schema.
static void setSchema(Schema s)
          Set the singleton schema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEES_NAMESPACE_PREFIX

public static final java.lang.String NEES_NAMESPACE_PREFIX
this is the prefix for all system-defined class and relation identifiers

See Also:
Constant Field Values

AUTO_ID_NAMESPACE_PREFIX

public static final java.lang.String AUTO_ID_NAMESPACE_PREFIX
this is the namespace URI prefix for auto-generated IDs

See Also:
Constant Field Values

RELATIONS_NS

public static final java.lang.String RELATIONS_NS
the namespace for special relations

See Also:
Constant Field Values

CLASS_RELATION_ID

public static final Identifier CLASS_RELATION_ID
the relation identifying the class of an object


TITLE_RELATION_ID

public static final Identifier TITLE_RELATION_ID
the relation containing the title of an object


CLASSES_NS

public static final java.lang.String CLASSES_NS
See Also:
Constant Field Values

EXAMPLE_CLASSES_NS

public static final java.lang.String EXAMPLE_CLASSES_NS
See Also:
Constant Field Values

RELATION_CONSTRAINT_NS

public static final java.lang.String RELATION_CONSTRAINT_NS
See Also:
Constant Field Values

BASE_CLASS_ID

public static final Identifier BASE_CLASS_ID

CLASS_CLASS_ID

public static final Identifier CLASS_CLASS_ID

RELATION_CONSTRAINT_CLASS_ID

public static final Identifier RELATION_CONSTRAINT_CLASS_ID

RELATION_RANGE_CONSTRAINT_CLASS_ID

public static final Identifier RELATION_RANGE_CONSTRAINT_CLASS_ID

SUPERCLASS_RID

public static final Identifier SUPERCLASS_RID

RELATION_CONSTRAINTS_RID

public static final Identifier RELATION_CONSTRAINTS_RID

RELATION_TITLE_RID

public static final Identifier RELATION_TITLE_RID

RELATION_TYPE_RID

public static final Identifier RELATION_TYPE_RID

RELATION_MAX_CARD_RID

public static final Identifier RELATION_MAX_CARD_RID

RELATION_MIN_CARD_RID

public static final Identifier RELATION_MIN_CARD_RID

RELATION_DEFAULT_DATES_RID

public static final Identifier RELATION_DEFAULT_DATES_RID

RELATION_DEFAULT_DOUBLES_RID

public static final Identifier RELATION_DEFAULT_DOUBLES_RID

RELATION_DEFAULT_INTS_RID

public static final Identifier RELATION_DEFAULT_INTS_RID

RELATION_DEFAULT_LONGS_RID

public static final Identifier RELATION_DEFAULT_LONGS_RID

RELATION_DEFAULT_REFERENCES_RID

public static final Identifier RELATION_DEFAULT_REFERENCES_RID

RELATION_DEFAULT_STRINGS_RID

public static final Identifier RELATION_DEFAULT_STRINGS_RID

RELATION_ALLOWED_DATES_RID

public static final Identifier RELATION_ALLOWED_DATES_RID

RELATION_ALLOWED_DOUBLES_RID

public static final Identifier RELATION_ALLOWED_DOUBLES_RID

RELATION_ALLOWED_INTS_RID

public static final Identifier RELATION_ALLOWED_INTS_RID

RELATION_ALLOWED_LONGS_RID

public static final Identifier RELATION_ALLOWED_LONGS_RID

RELATION_ALLOWED_REFERENCES_RID

public static final Identifier RELATION_ALLOWED_REFERENCES_RID

RELATION_ALLOWED_STRINGS_RID

public static final Identifier RELATION_ALLOWED_STRINGS_RID

RELATION_ALLOWED_CLASSES_RID

public static final Identifier RELATION_ALLOWED_CLASSES_RID

RELATION_ALLOWED_RANGES_RID

public static final Identifier RELATION_ALLOWED_RANGES_RID

RANGE_MIN_DATE_RID

public static final Identifier RANGE_MIN_DATE_RID

RANGE_MAX_DATE_RID

public static final Identifier RANGE_MAX_DATE_RID

RANGE_MIN_DOUBLE_RID

public static final Identifier RANGE_MIN_DOUBLE_RID

RANGE_MAX_DOUBLE_RID

public static final Identifier RANGE_MAX_DOUBLE_RID

RANGE_MIN_INT_RID

public static final Identifier RANGE_MIN_INT_RID

RANGE_MAX_INT_RID

public static final Identifier RANGE_MAX_INT_RID

RANGE_MIN_LONG_RID

public static final Identifier RANGE_MIN_LONG_RID

RANGE_MAX_LONG_RID

public static final Identifier RANGE_MAX_LONG_RID

RANGE_MIN_INCLUSIVE_RID

public static final Identifier RANGE_MIN_INCLUSIVE_RID

RANGE_MAX_INCLUSIVE_RID

public static final Identifier RANGE_MAX_INCLUSIVE_RID

CONTAINER_CLASS_ID

public static final Identifier CONTAINER_CLASS_ID
the class id for the container class


CONTAINS_RELATION_ID

public static final Identifier CONTAINS_RELATION_ID
the relation containing the contents of a container


EVERYTHING_CLASS_ID

public static final Identifier EVERYTHING_CLASS_ID
the class id for the example "everything class"


SOMETHING_CLASS_ID

public static final Identifier SOMETHING_CLASS_ID

NFMS_NAMESPACE

public static final java.lang.String NFMS_NAMESPACE
See Also:
Constant Field Values

NFMS_LOGICAL_FILE_CLASS_ID

public static final Identifier NFMS_LOGICAL_FILE_CLASS_ID

NFMS_FILE_VERSIONS_RELATION_ID

public static final Identifier NFMS_FILE_VERSIONS_RELATION_ID

NFMS_FILE_VERSION_CLASS_ID

public static final Identifier NFMS_FILE_VERSION_CLASS_ID

NFMS_AVAILABLE_RELATION_ID

public static final Identifier NFMS_AVAILABLE_RELATION_ID

NFMS_PERMANENT_URI_RELATION_ID

public static final Identifier NFMS_PERMANENT_URI_RELATION_ID

NFMS_LOGICAL_NAME_ID_PREFIX

public static final java.lang.String NFMS_LOGICAL_NAME_ID_PREFIX
See Also:
Constant Field Values

SPECIAL_INSTANCE_NS

public static final java.lang.String SPECIAL_INSTANCE_NS
the namespace for special instances

See Also:
Constant Field Values

ROOT_CONTAINER_ID

public static final Identifier ROOT_CONTAINER_ID
the id of the root container


ALL_USERS_GROUP_ID

public static Identifier ALL_USERS_GROUP_ID
Constructor Detail

SystemSchema

public SystemSchema()
Method Detail

getBaseClass

public static MetadataClass getBaseClass()

getContainerClass

public static MetadataClass getContainerClass()

getClassClass

public static MetadataClass getClassClass()

getRelationConstraintClass

public static MetadataClass getRelationConstraintClass()

getRelationRangeConstraintClass

public static MetadataClass getRelationRangeConstraintClass()

getRootContainer

public static MetadataObject getRootContainer()
                                       throws MetadataException
warning, callers should only use this when creating the root container

Throws:
MetadataException

getEverythingClass

public static MetadataClass getEverythingClass()
Get an example class which uses every feature of classes, including every relation type and constraint type.


getSomethingClass

public static MetadataClass getSomethingClass()
Get an example class which uses many features of classes, including every relation type.


getLogicalFileClass

public static MetadataClass getLogicalFileClass()

getFileVersionClass

public static MetadataClass getFileVersionClass()

setSchema

public static void setSchema(Schema s)
Set the singleton schema

Parameters:
s - the schema

getSchema

public static Schema getSchema()
Return the singleton schema; if one does not exist, create a simple, default one.

Returns:
the singleton schema

newMetadataInstance

public static MetadataObject newMetadataInstance(MetadataClass cls)
                                          throws MetadataException
Create a new metadata object of the given class based on the system schema.

Parameters:
cls - the class
Throws:
MetadataException

newMetadataInstance

public static MetadataObject newMetadataInstance(Identifier classId)
                                          throws MetadataException
Create a new metadata object of the given class based on the system schema.

Parameters:
classId - the class id
Throws:
MetadataException

isSpecial

public static boolean isSpecial(Identifier id)
Is this identifier in a "system" namespace?