Class ObjectFacadeImpl
java.lang.Object
com.riadalabs.jira.plugins.insight.channel.external.api.facade.impl.ObjectFacadeImpl
- All Implemented Interfaces:
ObjectFacade
-
Constructor Summary
ConstructorsConstructorDescriptionObjectFacadeImpl
(com.riadalabs.jira.plugins.insight.services.core.ObjectService objectService, com.riadalabs.jira.plugins.insight.services.core.MoveService moveService, com.riadalabs.jira.plugins.insight.services.util.ErrorMessageTranslator errorMessageTranslator, com.riadalabs.jira.plugins.insight.services.jira.JIRAPluginService jiraPluginService, io.riada.insight.index.filter.objectticketconnection.ObjectTicketConnectionFilter objectTicketConnectionFilter, com.riadalabs.jira.plugins.insight.services.avatar.ObjectAvatarService avatarService, com.riadalabs.jira.plugins.insight.services.validation.ValidateObject validateObject, com.riadalabs.jira.plugins.insight.services.core.archiving.ArchiveService archiveService) -
Method Summary
Modifier and TypeMethodDescriptionaddAttachmentBean
(int objectId, File file, String fileName, String contentType, String comment) Add aAttachmentBean
domain objects.void
archiveObjectBean
(int id) Archive anObjectBean
by ID.void
archiveObjectBean
(int id, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Archive anObjectBean
by ID with control over the event dispatch option.void
archiveObjectBean
(String objectKey) Archive anObjectBean
by object key.void
archiveObjectBean
(String objectKey, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Archive anObjectBean
by object key with control over the event dispatch option.int
countObjectBeans
(int objectTypeId) Finds total count of allObjectBean
domain objects.createWatcherBean
(int objectId, String userKey) Created aWatcherBean
deleteAttachmentBean
(int attachmentId) DeleteAttachmentBean
void
deleteCommentBean
(int commentBeanId) Delete aCommentBean
void
deleteObjectAttributeBean
(int id) Deprecated.void
deleteObjectAttributeBean
(int id, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Deprecated.void
deleteObjectAttributeBean
(long id) Deletes an object attribute beanvoid
deleteObjectAttributeBean
(long id, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Deletes an object attribute beanvoid
deleteObjectBean
(int id) Delete aObjectBean
void
deleteObjectBean
(int id, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Delete aObjectBean
void
deleteWatcherBean
(WatcherBean watcherBean) Delete aWatcherBean
findAttachmentBeans
(int objectId) Finds attachmentBeans for specifiedObjectBean
idfindCommentBeans
(int objectId) Find allCommentBean
for anObjectBean
findObjectAttributeBeans
(int objectId) Finds allObjectAttributeBean
findObjectHistoryBean
(int objectId) Find theObjectBean
historyfindObjectTicketConnections
(int objectId) Find all JIRA issues connected to anObjectBean
findObjectTicketConnections
(int objectId, int offset, int limit) findObjectTicketConnections
(long ticketId) Find all ObjectBean connected to a JIRA issuefindWatcherBeans
(int objectId) Finds allWatcherBean
for anObjectBean
loadAttachmentBeanById
(int id) Load aAttachmentBean
loadCommentBean
(int commentId) Load aCommentBean
loadObjectAttributeBean
(int id) Deprecated.Will be removed.loadObjectAttributeBean
(int objectId, int objectTypeAttributeId) Loads aObjectAttributeBean
given an object id and object type attribute idloadObjectAttributeBean
(int objectId, int objectTypeAttributeId, boolean ignorePermissionCheck) Loads aObjectAttributeBean
given an object id, object type attribute id and a parameter to ignore permission checkloadObjectAttributeBean
(int objectId, String objectTypeAttributeName) Loads aObjectAttributeBean
given an object id and object type attribute nameloadObjectBean
(int id) Loads aObjectBean
given its id.loadObjectBean
(String key) Loads aObjectBean
given its key.loadWatcherBean
(int objectId, String userKey) Loads aWatcherBean
moveObjects
(MoveObjectBean moveObjectBean) Move objects to another object typevoid
restoreObjectBean
(int id) Restore anObjectBean
by ID.void
restoreObjectBean
(int id, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Restore anObjectBean
by ID with control over the event dispatch option.void
restoreObjectBean
(String objectKey) Restore anObjectBean
by object key.void
restoreObjectBean
(String objectKey, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Restore anObjectBean
by object key with control over the event dispatch option.storeCommentBean
(CommentBean commentBean) Store aCommentBean
storeObjectAttributeBean
(MutableObjectAttributeBean objectAttributeBean) Stores aObjectAttributeBean
storeObjectAttributeBean
(MutableObjectAttributeBean objectAttributeBean, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Stores aObjectAttributeBean
storeObjectAttributeBean
(ObjectAttributeBean objectAttributeBean) storeObjectBean
(MutableObjectBean objectBean) Stores aObjectBean
storeObjectBean
(MutableObjectBean objectBean, byte[] avatarData, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Stores aObjectBean
with the corresponding avatarstoreObjectBean
(MutableObjectBean objectBean, com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) Stores aObjectBean
Stores aObjectBean
bypassing ALL attribute validation e.g. uniqueness.void
validateObjectAttributeBean
(MutableObjectAttributeBean objectAttributeBean, ObjectBean objectBean) Validate an object attribute bean.void
validateObjectBean
(MutableObjectBean objectBean) Validate an object bean.
-
Constructor Details
-
ObjectFacadeImpl
public ObjectFacadeImpl(com.riadalabs.jira.plugins.insight.services.core.ObjectService objectService, com.riadalabs.jira.plugins.insight.services.core.MoveService moveService, com.riadalabs.jira.plugins.insight.services.util.ErrorMessageTranslator errorMessageTranslator, com.riadalabs.jira.plugins.insight.services.jira.JIRAPluginService jiraPluginService, io.riada.insight.index.filter.objectticketconnection.ObjectTicketConnectionFilter objectTicketConnectionFilter, com.riadalabs.jira.plugins.insight.services.avatar.ObjectAvatarService avatarService, com.riadalabs.jira.plugins.insight.services.validation.ValidateObject validateObject, com.riadalabs.jira.plugins.insight.services.core.archiving.ArchiveService archiveService)
-
-
Method Details
-
storeObjectBean
public ObjectBean storeObjectBean(MutableObjectBean objectBean, @Nonnull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Stores aObjectBean
- Specified by:
storeObjectBean
in interfaceObjectFacade
- Parameters:
objectBean
- the object bean to storeeventDispatchOption
- event dispatch- Returns:
- the stored
ObjectBean
- Throws:
InsightException
- if something goes wrong
-
storeObjectBean
public ObjectBean storeObjectBean(@Nonnull MutableObjectBean objectBean, @Nonnull byte[] avatarData, @Nonnull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Stores aObjectBean
with the corresponding avatar- Specified by:
storeObjectBean
in interfaceObjectFacade
- Parameters:
objectBean
- an existing object bean, the object bean must exist and be stored in insight before added as a parameter to this methodavatarData
- the actual avatar data to be used for the objecteventDispatchOption
- event dispatch- Returns:
- the stored
ObjectBean
- Throws:
InsightException
- if something goes
-
storeObjectBean
Description copied from interface:ObjectFacade
Stores aObjectBean
- Specified by:
storeObjectBean
in interfaceObjectFacade
- Parameters:
objectBean
- the object bean to store- Returns:
- the stored
ObjectBean
- Throws:
InsightException
- if something goes wrong
-
storeObjectBeanIgnoreAttributeValidation
public ObjectBean storeObjectBeanIgnoreAttributeValidation(MutableObjectBean objectBean) throws InsightException Description copied from interface:ObjectFacade
Stores aObjectBean
bypassing ALL attribute validation e.g. uniqueness. This method should be used with care because it will create objects that potentially does not conform to the configuration of the object type.- Specified by:
storeObjectBeanIgnoreAttributeValidation
in interfaceObjectFacade
- Parameters:
objectBean
- the object bean with corresponding attributes. Attributes present will NOT be validated- Returns:
- the stored object bean
- Throws:
InsightException
-
storeObjectAttributeBean
public ObjectAttributeBean storeObjectAttributeBean(MutableObjectAttributeBean objectAttributeBean) throws InsightException Description copied from interface:ObjectFacade
Stores aObjectAttributeBean
- Specified by:
storeObjectAttributeBean
in interfaceObjectFacade
- Returns:
- the stored
ObjectAttributeBean
- Throws:
InsightException
- if something goes wrong
-
storeObjectAttributeBean
public ObjectAttributeBean storeObjectAttributeBean(MutableObjectAttributeBean objectAttributeBean, @Nonnull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Stores aObjectAttributeBean
- Specified by:
storeObjectAttributeBean
in interfaceObjectFacade
- Returns:
- the stored
ObjectAttributeBean
- Throws:
InsightException
- if something goes wrong
-
storeObjectAttributeBean
public ObjectAttributeBean storeObjectAttributeBean(ObjectAttributeBean objectAttributeBean) throws InsightException - Specified by:
storeObjectAttributeBean
in interfaceObjectFacade
- Throws:
InsightException
-
countObjectBeans
Description copied from interface:ObjectFacade
Finds total count of allObjectBean
domain objects.- Specified by:
countObjectBeans
in interfaceObjectFacade
- Returns:
- the number of ObjectTypes
- Throws:
InsightException
-
loadObjectBean
Description copied from interface:ObjectFacade
Loads aObjectBean
given its id.- Specified by:
loadObjectBean
in interfaceObjectFacade
- Returns:
- a
ObjectBean
- Throws:
InsightException
-
loadObjectBean
Description copied from interface:ObjectFacade
Loads aObjectBean
given its key.- Specified by:
loadObjectBean
in interfaceObjectFacade
- Returns:
- a
ObjectBean
- Throws:
InsightException
-
deleteObjectBean
public void deleteObjectBean(int id, @Nonnull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Delete aObjectBean
- Specified by:
deleteObjectBean
in interfaceObjectFacade
- Throws:
InsightException
-
deleteObjectBean
Description copied from interface:ObjectFacade
Delete aObjectBean
- Specified by:
deleteObjectBean
in interfaceObjectFacade
- Throws:
InsightException
-
archiveObjectBean
Description copied from interface:ObjectFacade
Archive anObjectBean
by ID.- Specified by:
archiveObjectBean
in interfaceObjectFacade
- Parameters:
id
- the id of the object to archive- Throws:
InsightException
-
archiveObjectBean
public void archiveObjectBean(int id, @NotNull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Archive anObjectBean
by ID with control over the event dispatch option.- Specified by:
archiveObjectBean
in interfaceObjectFacade
- Parameters:
id
- the id of the object to archiveeventDispatchOption
- event dispatch option- Throws:
InsightException
-
archiveObjectBean
Description copied from interface:ObjectFacade
Archive anObjectBean
by object key.- Specified by:
archiveObjectBean
in interfaceObjectFacade
- Parameters:
objectKey
- the key of the object to archive- Throws:
InsightException
-
archiveObjectBean
public void archiveObjectBean(String objectKey, @NotNull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Archive anObjectBean
by object key with control over the event dispatch option.- Specified by:
archiveObjectBean
in interfaceObjectFacade
- Parameters:
objectKey
- the key of the object to archiveeventDispatchOption
- event dispatch option- Throws:
InsightException
-
restoreObjectBean
Description copied from interface:ObjectFacade
Restore anObjectBean
by ID.- Specified by:
restoreObjectBean
in interfaceObjectFacade
- Parameters:
id
- the id of the object to restore- Throws:
InsightException
-
restoreObjectBean
public void restoreObjectBean(int id, @NotNull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Restore anObjectBean
by ID with control over the event dispatch option.- Specified by:
restoreObjectBean
in interfaceObjectFacade
- Parameters:
id
- the id of the object to restoreeventDispatchOption
- event dispatch option- Throws:
InsightException
-
restoreObjectBean
Description copied from interface:ObjectFacade
Restore anObjectBean
by object key.- Specified by:
restoreObjectBean
in interfaceObjectFacade
- Parameters:
objectKey
- the key of the object to restore- Throws:
InsightException
-
restoreObjectBean
public void restoreObjectBean(String objectKey, @NotNull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Restore anObjectBean
by object key with control over the event dispatch option.- Specified by:
restoreObjectBean
in interfaceObjectFacade
- Parameters:
objectKey
- the key of the object to restoreeventDispatchOption
- event dispatch option- Throws:
InsightException
-
findObjectAttributeBeans
Description copied from interface:ObjectFacade
Finds allObjectAttributeBean
- Specified by:
findObjectAttributeBeans
in interfaceObjectFacade
- Parameters:
objectId
- theObjectBean
id- Returns:
- a list of
ObjectAttributeBean
- Throws:
InsightException
-
loadObjectAttributeBean
Deprecated.Will be removed. Use loadObjectAttributeBean(objectId, objectTypeAttributeId) insteadDescription copied from interface:ObjectFacade
Loads aObjectAttributeBean
given its id.- Specified by:
loadObjectAttributeBean
in interfaceObjectFacade
- Returns:
- a
ObjectAttributeBean
- Throws:
InsightException
-
loadObjectAttributeBean
public ObjectAttributeBean loadObjectAttributeBean(int objectId, int objectTypeAttributeId) throws InsightException Description copied from interface:ObjectFacade
Loads aObjectAttributeBean
given an object id and object type attribute id- Specified by:
loadObjectAttributeBean
in interfaceObjectFacade
- Returns:
- a
ObjectAttributeBean
- Throws:
InsightException
-
loadObjectAttributeBean
public ObjectAttributeBean loadObjectAttributeBean(int objectId, int objectTypeAttributeId, boolean ignorePermissionCheck) throws InsightException Description copied from interface:ObjectFacade
Loads aObjectAttributeBean
given an object id, object type attribute id and a parameter to ignore permission check- Specified by:
loadObjectAttributeBean
in interfaceObjectFacade
- Returns:
- a
ObjectAttributeBean
- Throws:
InsightException
-
loadObjectAttributeBean
public ObjectAttributeBean loadObjectAttributeBean(int objectId, String objectTypeAttributeName) throws InsightException Description copied from interface:ObjectFacade
Loads aObjectAttributeBean
given an object id and object type attribute name- Specified by:
loadObjectAttributeBean
in interfaceObjectFacade
- Returns:
- a
ObjectAttributeBean
- Throws:
InsightException
-
deleteObjectAttributeBean
Deprecated.Description copied from interface:ObjectFacade
Deletes an object attribute bean- Specified by:
deleteObjectAttributeBean
in interfaceObjectFacade
- Throws:
InsightException
-
deleteObjectAttributeBean
@Deprecated public void deleteObjectAttributeBean(int id, @Nonnull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Deprecated.Description copied from interface:ObjectFacade
Deletes an object attribute bean- Specified by:
deleteObjectAttributeBean
in interfaceObjectFacade
- Throws:
InsightException
-
deleteObjectAttributeBean
public void deleteObjectAttributeBean(long id, @Nonnull com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption eventDispatchOption) throws InsightException Description copied from interface:ObjectFacade
Deletes an object attribute bean- Specified by:
deleteObjectAttributeBean
in interfaceObjectFacade
- Throws:
InsightException
-
deleteObjectAttributeBean
Description copied from interface:ObjectFacade
Deletes an object attribute bean- Specified by:
deleteObjectAttributeBean
in interfaceObjectFacade
- Throws:
InsightException
-
findObjectHistoryBean
Description copied from interface:ObjectFacade
Find theObjectBean
history- Specified by:
findObjectHistoryBean
in interfaceObjectFacade
- Returns:
- a list of
ObjectHistoryBean
- Throws:
InsightException
-
loadAttachmentBeanById
Description copied from interface:ObjectFacade
Load aAttachmentBean
- Specified by:
loadAttachmentBeanById
in interfaceObjectFacade
- Returns:
- a
AttachmentBean
- Throws:
InsightException
-
addAttachmentBean
public AttachmentBean addAttachmentBean(int objectId, File file, String fileName, String contentType, String comment) throws InsightException Description copied from interface:ObjectFacade
Add aAttachmentBean
domain objects.- Specified by:
addAttachmentBean
in interfaceObjectFacade
- Parameters:
objectId
- theObjectBean
idfile
- the file to addfileName
- the filenamecontentType
- the content typecomment
- an optional comment- Returns:
- the added
AttachmentBean
- Throws:
InsightException
-
findAttachmentBeans
Description copied from interface:ObjectFacade
Finds attachmentBeans for specifiedObjectBean
id- Specified by:
findAttachmentBeans
in interfaceObjectFacade
- Parameters:
objectId
- the ObjectBean id- Returns:
- a list of
AttachmentBean
- Throws:
InsightException
-
deleteAttachmentBean
Description copied from interface:ObjectFacade
DeleteAttachmentBean
- Specified by:
deleteAttachmentBean
in interfaceObjectFacade
- Returns:
- the deleted
AttachmentBean
- Throws:
InsightException
-
findObjectTicketConnections
public List<ObjectTicketConnectionEntry> findObjectTicketConnections(int objectId) throws InsightException Description copied from interface:ObjectFacade
Find all JIRA issues connected to anObjectBean
- Specified by:
findObjectTicketConnections
in interfaceObjectFacade
- Returns:
- list of
ObjectTicketConnectionEntry
- Throws:
InsightException
-
findObjectTicketConnections
public List<ObjectTicketConnectionEntry> findObjectTicketConnections(int objectId, int offset, int limit) throws InsightException - Specified by:
findObjectTicketConnections
in interfaceObjectFacade
- Throws:
InsightException
-
findObjectTicketConnections
public List<ObjectTicketConnectionEntry> findObjectTicketConnections(long ticketId) throws InsightException Description copied from interface:ObjectFacade
Find all ObjectBean connected to a JIRA issue- Specified by:
findObjectTicketConnections
in interfaceObjectFacade
- Returns:
- list of
ObjectTicketConnectionEntry
- Throws:
InsightException
-
deleteCommentBean
Description copied from interface:ObjectFacade
Delete aCommentBean
- Specified by:
deleteCommentBean
in interfaceObjectFacade
- Throws:
InsightException
-
storeCommentBean
Description copied from interface:ObjectFacade
Store aCommentBean
- Specified by:
storeCommentBean
in interfaceObjectFacade
- Returns:
- the stored
CommentBean
- Throws:
InsightException
-
findCommentBeans
Description copied from interface:ObjectFacade
Find allCommentBean
for anObjectBean
- Specified by:
findCommentBeans
in interfaceObjectFacade
- Returns:
- a list of
CommentBean
- Throws:
InsightException
-
loadCommentBean
Description copied from interface:ObjectFacade
Load aCommentBean
- Specified by:
loadCommentBean
in interfaceObjectFacade
- Returns:
- a
CommentBean
- Throws:
InsightException
-
loadWatcherBean
Description copied from interface:ObjectFacade
Loads aWatcherBean
- Specified by:
loadWatcherBean
in interfaceObjectFacade
- Parameters:
objectId
- the ObjectBean iduserKey
- the User key- Returns:
- a
WatcherBean
- Throws:
InsightException
-
findWatcherBeans
Description copied from interface:ObjectFacade
Finds allWatcherBean
for anObjectBean
- Specified by:
findWatcherBeans
in interfaceObjectFacade
- Returns:
- a list of
WatcherBean
- Throws:
InsightException
-
createWatcherBean
Description copied from interface:ObjectFacade
Created aWatcherBean
- Specified by:
createWatcherBean
in interfaceObjectFacade
- Parameters:
objectId
- theObjectBean
iduserKey
- the userkey- Returns:
- a created
WatcherBean
- Throws:
InsightException
-
deleteWatcherBean
Description copied from interface:ObjectFacade
Delete aWatcherBean
- Specified by:
deleteWatcherBean
in interfaceObjectFacade
- Throws:
InsightException
-
moveObjects
Description copied from interface:ObjectFacade
Move objects to another object type- Specified by:
moveObjects
in interfaceObjectFacade
- Returns:
- a
Progress
- Throws:
Exception
-
validateObjectBean
public void validateObjectBean(MutableObjectBean objectBean) throws ValidationInsightException, IQLValidationException Description copied from interface:ObjectFacade
Validate an object bean. This will be implicitly be executed on store object- Specified by:
validateObjectBean
in interfaceObjectFacade
- Throws:
ValidationInsightException
IQLValidationException
-
validateObjectAttributeBean
public void validateObjectAttributeBean(MutableObjectAttributeBean objectAttributeBean, ObjectBean objectBean) throws ValidationInsightException, IQLValidationException Description copied from interface:ObjectFacade
Validate an object attribute bean. This will be implicitly be executed on store object- Specified by:
validateObjectAttributeBean
in interfaceObjectFacade
- Throws:
ValidationInsightException
IQLValidationException
-