public interface HoldAdminSession extends OsidSession
This session creates, updates, and deletes Holds.
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
Hold,
a HoldForm
is requested using
getHoldFormForCreate()
specifying the desired relationship peers
and record Types
or none if no record Types
are needed. The returned HoldForm
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 HoldForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
HoldForm
corresponds to an attempted transaction.
For updates, HoldForms
are requested to the Hold
Id
that is to be updated using
getHoldFormForUpdate().
Similarly, the HoldForm
has
metadata about the data that can be updated and it can perform validation
before submitting the update. The HoldForm
can only be used
once for a successful update and cannot be reused.
The delete operations delete Holds.
To unmap a
Hold
from the current Oubliette,
the
HoldOublietteAssignmentSession
should be used. These delete
operations attempt to remove the Hold
itself thus removing
it from all known Oubliette
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 |
aliasHold(Id holdId,
Id aliasId)
Adds an
Id to a Hold for the purpose of
creating compatibility. |
boolean |
canCreateHolds()
Tests if this user can create
Holds. |
boolean |
canCreateHoldWithRecordTypes(Type[] holdRecordTypes)
Tests if this user can create a single
Hold using the
desired record types. |
boolean |
canDeleteHolds()
Tests if this user can delete
Holds. |
boolean |
canManageHoldAliases()
Tests if this user can manage
Id aliases for
Holds. |
boolean |
canUpdateHolds()
Tests if this user can update
Holds. |
Hold |
createHold(HoldForm holdForm)
Creates a new
Hold. |
void |
deleteHold(Id holdId)
Deletes a
Hold. |
HoldForm |
getHoldFormForCreateForAgent(Id issueId,
Id agentId,
Type[] holdRecordTypes)
Gets the hold form for creating new holds.
|
HoldForm |
getHoldFormForCreateForResource(Id issueId,
Id resourceId,
Type[] holdRecordTypes)
Gets the hold form for creating new holds.
|
HoldForm |
getHoldFormForUpdate(Id holdId)
Gets the hold form for updating an existing hold.
|
Oubliette |
getOubliette()
Gets the
Oubliette associated with this session. |
Id |
getOublietteId()
Gets the
Oubliette Id associated with
this session. |
void |
updateHold(HoldForm holdForm)
Updates an existing hold.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getOublietteId()
Oubliette
Id
associated with
this session. Oubliette Id
associated with this sessionmandatory
- This method must be implemented. Oubliette getOubliette() throws OperationFailedException, PermissionDeniedException
Oubliette
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateHolds()
Holds.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Hold
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false
if Hold
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateHoldWithRecordTypes(Type[] holdRecordTypes)
Hold
using the
desired record types. While HoldManager.getHoldRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
Hold.
Providing an empty array tests if a Hold
can be created with no records.holdRecordTypes
- array of hold record types true
if Hold
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- holdRecordTypes
is null
mandatory
- This method must be implemented. HoldForm getHoldFormForCreateForResource(Id issueId, Id resourceId, Type[] holdRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
issueId
- the Id
for the issueresourceId
- the Id
for the resourceholdRecordTypes
- array of hold record typesNotFoundException
- issueId
or
resourceId
is not foundNullArgumentException
- issueId, resourceId
or holdRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. HoldForm getHoldFormForCreateForAgent(Id issueId, Id agentId, Type[] holdRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
issueId
- the Id
for the issueagentId
- the Id
for the agentholdRecordTypes
- array of hold record typesNotFoundException
- issueId
or
agentId
is not foundNullArgumentException
- issueId, agentId
or holdRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Hold createHold(HoldForm holdForm) throws OperationFailedException, PermissionDeniedException
Hold.
holdForm
- the form for this Hold
Hold
IllegalStateException
- holdForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- holdForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- holdForm
did not
originate from getHoldFormForCreateForResource()
or getHoldFormForCreateForAgent()
mandatory
- This method must be implemented. boolean canUpdateHolds()
Holds.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Hold
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer update operations to an
unauthorized user. false
if Hold
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. HoldForm getHoldFormForUpdate(Id holdId) throws NotFoundException, OperationFailedException
holdId
- the Id
of the Hold
NotFoundException
- holdId
is not foundNullArgumentException
- holdId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void updateHold(HoldForm holdForm) throws OperationFailedException, PermissionDeniedException
holdForm
- the form containing the elements to be updatedIllegalStateException
- holdForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- holdId
or
holdForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- holdForm
did not
originate from getHoldFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteHolds()
Holds.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Hold
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer delete operations to an
unauthorized user. false
if Hold
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteHold(Id holdId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Hold.
holdId
- the Id
of the Hold
to
removeNotFoundException
- holdId
not foundNullArgumentException
- holdId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageHoldAliases()
Id
aliases for
Holds.
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 Hold
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasHold(Id holdId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Hold
for the purpose of
creating compatibility. The primary Id
of the
Hold
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another hold, it is reassigned to the given hold
Id.
holdId
- the Id
of a Hold
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- holdId
not foundNullArgumentException
- holdId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.