org.osid.repository
Interface RepositoryManager

All Superinterfaces:
OsidManager, java.io.Serializable

public interface RepositoryManager
extends OsidManager

The RepositoryManager supports creating and deleting Repositories and Assets as well as getting the various Types used.

All implementations of OsidManager (manager) provide methods for accessing and manipulating the various objects defined in the OSID package. A manager defines an implementation of an OSID. All other OSID objects come either directly or indirectly from the manager. New instances of the OSID objects are created either directly or indirectly by the manager. Because the OSID objects are defined using interfaces, create methods must be used instead of the new operator to create instances of the OSID objects. Create methods are used both to instantiate and persist OSID objects. Using the OsidManager class to define an OSID's implementation allows the application to change OSID implementations by changing the OsidManager package name used to load an implementation. Applications developed using managers permit OSID implementation substitution without changing the application source code. As with all managers, use the OsidLoader to load an implementation of this interface.

OSID Version: 2.0

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


Method Summary
 Id copyAsset(Repository repository, Id assetId)
          Create in a Repository a copy of an Asset.
 Repository createRepository(java.lang.String displayName, java.lang.String description, Type repositoryType)
          Create a new Repository of the specified Type.
 void deleteRepository(Id repositoryId)
          Delete a 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 getAssetsBySearch(Repository[] repositories, java.io.Serializable searchCriteria, Type searchType, Properties searchProperties)
          Perform a search of the specified Type and get all the Assets that satisfy the SearchCriteria.
 RepositoryIterator getRepositories()
          Get all the Repositories.
 RepositoryIterator getRepositoriesByType(Type repositoryType)
          Get all the Repositories of the specified Type.
 Repository getRepository(Id repositoryId)
          Get the Repository with the specified unique Id.
 TypeIterator getRepositoryTypes()
          Get all the RepositoryTypes in this RepositoryManager.
 
Methods inherited from interface org.osid.OsidManager
assignConfiguration, assignOsidContext, getOsidContext, osidVersion_2_0
 

Method Detail

createRepository

public Repository createRepository(java.lang.String displayName,
                                   java.lang.String description,
                                   Type repositoryType)
                            throws RepositoryException
Create a new Repository of the specified Type. The implementation of this method sets the Id for the new object.

Parameters:
displayName -
description -
repositoryType -
Returns:
Repository
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

deleteRepository

public void deleteRepository(Id repositoryId)
                      throws RepositoryException
Delete a Repository.

Parameters:
repositoryId -
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

getRepositories

public RepositoryIterator getRepositories()
                                   throws RepositoryException
Get all the Repositories. Iterators return a set, one at a time.

Returns:
RepositoryIterator 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, CONFIGURATION_ERROR, UNIMPLEMENTED

getRepositoriesByType

public RepositoryIterator getRepositoriesByType(Type repositoryType)
                                         throws RepositoryException
Get all the Repositories of the specified Type. Iterators return a set, one at a time.

Parameters:
repositoryType -
Returns:
RepositoryIterator 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

getRepository

public Repository getRepository(Id repositoryId)
                         throws RepositoryException
Get the Repository with the specified unique Id.

Parameters:
repositoryId -
Returns:
Repository
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.

Returns:
org.osid.shared.LongValueIterator
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(Repository[] repositories,
                                       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. The search is performed for all specified Repositories. Iterators return a set, one at a time.

Parameters:
repositories -
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, UNKNOWN_REPOSITORY

copyAsset

public Id copyAsset(Repository repository,
                    Id assetId)
             throws RepositoryException
Create in a Repository 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:
repository -
assetId -
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

getRepositoryTypes

public TypeIterator getRepositoryTypes()
                                throws RepositoryException
Get all the RepositoryTypes in this RepositoryManager. RepositoryTypes are used to categorize Repositories. 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