org.outerj.daisy.repository.schema
Interface RepositorySchema


public interface RepositorySchema

Allows querying and manipulation of the Repository Schema.

The Repository Schema defines the types of documents that can be stored in the repository. See DocumentType for more information about what constitutes a Document Type.

The various get methods all take a parameter "updateable". If true, the returned object can be modified and saved, and is caller-specific. If false, the returned object is not updateable (thus immutable), and the same object instance can be returned to different callers (i.e. it is threadsafe). The returned objects can in that case be retrieved from a cache, allowing very fast access to the schema information. So in general, if you don't need to modify the schema information, supply false for the updateable parameter.


Method Summary
 void addListener(RepositorySchemaListener listener)
           
 DocumentType createDocumentType(java.lang.String name)
          Creates a new document type with the given name.
 FieldType createFieldType(java.lang.String name, ValueType valueType)
           
 FieldType createFieldType(java.lang.String name, ValueType valueType, boolean multiValue)
           
 DocumentType createNewDocumentType(java.lang.String name)
          Deprecated. Use createDocumentType instead.
 FieldType createNewFieldType(java.lang.String name, ValueType valueType)
          Deprecated. Use createFieldType instead.
 PartType createNewPartType(java.lang.String name, java.lang.String mimeTypes)
          Deprecated. Use createPartType instead.
 PartType createPartType(java.lang.String name, java.lang.String mimeTypes)
           
 void deleteDocumentType(long documentTypeId)
           
 void deleteFieldType(long fieldTypeId)
           
 void deletePartType(long partTypeId)
           
 DocumentTypes getAllDocumentTypes(boolean updateable)
           
 FieldTypes getAllFieldTypes(boolean updateable)
           
 PartTypes getAllPartTypes(boolean updateable)
           
 DocumentType getDocumentTypeById(long id, boolean updateable)
           
 DocumentType getDocumentTypeByName(java.lang.String name, boolean updateable)
           
 FieldType getFieldTypeById(long id, boolean updateable)
           
 FieldType getFieldTypeByName(java.lang.String name, boolean updateable)
           
 PartType getPartTypeById(long id, boolean updateable)
           
 PartType getPartTypeByName(java.lang.String name, boolean updateable)
           
 void removeListener(RepositorySchemaListener listener)
           
 

Method Detail

createNewDocumentType

public DocumentType createNewDocumentType(java.lang.String name)
Deprecated. Use createDocumentType instead.


createDocumentType

public DocumentType createDocumentType(java.lang.String name)
Creates a new document type with the given name. The document type is not created immediately in the repository, to do this you need to call the save() method on the returned object.


deleteDocumentType

public void deleteDocumentType(long documentTypeId)
                        throws RepositoryException
Throws:
RepositoryException

createNewFieldType

public FieldType createNewFieldType(java.lang.String name,
                                    ValueType valueType)
Deprecated. Use createFieldType instead.


createFieldType

public FieldType createFieldType(java.lang.String name,
                                 ValueType valueType)

createFieldType

public FieldType createFieldType(java.lang.String name,
                                 ValueType valueType,
                                 boolean multiValue)

deleteFieldType

public void deleteFieldType(long fieldTypeId)
                     throws RepositoryException
Throws:
RepositoryException

createNewPartType

public PartType createNewPartType(java.lang.String name,
                                  java.lang.String mimeTypes)
Deprecated. Use createPartType instead.


createPartType

public PartType createPartType(java.lang.String name,
                               java.lang.String mimeTypes)

deletePartType

public void deletePartType(long partTypeId)
                    throws RepositoryException
Throws:
RepositoryException

addListener

public void addListener(RepositorySchemaListener listener)

removeListener

public void removeListener(RepositorySchemaListener listener)

getAllDocumentTypes

public DocumentTypes getAllDocumentTypes(boolean updateable)
                                  throws RepositoryException
Throws:
RepositoryException

getAllFieldTypes

public FieldTypes getAllFieldTypes(boolean updateable)
                            throws RepositoryException
Throws:
RepositoryException

getAllPartTypes

public PartTypes getAllPartTypes(boolean updateable)
                          throws RepositoryException
Throws:
RepositoryException

getPartTypeById

public PartType getPartTypeById(long id,
                                boolean updateable)
                         throws RepositoryException
Throws:
PartTypeNotFoundException - in case the part type does not exist.
RepositoryException

getPartTypeByName

public PartType getPartTypeByName(java.lang.String name,
                                  boolean updateable)
                           throws RepositoryException
Throws:
PartTypeNotFoundException - in case the part type does not exist.
RepositoryException

getFieldTypeById

public FieldType getFieldTypeById(long id,
                                  boolean updateable)
                           throws RepositoryException
Throws:
FieldTypeNotFoundException - in case the field type does not exist.
RepositoryException

getFieldTypeByName

public FieldType getFieldTypeByName(java.lang.String name,
                                    boolean updateable)
                             throws RepositoryException
Throws:
FieldTypeNotFoundException - in case the field type does not exist.
RepositoryException

getDocumentTypeById

public DocumentType getDocumentTypeById(long id,
                                        boolean updateable)
                                 throws RepositoryException
Throws:
DocumentTypeNotFoundException - in case the document type does not exist.
RepositoryException

getDocumentTypeByName

public DocumentType getDocumentTypeByName(java.lang.String name,
                                          boolean updateable)
                                   throws RepositoryException
Throws:
DocumentTypeNotFoundException - in case the document type does not exist.
RepositoryException


Copyright © -2005 . All Rights Reserved.