/** * Create a new remote proxy controller. * * @param client the transactional protocol client * @param pathAddress the path address * @param addressTranslator the address translator * @return the proxy controller */ public static RemoteProxyController create(final TransactionalProtocolClient client, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator, final boolean validateAddresses) { return new RemoteProxyController(client, pathAddress, addressTranslator, validateAddresses); }
@Override public void execute(final ModelNode operation, final OperationMessageHandler handler, final ProxyOperationControl control, final OperationAttachments attachments, final BlockingTimeout blockingTimeout) { // Execute untransformed proxy.execute(operation, handler, control, attachments, blockingTimeout); }
@Override public PathAddress getProxyNodeAddress() { return proxy.getProxyNodeAddress(); }
final ModelNode translated = translateOperationForProxy(original, targetAddress); ControllerLogger.MGMT_OP_LOGGER.tracef("Executing %s for %s", translated.get(OP).asString(), getProxyNodeAddress()); futureResult = client.execute(operationListener, translated, messageHandler, attachments); blockingTimeout.proxyTimeoutDetected(targetAddress); futureResult.asyncCancel(true); ModelNode response = getTimeoutResponse(translated.get(OP).asString(), timeout); control.operationFailed(response); ControllerLogger.MGMT_OP_LOGGER.info(response.get(FAILURE_DESCRIPTION).asString()); ControllerLogger.MGMT_OP_LOGGER.interruptedAwaitingInitialResponse(original.get(OP).asString(), getProxyNodeAddress()); control.operationFailed(getCancelledResponse()); Thread.currentThread().interrupt(); } catch (IOException e) {
/** * Translate the operation address. * * @param op the operation * @return the new operation */ public ModelNode translateOperationForProxy(final ModelNode op) { return translateOperationForProxy(op, PathAddress.pathAddress(op.get(OP_ADDR))); }
/** * Creates a new remote proxy controller using an existing channel. * * @param channelAssociation the channel association * @param pathAddress the address within the model of the created proxy controller * @param addressTranslator the translator to use translating the address for the remote proxy * @return the proxy controller */ public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); // the remote proxy return create(client, pathAddress, addressTranslator); }
@Override public TransactionalProtocolClient getProtocolClient() { return proxy.getTransactionalProtocolClient(); }
@Override public ModelVersion getKernelModelVersion() { return proxy.getKernelModelVersion(); } }
} else { return executeValidateAddress(operation, messageHandler, operationAddress, paramAddress); return executeValidateAddress(operation, messageHandler, operationAddress, paramAddress);
final ModelNode translated = translateOperationForProxy(original, targetAddress); ControllerLogger.MGMT_OP_LOGGER.tracef("Executing %s for %s", translated.get(OP).asString(), getProxyNodeAddress()); futureResult = client.execute(operationListener, translated, messageHandler, attachments); blockingTimeout.proxyTimeoutDetected(targetAddress); futureResult.asyncCancel(true); ModelNode response = getTimeoutResponse(translated.get(OP).asString(), timeout); control.operationFailed(response); ControllerLogger.MGMT_OP_LOGGER.info(response.get(FAILURE_DESCRIPTION).asString()); ControllerLogger.MGMT_OP_LOGGER.interruptedAwaitingInitialResponse(original.get(OP).asString(), getProxyNodeAddress()); control.operationFailed(getCancelledResponse()); Thread.currentThread().interrupt(); } catch (IOException e) {
@Override public OperationTransformer.TransformedOperation transformOperation(final TransformationContext context, final ModelNode original) throws OperationFailedException { final ModelNode operation = proxy.translateOperationForProxy(original); return transformers.transformOperation(context, operation); }
/** * Creates a new remote proxy controller using an existing channel. * * @param channelAssociation the channel association * @param pathAddress the address within the model of the created proxy controller * @param addressTranslator the translator to use translating the address for the remote proxy * @return the proxy controller */ public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator, final boolean validateAddresses) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); // the remote proxy return create(client, pathAddress, addressTranslator, validateAddresses); }
@Override public TransactionalProtocolClient getProtocolClient() { return proxy.getTransactionalProtocolClient(); }
@Override public ModelVersion getKernelModelVersion() { return proxy.getKernelModelVersion(); } }
@Override public OperationTransformer.TransformedOperation transformOperation(TransformationInputs transformationParameters, ModelNode original) throws OperationFailedException { final ModelNode operation = proxy.translateOperationForProxy(original); return transformers.transformOperation(transformationParameters, operation); }
/** * Creates a new remote proxy controller using an existing channel. * * @param channelAssociation the channel association * @param pathAddress the address within the model of the created proxy controller * @param addressTranslator the translator to use translating the address for the remote proxy * @return the proxy controller * * @deprecated only present for test case use */ @Deprecated public static RemoteProxyController create(final ManagementChannelHandler channelAssociation, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { final TransactionalProtocolClient client = TransactionalProtocolHandlers.createClient(channelAssociation); // the remote proxy return create(client, pathAddress, addressTranslator, ModelVersion.CURRENT); }
@Override public void execute(final ModelNode operation, final OperationMessageHandler handler, final ProxyOperationControl control, final OperationAttachments attachments) { // Execute untransformed proxy.execute(operation, handler, control, attachments); }
@Override public TransactionalProtocolClient getProtocolClient() { return proxy.getTransactionalProtocolClient(); }
/** * Create a new remote proxy controller. * * @param client the transactional protocol client * @param pathAddress the path address * @param addressTranslator the address translator * @return the proxy controller */ public static RemoteProxyController create(final TransactionalProtocolClient client, final PathAddress pathAddress, final ProxyOperationAddressTranslator addressTranslator) { return new RemoteProxyController(client, pathAddress, addressTranslator); }
@Override public PathAddress getProxyNodeAddress() { return proxy.getProxyNodeAddress(); }