Class AbstractSubOsidManager
java.lang.Object
net.okapia.osid.jamocha.spi.AbstractSubOsidManager
- All Implemented Interfaces:
Closeable, AutoCloseable, OsidManager, OsidProxyManager, OsidManager, OsidProfile, OsidProxyManager, Sourceable
public abstract class AbstractSubOsidManager
extends Object
implements OsidManager, OsidProxyManager
This is an alternative OsidManager class for use as a sub-manager
to a top level OsidManager which does not need its own
configuration and identity.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a newAbstractSubOsidManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeBranch(Id branchId) Changes the service branch.voidchangeBranch(Id branchId, Proxy proxy) Changes the service branch.voidclose()Closes this manager.Gets this service branch.Gets theBranch Idrepresenting this service branch.Gets a branding, such as an image or logo, expressed using theAssetinterface.Gets the branding asset Ids, such as an image or logo, expressed using theAssetinterface.protected ValuegetConfigurationValue(Id parameterId) Gets aValuefor the given parameterId.protected ValueListgetConfigurationValues(Id parameterId) Gets all theValuesfor the given parameterId.Gets a description of this service implementation.Gets a display name for this service implementation.getId()Gets an identifier for this service implementation.Gets the terms of usage with respect to this service implementation.Gets the locales supported in this service.protected OsidManagergetOsidManager(OSID osid, String implClassName) Instantiates an OsidManager.protected OsidProxyManagergetOsidProxyManager(OSID osid, String implClassName) Instantiates an OsidProxyManager.Gets the provider of this service, expressed using theResourceinterface.Gets theResource Idrepresenting the provider of this service.Gets the date this service implementation was released.protected OsidRuntimeManagerGets the runtime environment.Gets the version of this service implementation.voidinitialize(OsidRuntimeManager runtime) Initializes this manager.rollbackService(Date rollbackTime) Rolls back this service to a point in time.rollbackService(Date rollbackTime, Proxy proxy) Rolls back this service to a point in time.booleanTest for support of a journal branching service.booleanTest for support of a journaling rollback service.booleansupportsOSIDVersion(Version version) Test for support of an OSID version.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface OsidProxyManager
getProxy, getProxyCondition
-
Constructor Details
-
AbstractSubOsidManager
Constructs a newAbstractSubOsidManager.- Parameters:
parent- the main OsidManager- Throws:
NullArgumentException-parentisnull
-
-
Method Details
-
initialize
@OSID public void initialize(OsidRuntimeManager runtime) throws ConfigurationErrorException, OperationFailedException Initializes this manager. A manager is initialized once at the time of creation.- Specified by:
initializein interfaceOsidManager- Specified by:
initializein interfaceOsidProxyManager- Parameters:
runtime- the runtime environment- Throws:
ConfigurationErrorException- an error with implementation configurationIllegalStateException- this manager has already been initialized by theOsidLoaderNullArgumentException-runtimeisnullOperationFailedException- unable to complete request
-
getRuntime
-
getId
Gets an identifier for this service implementation. The identifier is unique among services but multiple instantiations of the same service use the sameId.This identifier is the same identifier used in managing OSID installations.- Specified by:
getIdin interfaceOsidProfile- Returns:
- the
Id - Throws:
IllegalStateException- This manager has been closed.
-
getDisplayName
Gets a display name for this service implementation.- Specified by:
getDisplayNamein interfaceOsidProfile- Returns:
- a display name
- Throws:
IllegalStateException- This manager has been closed.
-
getDescription
Gets a description of this service implementation.- Specified by:
getDescriptionin interfaceOsidProfile- Returns:
- a description
- Throws:
IllegalStateException- This manager has been closed.
-
getVersion
Gets the version of this service implementation.- Specified by:
getVersionin interfaceOsidProfile- Returns:
- the version
- Throws:
IllegalStateException- This manager has been closed.
-
getReleaseDate
Gets the date this service implementation was released.- Specified by:
getReleaseDatein interfaceOsidProfile- Returns:
- the release date
- Throws:
IllegalStateException- This manager has been closed.
-
supportsOSIDVersion
Test for support of an OSID version.- Specified by:
supportsOSIDVersionin interfaceOsidProfile- Parameters:
version- the version string to test- Returns:
trueif this manager supports the given version,falseotherwise
-
getLocales
Gets the locales supported in this service.- Specified by:
getLocalesin interfaceOsidProfile- Returns:
- list of locales supported
-
supportsJournalRollback
public boolean supportsJournalRollback()Test for support of a journaling rollback service.- Specified by:
supportsJournalRollbackin interfaceOsidProfile- Returns:
trueif this manager supports the journal rollback,falseotherwise
-
supportsJournalBranching
Test for support of a journal branching service.- Specified by:
supportsJournalBranchingin interfaceOsidProfile- Returns:
trueif this manager supports the journal branching,falseotherwise
-
getBranchId
Gets theBranch Idrepresenting this service branch.- Specified by:
getBranchIdin interfaceOsidProfile- Returns:
- the branch
Id - Throws:
UnimplementedException-supportsJournalBranching()isfalse
-
getBranch
Gets this service branch.- Specified by:
getBranchin interfaceOsidProfile- Returns:
- the service branch
- Throws:
OperationFailedException- unable to complete requestUnimplementedException-supportsJournalBranching()isfalse
-
rollbackService
@OSID public JournalEntry rollbackService(Date rollbackTime) throws OperationFailedException, PermissionDeniedException Rolls back this service to a point in time.- Specified by:
rollbackServicein interfaceOsidManager- Parameters:
rollbackTime- the requested time- Returns:
- the journal entry corresponding to the actual state of this service
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnimplementedException-supportsJournalRollback()isfalse
-
rollbackService
@OSID public JournalEntry rollbackService(Date rollbackTime, Proxy proxy) throws OperationFailedException Rolls back this service to a point in time.- Specified by:
rollbackServicein interfaceOsidProxyManager- Parameters:
rollbackTime- the requested timeproxy- a proxy- Returns:
- the journal entry corresponding to the actual state of this service
- Throws:
NullArgumentException-proxyisnullOperationFailedException- unable to complete requestUnimplementedException-supportsJournalRollback()isfalse
-
changeBranch
@OSID public void changeBranch(Id branchId) throws NotFoundException, OperationFailedException, PermissionDeniedException Changes the service branch.- Specified by:
changeBranchin interfaceOsidManager- Parameters:
branchId- the new service branch- Throws:
NotFoundException-branchIdnot foundNullArgumentException-branchIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnimplementedException-supportsJournalBranching()isfalse
-
changeBranch
@OSID public void changeBranch(Id branchId, Proxy proxy) throws NotFoundException, OperationFailedException, PermissionDeniedException Changes the service branch.- Specified by:
changeBranchin interfaceOsidProxyManager- Parameters:
branchId- the new service branchproxy- a proxy- Throws:
NotFoundException-branchIdnot foundNullArgumentException-branchIdorproxyisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnimplementedException-supportsJournalBranching()isfalse
-
getLicense
Gets the terms of usage with respect to this service implementation.- Specified by:
getLicensein interfaceSourceable- Returns:
- the license
- Throws:
IllegalStateException- This manager has been closed.
-
getProviderId
Gets theResource Idrepresenting the provider of this service.- Specified by:
getProviderIdin interfaceSourceable- Returns:
- the provider
Id - Throws:
IllegalStateException- This manager has been closed.
-
getProvider
Gets the provider of this service, expressed using theResourceinterface.- Specified by:
getProviderin interfaceSourceable- Returns:
- the service provider resource
- Throws:
IllegalStateException- This manager has been closed.OperationFailedException- unable to complete request
-
getBrandingIds
Gets the branding asset Ids, such as an image or logo, expressed using theAssetinterface.- Specified by:
getBrandingIdsin interfaceSourceable- Returns:
- a list of asset Ids
-
getBranding
Gets a branding, such as an image or logo, expressed using theAssetinterface.- Specified by:
getBrandingin interfaceSourceable- Returns:
- a list of assets
- Throws:
IllegalStateException- This manager has been closed.OperationFailedException- unable to complete request
-
getOsidManager
protected OsidManager getOsidManager(OSID osid, String implClassName) throws ConfigurationErrorException, OperationFailedException Instantiates an OsidManager.- Parameters:
osid- the OSID to loadimplClassName- the name of the implementation- Returns:
- the OsidManager
- Throws:
ConfigurationErrorException- an error in configuring the implementationIllegalStateException- manager not initializedOperationFailedException- unable to complete requestNullArgumentException-implClassNameorversionisnullOperationFailedException- unable to completeUnsupportedException-implClassNamedoes not support the requested OSID
-
getOsidProxyManager
protected OsidProxyManager getOsidProxyManager(OSID osid, String implClassName) throws ConfigurationErrorException, OperationFailedException Instantiates an OsidProxyManager.- Parameters:
osid- the OSID to loadimplClassName- the name of the implementation- Returns:
- the OsidManager
- Throws:
ConfigurationErrorException- an error in configuring the implementationIllegalStateException- manager not initializedOperationFailedException- unable to complete requestNullArgumentException-implClassNameorversionisnullOperationFailedException- unable to completeUnsupportedException-implClassNamedoes not support the requested OSID
-
getConfigurationValue
protected Value getConfigurationValue(Id parameterId) throws ConfigurationErrorException, OperationFailedException Gets aValuefor the given parameterId.If more than one value exists for the given parameter, the most preferred value is returned. This method can be used as a convenience when only one value is expected.getApplicableValuesByParameters()should be used for getting all the active values.- Parameters:
parameterId- theIdof theParameterto retrieve- Returns:
- the value
- Throws:
ConfigurationErrorException- theparameterIdnot found or no value availableIllegalStateException- manager not initializedNullArgumentException- theparameterIdisnullOperationFailedException- unable to complete request
-
getConfigurationValues
protected ValueList getConfigurationValues(Id parameterId) throws ConfigurationErrorException, OperationFailedException Gets all theValuesfor the given parameterId.- Parameters:
parameterId- theIdof theParameterto retrieve- Returns:
- the value list
- Throws:
ConfigurationErrorException- theparameterIdnot foundIllegalStateException- manager not initializedNullArgumentException- theparameterIdisnullOperationFailedException- unable to complete request
-
close
Closes this manager.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceOsidManager- Specified by:
closein interfaceOsidProxyManager- Throws:
IllegalStateException- this manager has been closed
-