public interface DeedAdminSession extends OsidSession
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasDeed(Id deedId,
Id aliasId)
Adds an
Id to a Deed for the purpose of
creating compatibility. |
boolean |
canCreateDeeds()
Tests if this user can create
Deeds. |
boolean |
canCreateDeedWithRecordTypes(Type[] deedRecordTypes)
Tests if this user can create a single
Deed using the
desired record interface types. |
boolean |
canDeleteDeeds()
Tests if this user can delete
Deeds A return of true
does not guarantee successful authorization. |
boolean |
canManageDeedAliases()
Tests if this user can manage
Id aliases for
Deeds. |
boolean |
canUpdateDeeds()
Tests if this user can update
Deeds. |
Deed |
createDeed(DeedForm deedForm)
Creates a new
Deed. |
void |
deleteDeed(Id deedId)
Deletes a
Deed. |
Campus |
getCampus()
Gets the
Campus associated with this session. |
Id |
getCampusId()
Gets the
Campus Id associated with this
session. |
DeedForm |
getDeedFormForCreate(Id buildingId,
Id resourceId,
Type[] deedRecordTypes)
Gets the deed form for creating new deeds.
|
DeedForm |
getDeedFormForUpdate(Id deedId)
Gets the deed form for updating an existing deed.
|
void |
updateDeed(DeedForm deedForm)
Updates an existing deed.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCampusId()
Campus
Id
associated with this
session. Campus Id
associated with this sessionmandatory
- This method must be implemented. Campus getCampus() throws OperationFailedException, PermissionDeniedException
Campus
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateDeeds()
Deeds.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Deed
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer create operations to
unauthorized users. false
if Deed
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateDeedWithRecordTypes(Type[] deedRecordTypes)
Deed
using the
desired record interface types. While
RoomSquattingManager.getDeedRecordTypes()
can be used to
examine which record interfaces are supported, this method tests which
record(s) are required for creating a specific Deed.
Providing an empty array tests if a Deed
can be created
with no records.deedRecordTypes
- array of deed record types true
if Deed
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- deedRecordTypes
is null
mandatory
- This method must be implemented. DeedForm getDeedFormForCreate(Id buildingId, Id resourceId, Type[] deedRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
buildingId
- the Id
of the buildingresourceId
- the Id
of the owner resourcedeedRecordTypes
- array of deed record typesNotFoundException
- buildngId
or
resourceId
is not foundNullArgumentException
- buildngId, resourceId
, or deedRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get from for requested
record typesmandatory
- This method must be implemented. Deed createDeed(DeedForm deedForm) throws OperationFailedException, PermissionDeniedException
Deed.
deedForm
- the form for this Deed
Deed
IllegalStateException
- deedForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- deedForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- deedForm
did not
originate from getDeedFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateDeeds()
Deeds.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Deed
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer update operations to
unauthorized users. false
if Deed
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. DeedForm getDeedFormForUpdate(Id deedId) throws NotFoundException, OperationFailedException, PermissionDeniedException
deedId
- the Id
of the Deed
NotFoundException
- deedId
is not foundNullArgumentException
- deedId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateDeed(DeedForm deedForm) throws OperationFailedException, PermissionDeniedException
deedForm
- the form containing the elements to be updatedIllegalStateException
- deedForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- deedForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- deedForm
did not
originate from getDeedFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteDeeds()
Deeds
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Deed
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer delete operations to
unauthorized users. false
if Deed
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteDeed(Id deedId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Deed.
deedId
- the Id
of the Deed
to
removeNotFoundException
- deedId
not foundNullArgumentException
- deedId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageDeedAliases()
Id
aliases for
Deeds.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if Deed
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasDeed(Id deedId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Deed
for the purpose of
creating compatibility. The primary Id
of the
Deed
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another deed, it is reassigned to the given deed
Id.
deedId
- the Id
of a Deed
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- deedId
not foundNullArgumentException
- deedId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.