Interface DeedAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
DeedBatchAdminSession
This session creates, updates, and deletes Deeds . 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
Deed , a DeedForm is requested using
getDeedFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned DeedForm
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
DeedForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each DeedForm corresponds to an attempted transaction.
For updates, DeedForms are requested to the Deed
Id that is to be updated using getDeedFormForUpdate() .
Similarly, the DeedForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
DeedForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Deeds . To unmap a Deed
from the current Campus , the DeedCampusAssignmentSession
should be used. These delete operations attempt to remove the Deed
itself thus removing it from all known Campus catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds anIdto aDeedfor the purpose of creating compatibility.booleanTests if this user can createDeeds.booleancanCreateDeedWithRecordTypes(Type[] deedRecordTypes) Tests if this user can create a singleDeedusing the desired record interface types.booleanTests if this user can deleteDeedsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forDeeds.booleanTests if this user can updateDeeds.createDeed(DeedForm deedForm) Creates a newDeed.voiddeleteDeed(Id deedId) Deletes aDeed.Gets theCampusassociated with this session.Gets theCampusIdassociated with this session.getDeedFormForCreate(Id buildingId, Id resourceId, Type[] deedRecordTypes) Gets the deed form for creating new deeds.getDeedFormForUpdate(Id deedId) Gets the deed form for updating an existing deed.voidupdateDeed(DeedForm deedForm) Updates an existing deed.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
-
getCampusId
Id getCampusId()Gets theCampusIdassociated with this session.- Returns:
- the
Campus Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCampus
Gets theCampusassociated with this session.- Returns:
- the campus
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateDeeds
boolean canCreateDeeds()Tests if this user can createDeeds. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDeedwill 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:
falseifDeedcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDeedWithRecordTypes
Tests if this user can create a singleDeedusing the desired record interface types. WhileRoomSquattingManager.getDeedRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificDeed. Providing an empty array tests if aDeedcan be created with no records.- Parameters:
deedRecordTypes- array of deed record types- Returns:
trueifDeedcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-deedRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDeedFormForCreate
DeedForm getDeedFormForCreate(Id buildingId, Id resourceId, Type[] deedRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the deed form for creating new deeds. A new form should be requested for each create transaction.- Parameters:
buildingId- theIdof the buildingresourceId- theIdof the owner resourcedeedRecordTypes- array of deed record types- Returns:
- the deed form
- Throws:
NotFoundException-buildngIdorresourceIdis not foundNullArgumentException-buildngId, resourceId, ordeedRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get from for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDeed
Creates a newDeed.- Parameters:
deedForm- the form for thisDeed- Returns:
- the new
Deed - Throws:
IllegalStateException-deedFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-deedFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-deedFormdid not originate fromgetDeedFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDeeds
boolean canUpdateDeeds()Tests if this user can updateDeeds. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDeedwill 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:
falseifDeedmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDeedFormForUpdate
DeedForm getDeedFormForUpdate(Id deedId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the deed form for updating an existing deed. A new deed form should be requested for each update transaction.- Parameters:
deedId- theIdof theDeed- Returns:
- the deed form
- Throws:
NotFoundException-deedIdis not foundNullArgumentException-deedIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDeed
Updates an existing deed.- Parameters:
deedForm- the form containing the elements to be updated- Throws:
IllegalStateException-deedFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-deedFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-deedFormdid not originate fromgetDeedFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDeeds
boolean canDeleteDeeds()Tests if this user can deleteDeedsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDeedwill 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:
falseifDeeddeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDeed
void deleteDeed(Id deedId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDeed.- Parameters:
deedId- theIdof theDeedto remove- Throws:
NotFoundException-deedIdnot foundNullArgumentException-deedIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDeedAliases
boolean canManageDeedAliases()Tests if this user can manageIdaliases forDeeds. 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:
falseifDeedaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDeed
void aliasDeed(Id deedId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDeedfor the purpose of creating compatibility. The primaryIdof theDeedis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another deed, it is reassigned to the given deedId.- Parameters:
deedId- theIdof aDeedaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-deedIdnot foundNullArgumentException-deedIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-