public interface PositionAdminSession extends OsidSession
This session creates, updates, and deletes Positions.
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
Position,
a PositionForm
is requested using
getPositionFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed. The
returned PositionForm
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 PositionForm
is submitted
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each PositionForm
corresponds to an attempted transaction.
For updates, PositionForms
are requested to the
Position
Id
that is to be updated using
getPositionFormForUpdate().
Similarly, the PositionForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The PositionForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Positions.
To unmap a
Position
from the current Realm,
the
PositionRealmAssignmentSession
should be used. These delete
operations attempt to remove the Position
itself thus
removing it from all known Realm
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 |
aliasPosition(Id positionId,
Id aliasId)
Adds an
Id to a Position for the purpose
of creating compatibility. |
boolean |
canCreatePositions()
Tests if this user can create positions.
|
boolean |
canCreatePositionWithRecordTypes(Type[] positionRecordTypes)
Tests if this user can create a single
Position using
the desired record types. |
boolean |
canDeletePositions()
Tests if this user can delete positions.
|
boolean |
canManagePositionAliases()
Tests if this user can manage
Id aliases for
Positions. |
boolean |
canUpdatePositions()
Tests if this user can update positions.
|
Position |
createPosition(PositionForm positionForm)
Creates a new
Position. |
void |
deletePosition(Id positionId)
Deletes a
Position. |
PositionForm |
getPositionFormForCreate(Id organizationId,
Type[] positionRecordTypes)
Gets the position form for creating new positions.
|
PositionForm |
getPositionFormForUpdate(Id positionId)
Gets the position form for updating an existing position.
|
Realm |
getRealm()
Gets the
Realm associated with this session. |
Id |
getRealmId()
Gets the
Realm Id associated with this
session. |
void |
updatePosition(PositionForm positionForm)
Updates an existing position.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getRealmId()
Realm
Id
associated with this
session. Realm Id
associated with this sessionmandatory
- This method must be implemented. Realm getRealm() throws OperationFailedException, PermissionDeniedException
Realm
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreatePositions()
Position
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 Position
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreatePositionWithRecordTypes(Type[] positionRecordTypes)
Position
using
the desired record types. While
PersonnelManager.getPositionRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Position.
Providing an empty array tests if a Position
can be
created with no records.positionRecordTypes
- array of position record types true
if Position
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- positionRecordTypes
is null
mandatory
- This method must be implemented. PositionForm getPositionFormForCreate(Id organizationId, Type[] positionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
organizationId
- the organization Id
to which
this position belongspositionRecordTypes
- array of position record types to be
included in the create operation or an empty list if noneNotFoundException
- organizationId
is
not foundNullArgumentException
- organizationId
or positionRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- cannot get form for requested
record typesmandatory
- This method must be implemented. Position createPosition(PositionForm positionForm) throws OperationFailedException, PermissionDeniedException
Position.
positionForm
- the form for this Position
Position
IllegalStateException
- positionForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- positionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- positionForm
did
not originate from getPositionFormForCreate()
mandatory
- This method must be implemented. boolean canUpdatePositions()
Position
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 Position
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. PositionForm getPositionFormForUpdate(Id positionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
positionId
- the Id
of the Position
NotFoundException
- positionId
is not
foundNullArgumentException
- positionId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updatePosition(PositionForm positionForm) throws OperationFailedException, PermissionDeniedException
positionForm
- the form containing the elements to be updatedIllegalStateException
- positionForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- positionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- positionForm
did
not originate from getPositionFormForUpdate()
mandatory
- This method must be implemented. boolean canDeletePositions()
Position
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 Position
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deletePosition(Id positionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Position.
positionId
- the Id
of the Position
to removeNotFoundException
- positionId
not foundNullArgumentException
- positionId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManagePositionAliases()
Id
aliases for
Positions.
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 Position
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasPosition(Id positionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Position
for the purpose
of creating compatibility. The primary Id
of the
Position
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is
a pointer to another position, it is reassigned to the given position
Id.
positionId
- the Id
of a Position
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- positionId
not foundNullArgumentException
- positionId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.