/** * Set security domain name related configuration * @param securityDomainName */ public void setSecurityDomainName(String securityDomainName) { this.securityDomainName = securityDomainName; this.PICKETBOX_SECURITY_DOMAIN_ADDRESS=Address.subsystem("security").and("security-domain", securityDomainName); this.UNDERTOW_APPLICATION_SECURITY_DOMAIN_NAME=securityDomainName; this.UNDERTOW_APPLICATION_SECURITY_DOMAIN_ADDRESS = Address.subsystem("undertow").and("application-security-domain", UNDERTOW_APPLICATION_SECURITY_DOMAIN_NAME); }
/** * Removes given {@code server} from given {@code host} * * @return {@code true} if the server was actually removed, {@code false} otherwise */ public boolean removeServer(String host, String server) throws IOException, OperationException { return ops.removeIfExists(Address.host(host).and(Constants.SERVER_CONFIG, server)); } }
void shutdownServers(String host, List<String> servers) throws IOException, InterruptedException, TimeoutException { Batch batch = new Batch(); for (String server : servers) { batch.invoke(Constants.STOP, Address.host(host).and(Constants.SERVER_CONFIG, server)); } ops.batch(batch); }
/** * Stops given {@code server} on given {@code host}. * * @return {@code true} when server was successfully stopped, {@code false} otherwise */ public boolean stopServer(String host, String server) throws IOException { ModelNodeResult result = ops.invoke("stop", Address.host(host).and(Constants.SERVER_CONFIG, server), Values.of("blocking", true)); result.assertDefinedValue(); return result.isSuccess(); }
/** * Starts given {@code server} on given {@code host}. * * @return {@code true} when server was successfully started, {@code false} otherwise */ public boolean startServer(String host, String server) throws IOException { ModelNodeResult result = ops.invoke(Constants.START, Address.host(host).and(Constants.SERVER_CONFIG, server), Values.of(Constants.BLOCKING, true)); result.assertDefinedValue(); return result.isSuccess(); }
public void addCacheConfiguration(String name, String cacheContainer, CacheTemplate template) throws Exception { ops.add(Address.subsystem("datagrid-infinispan") .and("cache-container", cacheContainer) .and("configurations", "CONFIGURATIONS") .and(template.getType(), name), Values.empty() .and("mode", "SYNC") .andOptional("start", "EAGER")); }
public void removeSocketBinding(String name, String socketBindingGroup) throws Exception { ops.removeIfExists(Address.of("socket-binding-group", socketBindingGroup) .and("socket-binding", name)); }
void shutdownServersGracefully(String host, List<String> servers, int timeoutInSeconds) throws IOException, InterruptedException, TimeoutException { client.version().assertAtLeast(ServerVersion.VERSION_3_0_0, "Graceful shutdown is only supported since WildFly 9"); Batch batch = new Batch(); for (String server : servers) { batch.invoke(Constants.STOP, Address.host(host).and(Constants.SERVER_CONFIG, server), Values.of(Constants.TIMEOUT, timeoutInSeconds)); } ops.batch(batch); }
public void addCache(String name, String cacheContainer, String baseConfiguration, String cacheType) throws Exception { ops.add(Address.subsystem("datagrid-infinispan") .and("cache-container", cacheContainer) .and(cacheType, name), Values.empty() .andOptional("configuration", baseConfiguration) .and("start", "EAGER") .and("mode", "SYNC")); }
public void addSocketBinding(String name, String socketBindingGroup, int port) throws Exception { ops.add(Address.of("socket-binding-group", socketBindingGroup) .and("socket-binding", name), Values.empty() .and("port", port)); }
public void addRemotingConnector(String socketBinding) throws Exception { ops.add(Address.subsystem("remoting") .and("connector", "remoting-connector"), Values.empty() .and("socket-binding", socketBinding) .and("security-realm", "ApplicationRealm")); ops.add(Address.subsystem("jmx") .and("remoting-connector", "jmx"), //this has to be "jmx" name Values.empty() .and("use-management-endpoint", "false")); }
public void addCacheContainer(String name, String defaultCache) throws Exception { ops.add(Address.subsystem("datagrid-infinispan") .and("cache-container", name), Values.empty() .and("default-cache", defaultCache) .and("statistics", "true")); }
public void addRestEndpoint(String name, String cacheContainer, String cache, String socketBinding) throws Exception { ops.add(Address.subsystem("datagrid-infinispan-endpoint") .and("rest-connector", name), Values.empty() .and("cache-container", cacheContainer) .and("cache", cache) .and("socket-binding", socketBinding)); }
public void addMemcachedEndpoint(String name, String cacheContainer, String cache, String socketBinding) throws Exception { ops.add(Address.subsystem("datagrid-infinispan-endpoint") .and("memcached-connector", name), Values.empty() .and("cache-container", cacheContainer) .and("cache", cache) .and("socket-binding", socketBinding)); }
public void addHotRodEndpoint(String name, String cacheContainer, String cache, String socketBinding) throws Exception { ops.add(Address.subsystem("datagrid-infinispan-endpoint") .and("hotrod-connector", name), Values.empty() .and("cache-container", cacheContainer) .and("cache", cache) .and("socket-binding", socketBinding)); }