Interface RelevancyAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RelevancyBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasRelevancy(Id relevancyId, Id aliasId) Adds anIdto aRelevancyfor the purpose of creating compatibility.booleanTests if this user can create relevancies.booleancanCreateRelevancyWithRecordTypes(Type[] relevancyRecordTypes) Tests if this user can create a singleRelevancyusing the desired record interface types.booleanTests if this user can delete relevancies.booleanTests if this user can manageIdaliases for relevancies.booleanTests if this user can update relevancies.createRelevancy(RelevancyForm relevancyForm) Creates a newRelevancy.voiddeleteRelevancy(Id relevancyId) Deletes theRelevancyidentified by the givenId.Gets theOntologyassociated with this session.Gets theOntologyIdassociated with this session.getRelevancyFormForCreate(Id subjectId, Id id, Type[] relevancyRecordTypes) Gets the relevancy form for creating new relevancies.getRelevancyFormForUpdate(Id relevancyId) Gets the relevancy form for updating an existing relevancy.voidupdateRelevancy(RelevancyForm relevancyForm) Updates an existing relevancy.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
-
getOntologyId
Id getOntologyId()Gets theOntologyIdassociated with this session.- Returns:
- the
Ontology Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getOntology
Gets theOntologyassociated with this session.- Returns:
- the
Ontologyassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRelevancies
boolean canCreateRelevancies()Tests if this user can create relevancies. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRelevancywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifRelevancycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRelevancyWithRecordTypes
Tests if this user can create a singleRelevancyusing the desired record interface types. WhileOntologyManager.getRelevancyRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificRelevancy. Providing an empty array tests if aRelevancycan be created with no records.- Parameters:
relevancyRecordTypes- array of relevancy record types- Returns:
trueifRelevancycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-relevancyRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRelevancyFormForCreate
RelevancyForm getRelevancyFormForCreate(Id subjectId, Id id, Type[] relevancyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the relevancy form for creating new relevancies. A new form should be requested for each create transaction.- Parameters:
subjectId- theIdof theSubjectid- a mappedIdrelevancyRecordTypes- array of relevancy record types- Returns:
- the relevancy form
- Throws:
NotFoundException-subjectIdis not foundNullArgumentException-subjectIdoridisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRelevancy
Relevancy createRelevancy(RelevancyForm relevancyForm) throws OperationFailedException, PermissionDeniedException Creates a newRelevancy.- Parameters:
relevancyForm- the form for thisRelevancy- Returns:
- the new
Relevancy - Throws:
IllegalStateException-relevancyFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-relevancyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-relevancyFormdid not originate fromgetRelevancyFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRelevancies
boolean canUpdateRelevancies()Tests if this user can update relevancies. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRelevancywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseif relevancy modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRelevancyFormForUpdate
RelevancyForm getRelevancyFormForUpdate(Id relevancyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the relevancy form for updating an existing relevancy. A new relevancy form should be requested for each update transaction.- Parameters:
relevancyId- theIdof theRelevancy- Returns:
- the relevancy form
- Throws:
NotFoundException-relevancyIdis not foundNullArgumentException-relevancyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRelevancy
void updateRelevancy(RelevancyForm relevancyForm) throws OperationFailedException, PermissionDeniedException Updates an existing relevancy.- Parameters:
relevancyForm- the form containing the elements to be updated- Throws:
IllegalStateException-relevancyFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-relevancyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-relevancyFormdid not originate fromgetRelevancyFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteRelevancies
boolean canDeleteRelevancies()Tests if this user can delete relevancies. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRelevancywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifRelevancydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRelevancy
void deleteRelevancy(Id relevancyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theRelevancyidentified by the givenId.- Parameters:
relevancyId- theIdof theRelevancyto delete- Throws:
NotFoundException- aRelevancywas not found identified by the givenIdNullArgumentException-relevancyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRelevancyAliases
boolean canManageRelevancyAliases()Tests if this user can manageIdaliases 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifRelevancyaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRelevancy
void aliasRelevancy(Id relevancyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRelevancyfor the purpose of creating compatibility. The primaryIdof theRelevancyis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another relevancy, it is reassigned to the given relevancyId.- Parameters:
relevancyId- theIdof aRelevancyaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-relevancyIdnot foundNullArgumentException-relevancyIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-