org.osid.repository
Interface Repository

All Superinterfaces:
java.io.Serializable

public interface Repository
extends java.io.Serializable

Repository manages Assets of various Types and information about the Assets. Assets are created, persisted, and validated by the Repository. When initially created, an Asset has an immutable Type and unique Id and its validation status is false. In this state, all methods can be called, but integrity checks are not enforced. When the Asset and its Records are ready to be validated, the validateAsset method checks the Asset and sets the validation status. When working with a valid Asset, all methods include integrity checks and an exception is thrown if the activity would result in an inappropriate state. Optionally, the invalidateAsset method can be called to release the requirement for integrity checks, but the Asset will not become valid again, until validateAsset is called and the entire Asset is checked.

OSID Version: 2.0

Licensed under the MIT O.K.I. OSID Definition License.


Method Summary
 Id copyAsset(Asset asset)
          Create a copy of an Asset.
 Asset createAsset(java.lang.String displayName, java.lang.String description, Type assetType)
          Create a new Asset of this AssetType in this Repository.
 void deleteAsset(Id assetId)
          Delete an Asset from this Repository.
 Asset getAsset(Id assetId)
          Get the Asset with the specified unique Id.
 Asset getAssetByDate(Id assetId, long date)
          Get the Asset with the specified unique Id that is appropriate for the date specified.
 LongValueIterator getAssetDates(Id assetId)
          Get all the dates for the Asset with the specified unique Id.
 AssetIterator getAssets()
          Get all the Assets in this Repository.
 AssetIterator getAssetsBySearch(java.io.Serializable searchCriteria, Type searchType, Properties searchProperties)
          Perform a search of the specified Type and get all the Assets that satisfy the SearchCriteria.
 AssetIterator getAssetsByType(Type assetType)
          Get all the Assets of the specified AssetType in this Asset.
 TypeIterator getAssetTypes()
          Get all the AssetTypes in this Repository.
 java.lang.String getDescription()
          Get the description for this Repository.
 java.lang.String getDisplayName()
          Get the display name for this Repository.
 Id getId()
          Get the unique Id for this Repository.
 RecordStructureIterator getMandatoryRecordStructures(Type assetType)
          Get the RecordStructures that this AssetType must support.
 PropertiesIterator getProperties()
          Get the Properties associated with this Repository.
 Properties getPropertiesByType(Type propertiesType)
          Get the Properties of this Type associated with this Repository.
 TypeIterator getPropertyTypes()
          Get all the Property Types for Repository.
 RecordStructureIterator getRecordStructures()
          Get all the RecordStructures in this Repository.
 RecordStructureIterator getRecordStructuresByType(Type recordStructureType)
          Get all the RecordStructures with the specified RecordStructureType in this Repository.
 TypeIterator getSearchTypes()
          Get all the SearchTypes supported by this Repository.
 Type getStatus(Id assetId)
          Get the StatusType of the Asset with the specified unique Id.
 TypeIterator getStatusTypes()
          Get all the StatusTypes supported by this Repository.
 Type getType()
          Get the RepositoryType of this Repository.
 void invalidateAsset(Id assetId)
          Set the Asset's status Type accordingly and relax validation checking when creating Records and Parts or updating Parts' values.
 boolean supportsUpdate()
          This method indicates whether this implementation supports Repository methods: copyAsset, deleteAsset, invalidateAsset, updateDescription, updateDisplayName.
 boolean supportsVersioning()
          This method indicates whether this implementation supports Repository methods getAssetsDates() and getAssetByDate()
 void updateDescription(java.lang.String description)
          Update the description for this Repository.
 void updateDisplayName(java.lang.String displayName)
          Update the display name for this Repository.
 boolean validateAsset(Id assetId)
          Validate all the Records for an Asset and set its status Type accordingly.
 

Method Detail

updateDisplayName

public void updateDisplayName(java.lang.String displayName)
                       throws RepositoryException
Update the display name for this Repository.

Parameters:
displayName -
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT

getDisplayName

public java.lang.String getDisplayName()
                                throws RepositoryException
