Skip to content

Commit

Permalink
Merge branch 'mazz/hawkular-483-execute-op'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmazzitelli committed Jul 28, 2015
2 parents 56f3911 + e38e955 commit 1b5ac8e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
package org.hawkular.feedcomm.ws.command.feed;

import org.hawkular.bus.common.BasicMessage;
import org.hawkular.feedcomm.api.ExecuteOperationRequest;
import org.hawkular.feedcomm.api.ExecuteOperationResponse;
import org.hawkular.feedcomm.ws.MsgLogger;
import org.hawkular.feedcomm.ws.WebSocketHelper;
import org.hawkular.feedcomm.ws.command.Command;
import org.hawkular.feedcomm.ws.command.CommandContext;

/**
* A feed telling us it finished its operation execution attempt.
*/
public class ExecuteOperationResponseCommand implements Command<ExecuteOperationResponse, BasicMessage> {
public static final Class<ExecuteOperationRequest> REQUEST_CLASS = ExecuteOperationRequest.class;
public static final Class<ExecuteOperationResponse> REQUEST_CLASS = ExecuteOperationResponse.class;

@Override
public BasicMessage execute(ExecuteOperationResponse response, CommandContext context) throws Exception {
Expand All @@ -39,6 +39,9 @@ public BasicMessage execute(ExecuteOperationResponse response, CommandContext co
MsgLogger.LOG.infof("Operation execution completed. Resource=[%s], Operation=[%s], Status=[%s], Message=[%s]",
resId, opName, status, msg);

// TODO: today we don't know which UI sent the original request, so for now, tell all UIs what the response was
new WebSocketHelper().sendBasicMessageSync(context.getConnectedUIClients().getAllSessions(), response);

return null;
}
}

0 comments on commit 1b5ac8e

Please sign in to comment.