@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(); } }
public StandaloneAdministrationOperations(OnlineManagementClient client, int timeoutInSeconds) { this.client = client; this.ops = new Operations(client); this.timeoutInSeconds = timeoutInSeconds; }
public DomainAdministrationOperations(OnlineManagementClient client, int timeoutInSeconds) { this.client = client; this.ops = new Operations(client); this.timeoutInSeconds = timeoutInSeconds; }
public DomainAdministration(OnlineManagementClient client, int timeoutInSeconds) { super(client); this.client = client; this.ops = new Operations(client); this.domainOps = new DomainAdministrationOperations(client, timeoutInSeconds); }
/** * <p>Returns a new {@code Operations} object that will add the {@code headers} to all operations it executes. * Calling the {@code headers()} method on the resulting object again results in an exception. It is expected * to be used in two ways:</p> * * <ol> * <li>As an {@code Operations} object for all management operations in given scenario, * if the same headers should always be added.</li> * <li>As a one-off {@code Operations} object for a single management operation that should * have the given headers.</li> * </ol> * * <p>Both styles feature minimal syntactic overhead; the second one will needlessly allocate, * but that shouldn't be a problem (there are other inherent sources of excessive allocation).</p> */ public Operations headers(Values headers) { return new Operations(client, builder.withHeaders(headers)); }
/** * Returns the Java command the server / host controller was started with. It's read from the platform MBean * server via the management interface. * * @param host should be {@code null} for standalone server or for default host in managed domain; * should only be non-{@code null} if a specific host in managed domain is checked */ private static String commandUsedToStartTheServer(OnlineManagementClient client, String host) throws IOException { Address baseAddress = Address.root(); if (host != null) { baseAddress = Address.host(host); } ModelNodeResult systemProperties = new Operations(client).readAttribute( baseAddress.and(Constants.CORE_SERVICE, Constants.PLATFORM_MBEAN).and("type", "runtime"), "system-properties" ); systemProperties.assertDefinedValue(); // the "sun.java.command" system property exists at least on OpenJDK, Oracle Java and IBM Java return systemProperties.value().get("sun.java.command").asString(); }
private ManagementClient(String mgmtAddress, int mgmtPort) { OnlineManagementClient onlineClient = null; try { onlineClient = org.wildfly.extras.creaper.core.ManagementClient.online(OnlineOptions.domain() .forProfile("clustered") .build() .hostAndPort(mgmtAddress, mgmtPort) .auth(LOGIN, PASSWORD) .build() ); } catch (IOException ex) { throw new IllegalStateException("Error during connecting to server CLI.", ex); } ops = new Operations(onlineClient); }