use of com.thinkbiganalytics.metadata.api.event.MetadataChange.ChangeType in project kylo by Teradata.
the class JcrFeedProvider method addPostFeedChangeAction.
/**
* Registers an action that produces a feed change event upon a successful transaction commit.
*
* @param feed the feed to being created
*/
private void addPostFeedChangeAction(Feed feed, ChangeType changeType) {
Feed.State state = feed.getState();
Feed.ID id = feed.getId();
String feedName = feed.getQualifiedName();
final Principal principal = SecurityContextHolder.getContext().getAuthentication();
Consumer<Boolean> action = (success) -> {
if (success) {
FeedChange change = new FeedChange(changeType, feedName, feedName, id, state);
FeedChangeEvent event = new FeedChangeEvent(change, DateTime.now(), principal);
metadataEventService.notify(event);
}
};
JcrMetadataAccess.addPostTransactionAction(action);
}
use of com.thinkbiganalytics.metadata.api.event.MetadataChange.ChangeType in project kylo by Teradata.
the class JcrFeedTemplateProvider method addPostFeedChangeAction.
/**
* Registers an action that produces a template change event upon a successful transaction commit.
*
* @param template the feed to being created
*/
private void addPostFeedChangeAction(FeedManagerTemplate template, ChangeType changeType) {
FeedManagerTemplate.State state = template.getState();
FeedManagerTemplate.ID id = template.getId();
String desc = template.getName();
DateTime createTime = template.getCreatedTime();
final Principal principal = SecurityContextHolder.getContext().getAuthentication() != null ? SecurityContextHolder.getContext().getAuthentication() : null;
Consumer<Boolean> action = (success) -> {
if (success) {
TemplateChange change = new TemplateChange(changeType, desc, id, state);
TemplateChangeEvent event = new TemplateChangeEvent(change, createTime, principal);
metadataEventService.notify(event);
}
};
JcrMetadataAccess.addPostTransactionAction(action);
}
Aggregations