Interface RealmAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RealmBatchAdminSession
This session creates, updates, and deletes Realms . 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
Realm , a RealmForm is requested using
getRealmFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned RealmForm
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
RealmForm is submitted to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each RealmForm corresponds to an attempted transaction.
For updates, RealmForms are requested to the Realm
Id that is to be updated using getRealmFormForUpdate() .
Similarly, the RealmForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
RealmForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Realms . It is safer to remove
all mappings to the Realm catalogs before deletion.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasRealm(Id realmId, Id aliasId) Adds anIdto aRealmfor the purpose of creating compatibility.booleanTests if this user can createRealms.booleancanCreateRealmWithRecordTypes(Type[] realmRecordTypes) Tests if this user can create a singleRealmusing the desired record types.booleanTests if this user can deleteRealmsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forRealms.booleanTests if this user can updateRealms.createRealm(RealmForm realmForm) Creates a newRealm.voiddeleteRealm(Id realmId) Deletes aRealm.getRealmFormForCreate(Type[] realmRecordTypes) Gets the realm form for creating new realms.getRealmFormForUpdate(Id realmId) Gets the realm form for updating an existing realm.voidupdateRealm(RealmForm realmForm) Updates an existing realm.Methods 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
-
canCreateRealms
boolean canCreateRealms()Tests if this user can createRealms. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRealmwill 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:
falseifRealmcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRealmWithRecordTypes
Tests if this user can create a singleRealmusing the desired record types. WhilePersonnelManager.getRealmRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRealm. Providing an empty array tests if aRealmcan be created with no records.- Parameters:
realmRecordTypes- array of types- Returns:
trueifRealmcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-realmRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRealmFormForCreate
RealmForm getRealmFormForCreate(Type[] realmRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the realm form for creating new realms. A new form should be requested for each create transaction.- Parameters:
realmRecordTypes- array of types- Returns:
- the realm form
- Throws:
NullArgumentException-realmRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- cannot get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRealm
Creates a newRealm.- Parameters:
realmForm- the form for thisRealm- Returns:
- the new
Realm - Throws:
IllegalStateException-realmFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-realmFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-realmFormdid not originate fromgetRealmFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRealms
boolean canUpdateRealms()Tests if this user can updateRealms. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRealmwill 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:
falseifRealmmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRealmFormForUpdate
RealmForm getRealmFormForUpdate(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the realm form for updating an existing realm. A new realm form should be requested for each update transaction.- Parameters:
realmId- theIdof theRealm- Returns:
- the realm form
- Throws:
NotFoundException-realmIdis not foundNullArgumentException-realmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRealm
Updates an existing realm.- Parameters:
realmForm- the form containing the elements to be updated- Throws:
IllegalStateException-realmFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-realmFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-realmForm did not originate from getRealmtFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteRealms
boolean canDeleteRealms()Tests if this user can deleteRealmsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRealmwill 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:
falseifRealmdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRealm
void deleteRealm(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRealm.- Parameters:
realmId- theIdof theRealmto remove- Throws:
NotFoundException-realmIdnot foundNullArgumentException-realmIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRealmAliases
boolean canManageRealmAliases()Tests if this user can manageIdaliases forRealms. 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:
falseifRealmaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRealm
void aliasRealm(Id realmId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRealmfor the purpose of creating compatibility. The primaryIdof theItemis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another realm, it is reassigned to the given realmId.- Parameters:
realmId- theIdof aRealmaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-realmIdnot foundNullArgumentException-realmIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-