use of com.thinkbiganalytics.metadata.api.event.feed.OperationStatus in project kylo by Teradata.
the class JobExecutionChangedNotifier method newFeedOperationStatusEvent.
private FeedOperationStatusEvent newFeedOperationStatusEvent(Long jobExecutionId, OpsManagerFeed feed, FeedOperation.State state, String status) {
String feedName = feed != null ? feed.getName() : null;
Feed.ID feedId = feed != null ? feed.getId() : null;
FeedOperation.FeedType feedType = feed != null ? FeedOperation.FeedType.valueOf(feed.getFeedType().name()) : FeedOperation.FeedType.FEED;
return new FeedOperationStatusEvent(new OperationStatus(feedId, feedName, feedType, new OpId(jobExecutionId), state, status));
}
use of com.thinkbiganalytics.metadata.api.event.feed.OperationStatus in project kylo by Teradata.
the class DebugController method postFeedOperationStatusEvent.
/**
* Allows the caller to update status events for the feed
*
* @param feedName the name of the feed
* @param opIdStr the operation for the feed
* @param stateStr the new state to persist
* @param status the status of the operation
* @return the feed operation status event
*/
@POST
@Path("feedop/event")
public String postFeedOperationStatusEvent(@QueryParam("feed") String feedName, @QueryParam("op") String opIdStr, @QueryParam("state") String stateStr, @QueryParam("status") @DefaultValue("") String status) {
// TODO: Is this a feed ops permission?
this.accessController.checkPermission(AccessController.SERVICES, MetadataAccessControl.ADMIN_METADATA);
FeedOperation.ID opId = null;
FeedOperation.State state = FeedOperation.State.valueOf(stateStr.toUpperCase());
OperationStatus opStatus = new OperationStatus(null, feedName, null, opId, state, status);
FeedOperationStatusEvent event = new FeedOperationStatusEvent(opStatus);
this.eventService.notify(event);
return event.toString();
}
Aggregations