public interface ExternalObjectManagement
Modifier and Type | Method and Description |
---|---|
ExternalObject |
assignExternalObject(Long blogId,
ExternalObject externalObject)
Assign an external object to a topic.
|
void |
assignOrUpdateExternalObjects(Long blogId,
Collection<ExternalObject> externalObjects)
Assign or update a collection of external objects.
|
<T> T |
getExternalObject(Long topicId,
Long externalObjectId,
Converter<Pair<Blog,ExternalObject>,T> converter)
Get an external object which is identified by the given ID and is assigned to the given
topic.
|
Collection<ExternalObject> |
getExternalObjects(Long blogId)
Return the external objects that are assigned to the given blog.
|
boolean |
hasExternalObjects(Long blogId)
Return whether a given blog has external objects.
|
boolean |
isExternalObjectAssigned(Long blogId,
String externalSystemId,
String externalObjectId)
Check if a external object is assigned to a blog
|
void |
registerExternalObjectSource(ExternalObjectSource source)
Register an external object source.
|
void |
removeExternalObject(Long externalObjectId)
Remove the external object with the given ID.
|
void |
removeExternalObject(Long blogId,
String externalSystemId,
String externalObjectId)
Remove an external object from a blog.
|
void |
removeExternalObjectTrusted(Long externalObjectId)
Remove the external object from the blog it is assigned to.
|
void |
replaceExternalObjects(Long blogId,
Collection<ExternalObject> externalObjects)
Replace the external objects assigned to a blog with the provided ones.
|
void |
unregisterExternalObjectSource(ExternalObjectSource source)
Remove an external object source that was registered with
registerExternalObjectSource(ExternalObjectSource) . |
ExternalObject |
updateExternalObject(Long blogId,
ExternalObject externalObject)
Update an existing external object.
|
ExternalObject assignExternalObject(Long blogId, ExternalObject externalObject) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
blogId
- the ID of the blog to assign the external object toexternalObject
- object describing the external object to assignBlogNotFoundException
- in case the blog was not foundBlogAccessException
- in case the user is not a manager of the blogExternalObjectAlreadyAssignedException
- in case the external object is assigned to another blog than the provided oneExternalSystemNotConfiguredException
- in case the externalSystemId of the external object does not belong to a
registered or active external object source. A source is considered active if it
provides a valid configuration.TooManyExternalObjectsPerTopicException
- in case there are already assignments for the external source and topic and the
configuration does not allow more assignmentsvoid assignOrUpdateExternalObjects(Long blogId, Collection<ExternalObject> externalObjects) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
updateExternalObject(Long, ExternalObject)
and the assign like
assignExternalObject(Long, ExternalObject)
blogId
- the ID of the blog to assign the external objects toexternalObjects
- objects describing the external objects to assign or update. To find an existing
external object the external ID and the external system ID members are used if set
otherwise the ID member is used.BlogNotFoundException
- in case the blog was not foundBlogAccessException
- in case the user is not a manager of the blogExternalObjectAlreadyAssignedException
- in case one of the external objects is assigned to another blog than the provided
oneExternalSystemNotConfiguredException
- in case the externalSystemId of the external object does not belong to a
registered or active external object source. A source is considered active if it
provides a valid configuration.TooManyExternalObjectsPerTopicException
- in case the configuration does not allow that many assignments<T> T getExternalObject(Long topicId, Long externalObjectId, Converter<Pair<Blog,ExternalObject>,T> converter) throws BlogNotFoundException, BlogAccessException
topicId
- the ID of the topicexternalObjectId
- the internal ID of the external objectconverter
- the converter to transform the external object in the result objectBlogNotFoundException
- in case the topic does not existBlogAccessException
- in case the current user has no access to the given topicCollection<ExternalObject> getExternalObjects(Long blogId) throws BlogNotFoundException, BlogAccessException
Return the external objects that are assigned to the given blog. The properties will not be loaded. Use the property management to get them.
blogId
- the ID of the blogBlogNotFoundException
- in case the blog does not existBlogAccessException
- in case the current user has no read access to the blogboolean hasExternalObjects(Long blogId) throws BlogNotFoundException, BlogAccessException
Return whether a given blog has external objects.
blogId
- the ID of the blogBlogNotFoundException
- in case the blog does not existBlogAccessException
- in case the current user has no read access to the blogboolean isExternalObjectAssigned(Long blogId, String externalSystemId, String externalObjectId) throws BlogAccessException, BlogNotFoundException
blogId
- the ID of the blog the external object is checked for beeing assigned toexternalSystemId
- the ID of the external systemexternalObjectId
- the ID that identifies the external object within the external systemBlogAccessException
- in case the current user has no read access to the blogBlogNotFoundException
- in case there is no blog for the given IDvoid registerExternalObjectSource(ExternalObjectSource source) throws ExternalObjectSourceAlreadyExistsException
source
- the source to registerExternalObjectSourceAlreadyExistsException
- in case there is already a source with the same IDvoid removeExternalObject(Long externalObjectId) throws BlogAccessException, NotFoundException
Remove the external object with the given ID. If the removed external object is the last of the external system, the blog access rights added for that external system will be removed too.
externalObjectId
- the ID of the external object to removeBlogAccessException
- in case the current user is not manager of the blogNotFoundException
- in case the external object does not existvoid removeExternalObject(Long blogId, String externalSystemId, String externalObjectId) throws BlogNotFoundException, BlogAccessException
blogId
- ID of the blogexternalSystemId
- identifier of the external systemexternalObjectId
- identifier of the external object in the external systemBlogNotFoundException
- in case the blog does not existBlogAccessException
- in case the current user is not manager of the blogvoid removeExternalObjectTrusted(Long externalObjectId) throws NotFoundException, AuthorizationException
Remove the external object from the blog it is assigned to. If the removed external object is the last of the external system, the blog access rights added for that external system will be removed too.
Similar to the 'trusted' methods of BlogRightsManagement this method requires that the current user is client manager.
externalObjectId
- ID of the external objectNotFoundException
- in case the external object does not existAuthorizationException
- in case the current user is not client managervoid replaceExternalObjects(Long blogId, Collection<ExternalObject> externalObjects) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
assignOrUpdateExternalObjects(Long, Collection)
but additionally removes any
assigned external object that is not in the provided external objects.blogId
- the ID of the blog whose external objects should be replacedexternalObjects
- the new external objects to replace the existing withBlogNotFoundException
- in case the blog does not existBlogAccessException
- in case the current user is not manager of the blogExternalObjectAlreadyAssignedException
- in case one of the external objects is assigned to another blog than the provided
oneExternalSystemNotConfiguredException
TooManyExternalObjectsPerTopicException
void unregisterExternalObjectSource(ExternalObjectSource source)
registerExternalObjectSource(ExternalObjectSource)
. If the source was not registered
the call is ignoredsource
- the source to removeExternalObject updateExternalObject(Long blogId, ExternalObject externalObject) throws BlogNotFoundException, BlogAccessException, NotFoundException, ExternalObjectAlreadyAssignedException
Update an existing external object. This covers modification of the name and the properties. The properties handling is as follows: If a property key and group combination does not exist, the property is created. If the property key and group combination exists, the value is updated. In case the value is null, the property is removed.
blogId
- the ID of the blog the external object is assigned toexternalObject
- object with details about the external object which are used to resolve the
assigned object and update its data. To find the existing external object the
external ID and the external system ID members are used if set otherwise the ID
member is used.BlogNotFoundException
- in case the blog does not existBlogAccessException
- in case the current user is not manager of the blogNotFoundException
- in case the external object does not existExternalObjectAlreadyAssignedException
- in case the external object is already assigned to another blog than the provided
oneCopyright © 2019 Communote team. All rights reserved.