// not a problem
// return masterDomainControllerClient.execute(operationContext, handler);
PathAddress addr = PathAddress.pathAddress(operationNode.get(OP_ADDR));
handler.handleFailed(new ModelNode().set("Operations for address " + addr +
" can only handled by the master Domain Controller; this host is not the master Domain Controller"));
return new BasicOperationResult();
}
else if (!routing.isTwoStep()) {
// It's either for a read of a domain-level resource or it's for a single host-level resource,
// either of which a single host client can handle directly
String host = routing.getSingleHost();
// System.out.println("------ route to host " + host);
return executeOnHost(host, operation, handler);
}
else {
// Else we are responsible for coordinating a two-phase op
// -- apply to DomainController models across domain and then push to servers
return executeTwoPhaseOperation(operation, handler, operationNode, routing);
}
} catch (OperationFailedException e) {
log.debugf(e, "operation (%s) failed - address: (%s)", operation.getOperation().get(OP), operation.getOperation().get(OP_ADDR));
handler.handleFailed(e.getFailureDescription());
return new BasicOperationResult();
} catch (final Throwable t) {
log.errorf(t, "operation (%s) failed - address: (%s)", operation.getOperation().get(OP), operation.getOperation().get(OP_ADDR));
handler.handleFailed(getFailureResult(t));
return new BasicOperationResult();
}
}