public static ModelControllerClient getModelControllerClient() { try { return ModelControllerClient.Factory.create( InetAddress.getByName(getServerAddress()), TestSuiteEnvironment.getServerPort(), Authentication.getCallbackHandler() ); } catch (UnknownHostException e) { throw new RuntimeException(e); } }
public static void main(String[] args) throws Exception { final ModelControllerClient client = ModelControllerClient.Factory.create(InetAddress.getByName("localhost"), 9999, DemoAuthentication.getCallbackHandler()); try { new ExampleRunner().run(client); } finally { StreamUtils.safeClose(client); } }
public static void main(String[] args) throws Exception { final ModelControllerClient client = ModelControllerClient.Factory.create(InetAddress.getByName("localhost"), 9999, DemoAuthentication.getCallbackHandler()); try { new ExampleRunner().run(client); } finally { StreamUtils.safeClose(client); } }
/** * Create a client instance for a remote address and port and CallbackHandler. * * @param hostName the remote host * @param port the port * @param handler CallbackHandler to obtain authentication information for the call. * @param sslContext a pre-initialised SSLContext * @return A model controller client * @throws UnknownHostException if the host cannot be found */ public static ModelControllerClient create(final String hostName, final int port, final CallbackHandler handler, final SSLContext sslContext) throws UnknownHostException { return create(ClientConfigurationImpl.create(hostName, port, handler, sslContext)); }
/** * Create a client instance for a remote address and port. * * @param protocol The prototcol to use. If this is http-remoting or https-remoting http upgrade will be used * @param address the address of the remote host * @param port the port * @param handler CallbackHandler to obtain authentication information for the call. * @param saslOptions Additional options to be passed to the SASL mechanism. * @return A model controller client */ public static ModelControllerClient create(final String protocol, final InetAddress address, final int port, final CallbackHandler handler, final Map<String, String> saslOptions) { return create(ClientConfigurationImpl.create(protocol, address, port, handler, saslOptions)); }
/** * Create a client instance for a remote address and port and CallbackHandler. * * @param hostName the remote host * @param port the port * @param handler CallbackHandler to obtain authentication information for the call. * @param saslOptions Additional options to be passed to the SASL mechanism. * @return A model controller client * @throws UnknownHostException if the host cannot be found */ public static ModelControllerClient create(final String hostName, final int port, final CallbackHandler handler, final Map<String, String> saslOptions) throws UnknownHostException { return create(ClientConfigurationImpl.create(hostName, port, handler, saslOptions)); }
/** * Creates a new client. * * @return the client */ protected ModelControllerClient createClient() { return ModelControllerClient.Factory.create(getClientConfiguration()); }
public static ManagementInterface create(String host, int port, final String username, final String password) { ModelControllerClientConfiguration config = new ModelControllerClientConfiguration.Builder() .setHostName(host) .setPort(port) .setHandler(new RbacAdminCallbackHandler(username, password)) .setSaslOptions(SASL_OPTIONS) .build(); ModelControllerClient client = ModelControllerClient.Factory.create(config); return new NativeManagementInterface(client); } }
private ModelControllerClient createModelControllerClient() { final ModelControllerClientConfiguration.Builder builder = new ModelControllerClientConfiguration.Builder() .setProtocol(managementProtocol) .setHostName(managementAddress) .setPort(managementPort); if (authConfigUri == null) { builder.setHandler(Authentication.getCallbackHandler()); } else { builder.setAuthenticationConfigUri(authConfigUri); } return ModelControllerClient.Factory.create(builder.build()); }
public static ModelControllerClient createClient(Config config) throws Exception { ModelControllerClient client = ModelControllerClient.Factory.create( config.getHost(), config.getPort(), new AuthCallback(new String[] { config.getUser(), config.getPass() }) ); return client; } }
/** * Create a client instance for a remote address and port. * * @param address the address of the remote host * @param port the port * @return A model controller client */ public static ModelControllerClient create(final InetAddress address, final int port) { return create(ClientConfigurationImpl.create(address, port)); }
@Before public void setUp() throws Exception { controller = ModelControllerClient.Factory.create( server.getHotrodEndpoint().getInetAddress().getHostName(), SERVER1_MGMT_PORT); }
/** * Create a client instance for a remote address and port. * * @param address the address of the remote host * @param port the port * @param handler CallbackHandler to obtain authentication information for the call. * @param saslOptions Additional options to be passed to the SASL mechanism. * @return A model controller client */ public static ModelControllerClient create(final InetAddress address, final int port, final CallbackHandler handler, final Map<String, String> saslOptions) { return create(ClientConfigurationImpl.create(address, port, handler, saslOptions)); }
/** * Create a client instance for a remote address and port and CallbackHandler. * * @param hostName the remote host * @param port the port * @param handler CallbackHandler to obtain authentication information for the call. * @return A model controller client * @throws UnknownHostException if the host cannot be found */ public static ModelControllerClient create(final String hostName, final int port, final CallbackHandler handler) throws UnknownHostException { return create(ClientConfigurationImpl.create(hostName, port, handler)); }
/** * Create a client instance for a remote address and port. * * @param protocol The prototcol to use. If this is http-remoting or https-remoting http upgrade will be used rather than the native remote protocol * @param hostName the remote host * @param port the port * @return A model controller client * @throws UnknownHostException if the host cannot be found */ public static ModelControllerClient create(final String protocol, final String hostName, final int port) throws UnknownHostException { return create(ClientConfigurationImpl.create(protocol, hostName, port)); }
/** * Create a client instance for a remote address and port. * * @param protocol The prototcol to use. If this is http-remoting or https-remoting http upgrade will be used rather than the native remote protocol * @param address the address of the remote host * @param port the port * @return A model controller client */ public static ModelControllerClient create(final String protocol, final InetAddress address, final int port) { return create(ClientConfigurationImpl.create(protocol, address, port)); }
public static ModelControllerClient createClient(Config config) throws Exception { ModelControllerClient client = ModelControllerClient.Factory.create( config.getHost(), config.getPort(), new AuthCallback(new String[] { config.getUser(), config.getPass() }) ); return client; } }
/** * Create a client instance for a remote address and port. * * @param hostName the remote host * @param port the port * @return A model controller client * @throws UnknownHostException if the host cannot be found */ public static ModelControllerClient create(final String hostName, final int port) throws UnknownHostException { return create(ClientConfigurationImpl.create(hostName, port)); }
/** * Create a client instance for a remote address and port. * * @param protocol The prototcol to use. If this is http-remoting or https-remoting http upgrade will be used rather than the native remote protocol * @param address the address of the remote host * @param port the port * @param handler CallbackHandler to obtain authentication information for the call. * @return A model controller client */ public static ModelControllerClient create(final String protocol, final InetAddress address, final int port, final CallbackHandler handler) { return create(ClientConfigurationImpl.create(protocol, address, port, handler)); }
/** * Create a client instance for a remote address and port. * * @param address the address of the remote host * @param port the port * @param handler CallbackHandler to obtain authentication information for the call. * @return A model controller client */ public static ModelControllerClient create(final InetAddress address, final int port, final CallbackHandler handler) { return create(ClientConfigurationImpl.create(address, port, handler)); }