Get the display name for this Repository.

Returns:
String the display name
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getId

public Id getId()
         throws RepositoryException
Get the unique Id for this Repository.

Returns:
org.osid.shared.Id A unique Id that is usually set by a create method's implementation.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getType

public Type getType()
             throws RepositoryException
Get the RepositoryType of this Repository.

Returns:
org.osid.shared.Type
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getDescription

public java.lang.String getDescription()
                                throws RepositoryException
Get the description for this Repository.

Returns:
String the description
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

updateDescription

public void updateDescription(java.lang.String description)
                       throws RepositoryException
Update the description for this Repository.

Parameters:
description -
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT

createAsset

public Asset createAsset(java.lang.String displayName,
                         java.lang.String description,
                         Type assetType)
                  throws RepositoryException
Create a new Asset of this AssetType in this Repository. The implementation of this method sets the Id for the new object.

Returns:
Asset
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE

deleteAsset

public void deleteAsset(Id assetId)
                 throws RepositoryException
Delete an Asset from this Repository.

Parameters:
assetId -
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID

getAssets

public AssetIterator getAssets()
                        throws RepositoryException
Get all the Assets in this Repository. Iterators return a set, one at a time.

Returns:
AssetIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getAssetsByType

public AssetIterator getAssetsByType(Type assetType)
                              throws RepositoryException
Get all the Assets of the specified AssetType in this Asset. Iterators return a set, one at a time.

Returns:
AssetIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE

getAssetTypes

public TypeIterator getAssetTypes()
                           throws RepositoryException
Get all the AssetTypes in this Repository. AssetTypes are used to categorize Assets. Iterators return a set, one at a time.

Returns:
org.osid.shared.TypeIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getPropertiesByType

public Properties getPropertiesByType(Type propertiesType)
                               throws RepositoryException
Get the Properties of this Type associated with this Repository.

Returns:
org.osid.shared.Properties
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE

getPropertyTypes

public TypeIterator getPropertyTypes()
                              throws RepositoryException
Get all the Property Types for Repository.

Returns:
org.osid.shared.TypeIterator
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getProperties

public PropertiesIterator getProperties()
                                 throws RepositoryException
Get the Properties associated with this Repository.

Returns:
org.osid.shared.PropertiesIterator
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getRecordStructures

public RecordStructureIterator getRecordStructures()
                                            throws RepositoryException
Get all the RecordStructures in this Repository. RecordStructures are used to categorize information about Assets. Iterators return a set, one at a time.

Returns:
RecordStructureIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getRecordStructuresByType

public RecordStructureIterator getRecordStructuresByType(Type recordStructureType)
                                                  throws RepositoryException
Get all the RecordStructures with the specified RecordStructureType in this Repository. RecordStructures are used to categorize information about Assets. Iterators return a set, one at a time.

Parameters:
recordStructureType -
Returns:
RecordStructureIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getMandatoryRecordStructures

public RecordStructureIterator getMandatoryRecordStructures(Type assetType)
                                                     throws RepositoryException
Get the RecordStructures that this AssetType must support. RecordStructures are used to categorize information about Assets. Iterators return a set, one at a time.

Parameters:
assetType -
Returns:
RecordStructureIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE

getSearchTypes

public TypeIterator getSearchTypes()
                            throws RepositoryException
Get all the SearchTypes supported by this Repository. Iterators return a set, one at a time.

Returns:
org.osid.shared.TypeIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getStatusTypes

public TypeIterator getStatusTypes()
                            throws RepositoryException
Get all the StatusTypes supported by this Repository. Iterators return a set, one at a time.

Returns:
org.osid.shared.TypeIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

getStatus

public Type getStatus(Id assetId)
               throws RepositoryException
Get the StatusType of the Asset with the specified unique Id.

Returns:
org.osid.shared.Type
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID

validateAsset

public boolean validateAsset(Id assetId)
                      throws RepositoryException
Validate all the Records for an Asset and set its status Type accordingly. If the Asset is valid, return true; otherwise return false. The implementation may throw an Exception for any validation failures and use the Exception's message to identify specific causes.

