Package org.rhq.modules.plugins.jbossas7

Examples of org.rhq.modules.plugins.jbossas7.ASConnection


        String bytes_value = uploadToAs(TEST_WAR_PATH);

        System.out.println("sha: " + bytes_value);

        System.out.println();
        ASConnection connection = getDomainControllerASConnection();

        Operation op = addDeployment(TEST_WAR_FILE_NAME, bytes_value);
        JsonNode ret = connection.executeRaw(op);

        System.out.println("Add to /deploy done " + ret);
        System.out.flush();

        assert ret.toString().contains("success") : ret;

        Address serverGroupAddress = new Address();
        serverGroupAddress.add("server-group", "main-server-group");
        serverGroupAddress.add("deployment", TEST_WAR_FILE_NAME);

        Operation attach = new Operation("add", serverGroupAddress);
        attach.addAdditionalProperty("enabled", true);
        System.out.flush();
        ret = connection.executeRaw(attach);
        System.out.println("Add to server group done: " + ret);
        System.out.flush();

        assert ret.has("outcome") : "Ret not valid " + ret.toString();
        assert ret.get("outcome").getTextValue().equals("success") : "add to sg was no success " + ret.getTextValue();

        Result depRes;// = connection.execute(deploy);

        Thread.sleep(500);

        Operation undeploy = new Operation("undeploy", serverGroupAddress);
        depRes = connection.execute(undeploy);

        assert depRes.isSuccess() : "Undeploy went wrong: " + depRes.getFailureDescription();

        // Now tear down stuff again

        Operation unattach = new Remove(serverGroupAddress);
        ret = connection.executeRaw(unattach);

        assert ret.has("outcome") : "Ret not valid " + ret.toString();
        assert ret.get("outcome").getTextValue().equals("success") : "remove from sg was no success "
            + ret.getTextValue();

        // remove from domain

        Operation remove = new Remove("deployment", TEST_WAR_FILE_NAME);
        ret = connection.executeRaw(remove);

        assert ret.has("outcome") : "Ret not valid " + ret.toString();
        assert ret.get("outcome").getTextValue().equals("success") : "remove from domain was no success "
            + ret.getTextValue();
View Full Code Here


        CompositeOperation cop = new CompositeOperation();
        cop.addStep(step1);
        cop.addStep(step2);
        cop.addStep(step2a);

        ASConnection connection = getDomainControllerASConnection();
        JsonNode ret = connection.executeRaw(cop);
        System.out.println(ret);
        System.out.flush();

        assert ret.has("outcome") : "Ret not valid " + ret.toString();
        assert ret.get("outcome").getTextValue().equals("success") : "Composite deploy was no success "
            + ret.getTextValue();

        Thread.sleep(1000);

        cop = new CompositeOperation();
        cop.addStep(step3);
        cop.addStep(step3a);
        cop.addStep(step4);
        ret = connection.executeRaw(cop);

        System.out.println(ret);
        System.out.flush();

        assert ret.has("outcome") : "Ret not valid " + ret.toString();
View Full Code Here

        step1.addAdditionalProperty("name", TEST_WAR_FILE_NAME); // this needs to be unique per upload

        CompositeOperation cop = new CompositeOperation();
        cop.addStep(step1);

        ASConnection connection = getDomainControllerASConnection();
        JsonNode ret = connection.executeRaw(cop);
        System.out.println(ret);
        System.out.flush();

        assert ret.has("outcome") : "Ret not valid " + ret.toString();
        assert ret.get("outcome").getTextValue().equals("success") : "Composite deploy was no success "
            + ret.getTextValue();

        // Wait for AS to settle
        Thread.sleep(1000);

        // Now undeploy again to clean up

        cop = new CompositeOperation();
        Operation step4 = new Operation("remove", deploymentsAddress);

        cop.addStep(step4);
        ret = connection.executeRaw(cop);

        System.out.println(ret);
        System.out.flush();

        assert ret.has("outcome") : "Ret not valid " + ret.toString();
View Full Code Here

            return handleRevert(request);
        }

        BundleDeployResult result = new BundleDeployResult();

        ASConnection connection = new ASConnection(
            ASConnectionParams.createFrom(new ServerPluginConfiguration(request.getReferencedConfiguration())));

        ProcessExecutionResults results;
        BundleManagerProvider bmp = request.getBundleManagerProvider();
        BundleResourceDeployment rd = request.getResourceDeployment();
View Full Code Here

            for (PatchDetails pd : dm.applied) {
                pidsToRollback.add(pd.getId());
            }
        }

        ASConnection connection = new ASConnection(
            ASConnectionParams.createFrom(new ServerPluginConfiguration(request.getReferencedConfiguration())));

        String errorMessage = rollbackPatches(control, request.getBundleManagerProvider(),
            request.getLiveResourceDeployment(), connection, "purge", new ArrayList<String>(pidsToRollback));
View Full Code Here

                "' after this patch was already deployed. To prevent accidental damage no changes will be made to the server.");

            return result;
        }

        ASConnection connection = new ASConnection(
            ASConnectionParams.createFrom(new ServerPluginConfiguration(request.getReferencedConfiguration())));

        ServerControl control = onServer(request);

        String errorMessage = rollbackPatches(control, request.getBundleManagerProvider(),
View Full Code Here

   }

   @Override
    public CreateResourceReport createResource(CreateResourceReport report) {
        if (report.getPluginConfiguration().getSimpleValue("path").contains("jdbc")) {
            ASConnection connection = getASConnection();
            ConfigurationDefinition configDef = report.getResourceType().getResourceConfigurationDefinition();

            CreateResourceDelegate delegate = new CreateResourceDelegate(configDef, connection, getAddress()) {
               @Override
               protected Map<String, Object> prepareSimplePropertyMap(PropertyMap property, PropertyDefinitionMap propertyDefinition) {
View Full Code Here

@Test(groups = { "integration", "nonpc" }, dependsOnGroups = "discovery")
public abstract class AbstractIntegrationTest {

    String uploadToAs(String deploymentPath) throws IOException {
        String fileName = new File(deploymentPath).getName();
        ASConnectionParams asConnectionParams = new ASConnectionParamsBuilder() //
            .setHost(DC_HOST) //
            .setPort(DC_HTTP_PORT) //
            .setUsername(MANAGEMENT_USERNAME) //
            .setPassword(MANAGEMENT_PASSWORD) //
            .createASConnectionParams();
View Full Code Here

    private ASConnectionFactory() {
        // Utility class
    }

    public static ASConnection getStandaloneASConnection() {
        ASConnectionParams asConnectionParams = new ASConnectionParamsBuilder() //
            .setHost(STANDALONE_HOST) //
            .setPort(STANDALONE_HTTP_PORT) //
            .setUsername(MANAGEMENT_USERNAME) //
            .setPassword(MANAGEMENT_PASSWORD) //
            .createASConnectionParams();
View Full Code Here

            .createASConnectionParams();
        return new ASConnection(asConnectionParams);
    }

    public static ASConnection getDomainControllerASConnection() {
        ASConnectionParams asConnectionParams = new ASConnectionParamsBuilder() //
            .setHost(DC_HOST) //
            .setPort(DC_HTTP_PORT) //
            .setUsername(MANAGEMENT_USERNAME) //
            .setPassword(MANAGEMENT_PASSWORD) //
            .createASConnectionParams();
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.ASConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.