/** * Get an active operation. * * @param header the request header * @return the active operation, {@code null} if if there is no registered operation */ protected <T, A> ActiveOperation<T, A> getActiveOperation(final ManagementRequestHeader header) { return getActiveOperation(header.getBatchId()); }
/** * Get an active operation. * * @param header the request header * @return the active operation, {@code null} if if there is no registered operation */ protected <T, A> ActiveOperation<T, A> getActiveOperation(final ManagementRequestHeader header) { return getActiveOperation(header.getBatchId()); }
/** {@inheritDoc} */ @Override public <T, A> AsyncFuture<T> executeRequest(final Integer operationId, final ManagementRequest<T, A> request) throws IOException { final ActiveOperation<T, A> operation = super.getActiveOperation(operationId); if(operation == null) { throw ProtocolLogger.ROOT_LOGGER.responseHandlerNotFound(operationId); } return executeRequest(operation, request); }
/** {@inheritDoc} */ @Override public <T, A> AsyncFuture<T> executeRequest(final Integer operationId, final ManagementRequest<T, A> request) throws IOException { final ActiveOperation<T, A> operation = super.getActiveOperation(operationId); if(operation == null) { throw ProtocolMessages.MESSAGES.responseHandlerNotFound(operationId); } return executeRequest(operation, request); }
/** {@inheritDoc} */ @Override public <T, A> AsyncFuture<T> executeRequest(final Integer operationId, final ManagementRequest<T, A> request) throws IOException { final ActiveOperation<T, A> operation = super.getActiveOperation(operationId); if(operation == null) { throw ProtocolLogger.ROOT_LOGGER.responseHandlerNotFound(operationId); } return executeRequest(operation, request); }
/** * Handle a message. * * @param channel the channel * @param message the message * @param header the protocol header * @param handler the request handler * @throws IOException */ protected <T, A> void handleMessage(final Channel channel, final DataInput message, final ManagementRequestHeader header, ManagementRequestHandler<T, A> handler) throws IOException { final ActiveOperation<T, A> support = getActiveOperation(header); if(support == null) { throw ProtocolLogger.ROOT_LOGGER.responseHandlerNotFound(header.getBatchId()); } handleMessage(channel, message, header, support, handler); }
/** * Handle a message. * * @param channel the channel * @param message the message * @param header the protocol header * @param handler the request handler * @throws IOException */ protected <T, A> void handleMessage(final Channel channel, final DataInput message, final ManagementRequestHeader header, ManagementRequestHandler<T, A> handler) throws IOException { final ActiveOperation<T, A> support = getActiveOperation(header); if(support == null) { throw ProtocolLogger.ROOT_LOGGER.responseHandlerNotFound(header.getBatchId()); } handleMessage(channel, message, header, support, handler); }
/** * Handle a message. * * @param channel the channel * @param message the message * @param header the protocol header * @param handler the request handler * @throws IOException */ protected <T, A> void handleMessage(final Channel channel, final DataInput message, final ManagementRequestHeader header, ManagementRequestHandler<T, A> handler) throws IOException { final ActiveOperation<T, A> support = getActiveOperation(header); if(support == null) { throw ProtocolMessages.MESSAGES.responseHandlerNotFound(header.getBatchId()); } handleMessage(channel, message, header, support, handler); }