Parameters:
assetId -
Returns:
boolean
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID

invalidateAsset

public void invalidateAsset(Id assetId)
                     throws RepositoryException
Set the Asset's status Type accordingly and relax validation checking when creating Records and Parts or updating Parts' values.

Parameters:
assetId -
Returns:
boolean
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID

getAsset

public Asset getAsset(Id assetId)
               throws RepositoryException
Get the Asset with the specified unique Id.

Parameters:
assetId -
Returns:
Asset
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID

getAssetByDate

public Asset getAssetByDate(Id assetId,
                            long date)
                     throws RepositoryException
Get the Asset with the specified unique Id that is appropriate for the date specified. The specified date allows a Repository implementation to support Asset versioning.

Parameters:
assetId -
date - the number of milliseconds since January 1, 1970, 00:00:00 GMT
Returns:
Asset
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, NO_OBJECT_WITH_THIS_DATE

getAssetDates

public LongValueIterator getAssetDates(Id assetId)
                                throws RepositoryException
Get all the dates for the Asset with the specified unique Id. These dates allows a Repository implementation to support Asset versioning.

Parameters:
assetId -
Returns:
org.osid.shared.LongValueIterator (a date is the number of milliseconds since January 1, 1970, 00:00:00 GMT)
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT

getAssetsBySearch

public AssetIterator getAssetsBySearch(java.io.Serializable searchCriteria,
                                       Type searchType,
                                       Properties searchProperties)
                                throws RepositoryException
Perform a search of the specified Type and get all the Assets that satisfy the SearchCriteria. Iterators return a set, one at a time.

Parameters:
searchCriteria -
searchType -
searchProperties -
Returns:
AssetIterator The order of the objects returned by the Iterator is not guaranteed.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_TYPE

copyAsset

public Id copyAsset(Asset asset)
             throws RepositoryException
Create a copy of an Asset. The Id, AssetType, and Repository for the new Asset is set by the implementation. All Records are similarly copied.

Parameters:
asset -
Returns:
org.osid.shared.Id
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED, NULL_ARGUMENT, UNKNOWN_ID

supportsVersioning

public boolean supportsVersioning()
                           throws RepositoryException
This method indicates whether this implementation supports Repository methods getAssetsDates() and getAssetByDate()

Returns:
boolean false indicates that these methods will throw UNIMPLEMENTED, true indicates this implementation supports Repository methods getAssetsDates() and getAssetByDate()
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED

supportsUpdate

public boolean supportsUpdate()
                       throws RepositoryException
This method indicates whether this implementation supports Repository methods: copyAsset, deleteAsset, invalidateAsset, updateDescription, updateDisplayName. Asset methods: addAsset, copyRecordStructure, createRecord, deleteRecord, inheritRecordStructure, removeAsset, updateContent, updateDescription, updateDisplayName, updateEffectiveDate, updateExpirationDate. Part methods: createPart, deletePart, updateDisplayName, updateValue. PartStructure methods: updateDisplayName, validatePart. Record methods: createPart, deletePart, updateDisplayName. RecordStructure methods: updateDisplayName, validateRecord.

Returns:
boolean false indicates that these methods will throw UNIMPLEMENTED, true indicates this implementation supports Repository methods: copyAsset, deleteAsset, invalidateAsset, updateDescription, updateDisplayName. Asset methods: addAsset, copyRecordStructure, createRecord, deleteRecord, inheritRecordStructure, removeAsset, updateContent, updateDescription, updateDisplayName, updateEffectiveDate, updateExpirationDate. Part methods: createPart, deletePart, updateDisplayName, updateValue. PartStructure methods: updateDisplayName, validatePart. Record methods: createPart, deletePart, updateDisplayName. RecordStructure methods: updateDisplayName, validateRecord.
Throws:
RepositoryException - An exception with one of the following messages defined in org.osid.repository.RepositoryException may be thrown: OPERATION_FAILED, PERMISSION_DENIED, CONFIGURATION_ERROR, UNIMPLEMENTED