Interface SystemAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
SystemBatchAdminSession
This session creates, updates, and deletes Systems . The data
for create and update is provided by the consumer via the form object.
OsidForms are requested for each create or update and may not be
reused.
Create and update operations differ in their usage. To create a
System , a SystemForm is requested using
getSystemFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
SystemForm will indicate that it is to be used with a create operation
and can be used to examine metdata or validate data prior to creation.
Once the SystemForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each SystemForm corresponds to an attempted
transaction.
For updates, SystemForms are requested to the System
Id that is to be updated using getSystemFormForUpdate() .
Similarly, the SystemForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
SystemForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Systems .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasSystem(Id systemId, Id aliasId) Adds anIdto aSystemfor the purpose of creating compatibility.booleanTests if this user can createSystems.booleancanCreateSystemWithRecordTypes(Type[] systemRecordTypes) Tests if this user can create a singleSystemusing the desired record types.booleanTests if this user can deleteSystems.booleanTests if this user can manageIdaliases forSystems.booleanTests if this user can updateSystems.createSystem(SystemForm systemForm) Creates a newSystem.voiddeleteSystem(Id systemId) Deletes aSystem.getSystemFormForCreate(Type[] systemRecordTypes) Gets the system form for creating new systems.getSystemFormForUpdate(Id systemId) Gets the system form for updating an existing system.voidupdateSystem(SystemForm systemForm) Updates an existing systemMethods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canCreateSystems
boolean canCreateSystems()Tests if this user can createSystems. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aSystem. will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifSystemcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateSystemWithRecordTypes
Tests if this user can create a singleSystemusing the desired record types. WhileControlManager.getSystemRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificSystem. Providing an empty array tests if aSystemcan be created with no records.- Parameters:
systemRecordTypes- array of system record types- Returns:
trueifSystemcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-systemRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getSystemFormForCreate
SystemForm getSystemFormForCreate(Type[] systemRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the system form for creating new systems. A new form should be requested for each create transaction.- Parameters:
systemRecordTypes- array of system record types- Returns:
- the system form
- Throws:
NullArgumentException-systemRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createSystem
System createSystem(SystemForm systemForm) throws OperationFailedException, PermissionDeniedException Creates a newSystem.- Parameters:
systemForm- the form for thisSystem- Returns:
- the new
System - Throws:
IllegalStateException-systemFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-systemFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-systemFormdid not originate fromgetSystemFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateSystems
boolean canUpdateSystems()Tests if this user can updateSystems. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aSystemwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifSystemmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getSystemFormForUpdate
SystemForm getSystemFormForUpdate(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the system form for updating an existing system. A new system form should be requested for each update transaction.- Parameters:
systemId- theIdof theSystem- Returns:
- the system form
- Throws:
NotFoundException-systemIdis not foundNullArgumentException-systemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateSystem
Updates an existing system- Parameters:
systemForm- the form containing the elements to be updated- Throws:
IllegalStateException-systemFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-systemFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-systemFormdid not originate fromgetSystemFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteSystems
boolean canDeleteSystems()Tests if this user can deleteSystems. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aSystemwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifSystemdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteSystem
void deleteSystem(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aSystem.- Parameters:
systemId- theIdof theSystemto remove- Throws:
NotFoundException-systemIdnot foundNullArgumentException-systemIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageSystemAliases
boolean canManageSystemAliases()Tests if this user can manageIdaliases forSystems. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifSystemaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasSystem
void aliasSystem(Id systemId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aSystemfor the purpose of creating compatibility. The primaryIdof theSystemis determined by the provider. The newIdperforms as an alias to the primaryId.- Parameters:
systemId- theIdof aSystemaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-systemIdnot foundNullArgumentException-systemIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-