@Override public ManagementRequestHandler<?, ?> resolveHandler(RequestHandlerChain handlers, ManagementRequestHeader header) { final byte operationId = header.getOperationId(); switch (operationId) { case DomainControllerProtocol.UNREGISTER_HOST_CONTROLLER_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new UnregisterOperation(); } case DomainControllerProtocol.GET_FILE_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new GetFileOperation(); } case DomainControllerProtocol.SERVER_INSTABILITY_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new ServerUnstableHandler(); } } return handlers.resolveNext(); }
@Override void handleRequest(String hostId, DataInput input, ActiveOperation.ResultHandler<Void> resultHandler, ManagementRequestContext<Void> context) throws IOException { domainController.unregisterRemoteHost(hostId, null, true); final FlushableDataOutput os = writeGenericResponseHeader(context); try { os.write(ManagementProtocol.RESPONSE_END); os.close(); resultHandler.done(null); // call stack (AbstractMessageHandler) handles failures } finally { StreamUtils.safeClose(os); } }
@Override public ManagementRequestHandler<?, ?> resolveHandler(RequestHandlerChain handlers, ManagementRequestHeader header) { final byte operationId = header.getOperationId(); switch (operationId) { case DomainControllerProtocol.UNREGISTER_HOST_CONTROLLER_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new UnregisterOperation(); } case DomainControllerProtocol.GET_FILE_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new GetFileOperation(); } case DomainControllerProtocol.SERVER_INSTABILITY_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new ServerUnstableHandler(); } } return handlers.resolveNext(); }
@Override public ManagementRequestHandler<?, ?> resolveHandler(RequestHandlerChain handlers, ManagementRequestHeader header) { final byte operationId = header.getOperationId(); switch (operationId) { case DomainControllerProtocol.UNREGISTER_HOST_CONTROLLER_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new UnregisterOperation(); } case DomainControllerProtocol.GET_FILE_REQUEST: { handlers.registerActiveOperation(header.getBatchId(), null); return new GetFileOperation(); } } return handlers.resolveNext(); }
@Override void handleRequest(String hostId, DataInput input, ActiveOperation.ResultHandler<Void> resultHandler, ManagementRequestContext<Void> context) throws IOException { domainController.unregisterRemoteHost(hostId, null, true); final FlushableDataOutput os = writeGenericResponseHeader(context); try { os.write(ManagementProtocol.RESPONSE_END); os.close(); resultHandler.done(null); // call stack (AbstractMessageHandler) handles failures } finally { StreamUtils.safeClose(os); } }
@Override void handleRequest(String hostId, DataInput input, ManagementRequestContext<Void> context) throws IOException { domainController.unregisterRemoteHost(hostId, null); final FlushableDataOutput os = writeGenericResponseHeader(context); try { os.write(ManagementProtocol.RESPONSE_END); os.close(); } finally { StreamUtils.safeClose(os); } }