Search in sources :

Example 1 with FeedOperationStatusEvent

use of com.thinkbiganalytics.metadata.api.event.feed.FeedOperationStatusEvent 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));
}
Also used : FeedOperationStatusEvent(com.thinkbiganalytics.metadata.api.event.feed.FeedOperationStatusEvent) OperationStatus(com.thinkbiganalytics.metadata.api.event.feed.OperationStatus) FeedOperation(com.thinkbiganalytics.metadata.api.op.FeedOperation) Feed(com.thinkbiganalytics.metadata.api.feed.Feed) OpsManagerFeed(com.thinkbiganalytics.metadata.api.feed.OpsManagerFeed)

Example 2 with FeedOperationStatusEvent

use of com.thinkbiganalytics.metadata.api.event.feed.FeedOperationStatusEvent 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();
}
Also used : FeedOperationStatusEvent(com.thinkbiganalytics.metadata.api.event.feed.FeedOperationStatusEvent) OperationStatus(com.thinkbiganalytics.metadata.api.event.feed.OperationStatus) FeedOperation(com.thinkbiganalytics.metadata.api.op.FeedOperation) Path(javax.ws.rs.Path) JcrPath(com.thinkbiganalytics.metadata.modeshape.support.JcrPath) POST(javax.ws.rs.POST)

Aggregations

FeedOperationStatusEvent (com.thinkbiganalytics.metadata.api.event.feed.FeedOperationStatusEvent)2 OperationStatus (com.thinkbiganalytics.metadata.api.event.feed.OperationStatus)2 FeedOperation (com.thinkbiganalytics.metadata.api.op.FeedOperation)2 Feed (com.thinkbiganalytics.metadata.api.feed.Feed)1 OpsManagerFeed (com.thinkbiganalytics.metadata.api.feed.OpsManagerFeed)1 JcrPath (com.thinkbiganalytics.metadata.modeshape.support.JcrPath)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1