Examples of ASConnection


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();

        Address deploymentsAddress = new Address("deployment", TEST_WAR_FILE_NAME);
        Operation op = new Operation("add", deploymentsAddress);
        List<Object> content = new ArrayList<Object>(1);
        Map<String, Object> contentValues = new HashMap<String, Object>();
        contentValues.put("hash", new PROPERTY_VALUE("BYTES_VALUE", bytes_value));
        content.add(contentValues);
        op.addAdditionalProperty("content", content);
        op.addAdditionalProperty("name", TEST_WAR_FILE_NAME); // this needs to be unique per upload
        op.addAdditionalProperty("runtime-name", TEST_WAR_FILE_NAME);
        System.out.flush();
        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);//,"enabled","true");
        //        deploy.addAdditionalProperty("runtime-name", TEST_WAR);
        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();

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

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

        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 Operation("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 Operation("remove", deploymentsAddress);
        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

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

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

        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

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

        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

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

            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

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

            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

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

                "' 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

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

   }

   @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
TOP
Copyright © 2018 www.massapi.com. 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.