@Transactional public abstract class ExternalObjectManagementBase extends Object implements ExternalObjectManagement
Spring Service base class for ExternalObjectManagementException
, provides access to
all services and entities referenced by this service.
ExternalObjectManagementException
Constructor and Description |
---|
ExternalObjectManagementBase() |
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.
|
Collection<ExternalObject> |
getExternalObjects(Long blogId)
Return the external objects that are assigned to the given blog.
|
protected abstract ExternalObject |
handleAssignExternalObject(Long blogId,
ExternalObject externalObject)
Performs the core logic for
assignExternalObject(Long, ExternalObject) |
protected abstract void |
handleAssignOrUpdateExternalObjects(Long blogId,
Collection<ExternalObject> externalObjects)
Performs the core logic for
assignOrUpdateExternalObjects(Long, Collection) |
protected abstract Collection<ExternalObject> |
handleGetExternalObjects(Long blogId)
Performs the core logic for
getExternalObjects(Long) |
protected abstract boolean |
handleIsExternalObjectAssigned(Long blogId,
String externalSystemId,
String externalObjectId)
Check if a external object is assigned to a blog
|
protected abstract void |
handleRemoveExternalObject(Long externalObjectId)
Performs the core logic for
removeExternalObject(Long) |
protected abstract void |
handleRemoveExternalObject(Long blogId,
String externalSystemId,
String externalObjectId)
Performs the core logic for
removeExternalObject(Long, String, String) |
protected abstract void |
handleRemoveExternalObjectTrusted(Long externalObjectId)
Performs the core logic for
removeExternalObjectTrusted(Long) |
protected abstract void |
handleReplaceExternalObjects(Long blogId,
Collection<ExternalObject> externalObjects)
Performs the core logic for
replaceExternalObjects(Long, Collection) |
protected abstract ExternalObject |
handleUpdateExternalObject(Long blogId,
ExternalObject externalObject)
Performs the core logic for
updateExternalObject(Long, ExternalObject) |
boolean |
isExternalObjectAssigned(Long blogId,
String externalSystemId,
String externalObjectId)
Check if a external object is assigned to a blog
|
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.
|
ExternalObject |
updateExternalObject(Long blogId,
ExternalObject externalObject)
Update an existing external object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExternalObject, hasExternalObjects, registerExternalObjectSource, unregisterExternalObjectSource
public ExternalObject assignExternalObject(Long blogId, ExternalObject externalObject) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
ExternalObjectManagement
assignExternalObject
in interface ExternalObjectManagement
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 oneTooManyExternalObjectsPerTopicException
- in case there are already assignments for the external source and topic and the
configuration does not allow more assignmentsExternalSystemNotConfiguredException
- 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.public void assignOrUpdateExternalObjects(Long blogId, Collection<ExternalObject> externalObjects) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
ExternalObjectManagement
ExternalObjectManagement.updateExternalObject(Long, ExternalObject)
and the assign like
ExternalObjectManagement.assignExternalObject(Long, ExternalObject)
assignOrUpdateExternalObjects
in interface ExternalObjectManagement
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
oneTooManyExternalObjectsPerTopicException
- in case the configuration does not allow that many assignmentsExternalSystemNotConfiguredException
- 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.public Collection<ExternalObject> getExternalObjects(Long blogId) throws BlogNotFoundException, BlogAccessException
ExternalObjectManagement
Return the external objects that are assigned to the given blog. The properties will not be loaded. Use the property management to get them.
getExternalObjects
in interface ExternalObjectManagement
blogId
- the ID of the blogBlogNotFoundException
- in case the blog does not existBlogAccessException
- in case the current user has no read access to the blogprotected abstract ExternalObject handleAssignExternalObject(Long blogId, ExternalObject externalObject) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
assignExternalObject(Long, ExternalObject)
blogId
- the ID of the blog to assign the external object toexternalObject
- object describing the external object to assignBlogNotFoundException
- in case the topic 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
TooManyExternalObjectsPerTopicException
protected abstract void handleAssignOrUpdateExternalObjects(Long blogId, Collection<ExternalObject> externalObjects) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
assignOrUpdateExternalObjects(Long, Collection)
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
TooManyExternalObjectsPerTopicException
protected abstract Collection<ExternalObject> handleGetExternalObjects(Long blogId) throws BlogNotFoundException, BlogAccessException
getExternalObjects(Long)
blogId
- the ID of the blogBlogNotFoundException
- in case the blog does not existBlogAccessException
- in case the current user has no read access to the blogprotected abstract boolean handleIsExternalObjectAssigned(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 IDprotected abstract void handleRemoveExternalObject(Long externalObjectId) throws BlogAccessException, NotFoundException
removeExternalObject(Long)
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 existprotected abstract void handleRemoveExternalObject(Long blogId, String externalSystemId, String externalObjectId) throws BlogNotFoundException, BlogAccessException
removeExternalObject(Long, String, String)
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 blogprotected abstract void handleRemoveExternalObjectTrusted(Long externalObjectId) throws NotFoundException, AuthorizationException
removeExternalObjectTrusted(Long)
externalObjectId
- ID of the external object *NotFoundException
- in case the external object does not existAuthorizationException
- in case the current user is not client managerprotected abstract void handleReplaceExternalObjects(Long blogId, Collection<ExternalObject> externalObjects) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
replaceExternalObjects(Long, Collection)
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
protected abstract ExternalObject handleUpdateExternalObject(Long blogId, ExternalObject externalObject) throws BlogNotFoundException, NotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException
updateExternalObject(Long, ExternalObject)
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 dataBlogNotFoundException
- 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
onepublic boolean isExternalObjectAssigned(Long blogId, String externalSystemId, String externalObjectId) throws BlogNotFoundException, BlogAccessException
ExternalObjectManagement
isExternalObjectAssigned
in interface ExternalObjectManagement
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 systemBlogNotFoundException
- in case there is no blog for the given IDBlogAccessException
- in case the current user has no read access to the blogpublic void removeExternalObject(Long externalObjectId) throws BlogAccessException, NotFoundException
ExternalObjectManagement
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.
removeExternalObject
in interface ExternalObjectManagement
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 existpublic void removeExternalObject(Long blogId, String externalSystemId, String externalObjectId) throws BlogNotFoundException, BlogAccessException
ExternalObjectManagement
removeExternalObject
in interface ExternalObjectManagement
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 blogpublic void removeExternalObjectTrusted(Long externalObjectId) throws NotFoundException, AuthorizationException
ExternalObjectManagement
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.
removeExternalObjectTrusted
in interface ExternalObjectManagement
externalObjectId
- ID of the external objectNotFoundException
- in case the external object does not existAuthorizationException
- in case the current user is not client managerpublic void replaceExternalObjects(Long blogId, Collection<ExternalObject> externalObjects) throws BlogNotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException, TooManyExternalObjectsPerTopicException, ExternalSystemNotConfiguredException
ExternalObjectManagement
ExternalObjectManagement.assignOrUpdateExternalObjects(Long, Collection)
but additionally removes any
assigned external object that is not in the provided external objects.replaceExternalObjects
in interface ExternalObjectManagement
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
oneTooManyExternalObjectsPerTopicException
ExternalSystemNotConfiguredException
public ExternalObject updateExternalObject(Long blogId, ExternalObject externalObject) throws BlogNotFoundException, NotFoundException, BlogAccessException, ExternalObjectAlreadyAssignedException
ExternalObjectManagement
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.
updateExternalObject
in interface ExternalObjectManagement
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 existNotFoundException
- in case the external object does not existBlogAccessException
- in case the current user is not manager of the blogExternalObjectAlreadyAssignedException
- in case the external object is already assigned to another blog than the provided
oneCopyright © 2019 Communote team. All rights reserved.