@Override public void setup(ManagementClient fakemanagementClient, String s) throws Exception { // Set path for users.properties and roles.properties setConfigurationPath(); // Create and initialize management client managementClient = TestUtil.clientInit(); administration = new Administration(managementClient); ops = new Operations(managementClient); if (subsystem.equals("elytron")) { configureElytron(); } else { configurePicketBox(); } }
@Override public void executeCli(String cliOperation) throws CliException, IOException { if (cliOperation.trim().startsWith("connect")) { throw new CliException("The 'connect' operation is not supported"); } checkClosed(); cliOperation = adjustOperationForDomain.adjust(cliOperation); log.debugf("Executing CLI operation %s", cliOperation); try { if ("reload".equals(cliOperation.trim())) { // CLI requires a special implementation of ModelControllerClient for "reload" and "shutdown", // but we only have the standard one, so these operations won't work // // however, "reload" with no options is particularly common in CLI scripts, so this special case // helps in those situations new Administration(this).reload(); } else { cliContext.handle(cliOperation); } } catch (Exception e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new CliException(e); } if (cliContext.getExitCode() != 0 || cliContext.isTerminated()) { throw new CliException("CLI operation failed: " + cliOperation); } }
public void reloadServer() throws IOException, TimeoutException, InterruptedException { Administration admin = new Administration(org.wildfly.extras.creaper.core.ManagementClient.online(OnlineOptions.domain() .forHost("master") .build() .hostAndPort(NODE0_ADDRESS, NODE0_PORT) .auth(LOGIN, PASSWORD) .build() )); admin.reload(); }