public interface RelevancyAdminSession extends OsidSession
This session creates, updates, and deletes Relevancies.
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
Relevancy,
a RelevancyForm
is requested using
getRelevancyFormForCreate()
specifying the desired peers
and record Types
or none if no record Types
are needed. The returned RelevancyForm
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 RelevancyForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
RelevancyForm
corresponds to an attempted transaction.
For updates, RelevancyForms
are requested to the
Relevancy
Id
that is to be updated using
getRelevancyFormForUpdate().
Similarly, the RelevancyForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The RelevancyForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Relevancies.
To unmap a
Relevancy
from the current Ontology,
the
RelevancyOntologyAssignmentSession
should be used. These
delete operations attempt to remove the Relevancy
itself
thus removing it from all known Ontology
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 |
aliasRelevancy(Id relevancyId,
Id aliasId)
Adds an
Id to a Relevancy for the
purpose of creating compatibility. |
boolean |
canCreateRelevancies()
Tests if this user can create relevancies.
|
boolean |
canCreateRelevancyWithRecordTypes(Type[] relevancyRecordTypes)
Tests if this user can create a single
Relevancy using
the desired record interface types. |
boolean |
canDeleteRelevancies()
Tests if this user can delete relevancies.
|
boolean |
canManageRelevancyAliases()
Tests if this user can manage
Id aliases for
relevancies. |
boolean |
canUpdateRelevancies()
Tests if this user can update relevancies.
|
Relevancy |
createRelevancy(RelevancyForm relevancyForm)
Creates a new
Relevancy. |
void |
deleteRelevancy(Id relevancyId)
Deletes the
Relevancy identified by the given
Id. |
Ontology |
getOntology()
Gets the
Ontology associated with this session. |
Id |
getOntologyId()
Gets the
Ontology Id associated with
this session. |
RelevancyForm |
getRelevancyFormForCreate(Id subjectId,
Id id,
Type[] relevancyRecordTypes)
Gets the relevancy form for creating new relevancies.
|
RelevancyForm |
getRelevancyFormForUpdate(Id relevancyId)
Gets the relevancy form for updating an existing relevancy.
|
void |
updateRelevancy(RelevancyForm relevancyForm)
Updates an existing relevancy.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getOntologyId()
Ontology
Id
associated with
this session. Ontology Id
associated with this sessionmandatory
- This method must be implemented. Ontology getOntology() throws OperationFailedException, PermissionDeniedException
Ontology
associated with this session. Ontology
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateRelevancies()
Relevancy
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 Relevancy
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateRelevancyWithRecordTypes(Type[] relevancyRecordTypes)
Relevancy
using
the desired record interface types. While
OntologyManager.getRelevancyRecordTypes()
can be used to
examine which record interfaces are supported, this method tests which
record(s) are required for creating a specific Relevancy.
Providing an empty array tests if a Relevancy
can be created with no records.relevancyRecordTypes
- array of relevancy record types true
if Relevancy
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- relevancyRecordTypes
is null
mandatory
- This method must be implemented. RelevancyForm getRelevancyFormForCreate(Id subjectId, Id id, Type[] relevancyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
subjectId
- the Id
of the Subject
id
- a mapped Id
relevancyRecordTypes
- array of relevancy record typesNotFoundException
- subjectId
is not
foundNullArgumentException
- subjectId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Relevancy createRelevancy(RelevancyForm relevancyForm) throws OperationFailedException, PermissionDeniedException
Relevancy.
relevancyForm
- the form for this Relevancy
Relevancy
IllegalStateException
- relevancyForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- relevancyForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- relevancyForm
did
not originate from getRelevancyFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateRelevancies()
Relevancy
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 relevancy modification is not
authorized, true
otherwisemandatory
- This method must be implemented. RelevancyForm getRelevancyFormForUpdate(Id relevancyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
relevancyId
- the Id
of the Relevancy
NotFoundException
- relevancyId
is not
foundNullArgumentException
- relevancyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateRelevancy(RelevancyForm relevancyForm) throws OperationFailedException, PermissionDeniedException
relevancyForm
- the form containing the elements to be updatedIllegalStateException
- relevancyForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- relevancyForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- relevancyForm
did
not originate from getRelevancyFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteRelevancies()
Relevancy
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 Relevancy
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteRelevancy(Id relevancyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Relevancy
identified by the given
Id.
relevancyId
- the Id
of the Relevancy
to deleteNotFoundException
- a Relevancy
was not
found identified by the given Id
NullArgumentException
- relevancyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageRelevancyAliases()
Id
aliases for
relevancies. 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 Relevancy
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasRelevancy(Id relevancyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Relevancy
for the
purpose of creating compatibility. The primary Id
of
the Relevancy
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another relevancy, it is
reassigned to the given relevancy Id.
relevancyId
- the Id
of a Relevancy
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- relevancyId
not
foundNullArgumentException
- relevancyId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.