Interface PublisherAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
PublisherBatchAdminSession
This session creates and removes publishers. The data for create and update is provided by the consumer via the form.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasPublisher(Id publisherId, Id aliasId) Adds anIdto aPublisherfor the purpose of creating compatibility.booleanTests if this user can createPublishers.booleancanCreatePublisherWithRecordTypes(Type[] publisherRecordTypes) Tests if this user can create a singlePublisherusing the desired record interface types.booleanTests if this user can deletePublishersA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forPublishers.booleanTests if this user can updatePublishers.createPublisher(PublisherForm publisherForm) Creates a newPublisher.voiddeletePublisher(Id publisherId) Deletes aPublisher.getPublisherFormForCreate(Type[] publisherRecordTypes) Gets the publisher form for creating new publishers.getPublisherFormForUpdate(Id publisherId) Gets the publisher form for updating an existing publisher.voidupdatePublisher(PublisherForm publisherForm) Updates an existing publisher.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
-
canCreatePublishers
boolean canCreatePublishers()Tests if this user can createPublishers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aPublisherwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifPublishercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreatePublisherWithRecordTypes
Tests if this user can create a singlePublisherusing the desired record interface types. WhileSubscriptionManager.getPublisherRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificPublisher. Providing an empty array tests if aPublishercan be created with no records.- Parameters:
publisherRecordTypes- array of publisher record types- Returns:
trueifPublishercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-publisherRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getPublisherFormForCreate
PublisherForm getPublisherFormForCreate(Type[] publisherRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the publisher form for creating new publishers. A new form should be requested for each create transaction.- Parameters:
publisherRecordTypes- array of publisher record types- Returns:
- the publisher form
- Throws:
NullArgumentException-publisherRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get foem for requested record types- Compliance:
mandatory- This method must be implemented.
-
createPublisher
Publisher createPublisher(PublisherForm publisherForm) throws OperationFailedException, PermissionDeniedException Creates a newPublisher.- Parameters:
publisherForm- the form for thisPublisher- Returns:
- the new
Publisher - Throws:
IllegalStateException-publisherFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-publisherFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-publisherFormdid not originate fromgetPublisherFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdatePublishers
boolean canUpdatePublishers()Tests if this user can updatePublishers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aPublisherwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifPublishermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getPublisherFormForUpdate
PublisherForm getPublisherFormForUpdate(Id publisherId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the publisher form for updating an existing publisher. A new publisher form should be requested for each update transaction.- Parameters:
publisherId- theIdof thePublisher- Returns:
- the publisher form
- Throws:
NotFoundException-publisherIdis not foundNullArgumentException-publisherIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePublisher
void updatePublisher(PublisherForm publisherForm) throws OperationFailedException, PermissionDeniedException Updates an existing publisher.- Parameters:
publisherForm- the form containing the elements to be updated- Throws:
IllegalStateException-publisherFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-publisherFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-publisherFormdid not originate fromgetPublisherFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeletePublishers
boolean canDeletePublishers()Tests if this user can deletePublishersA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aPublisherwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifPublisherdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deletePublisher
void deletePublisher(Id publisherId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aPublisher.- Parameters:
publisherId- theIdof thePublisherto remove- Throws:
NotFoundException-publisherIdnot foundNullArgumentException-publisherIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManagePublisherAliases
boolean canManagePublisherAliases()Tests if this user can manageIdaliases forPublishers. 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:
falseifPublisheraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasPublisher
void aliasPublisher(Id publisherId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aPublisherfor the purpose of creating compatibility. The primaryIdof thePublisheris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another publisher, it is reassigned to the given publisherId.- Parameters:
publisherId- theIdof aPublisheraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-publisherIdnot foundNullArgumentException-publisherIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-