Package org.rhq.modules.plugins.jbossas7.json

Examples of org.rhq.modules.plugins.jbossas7.json.CompositeOperation


     * Reads local-host-name attribute
     *
     * @return name current host within EAP domain or null if we failed to read it
     */
    public static String findASDomainHostName(ASConnection connection) {
        ReadAttribute op = new ReadAttribute(new Address(), "local-host-name");
        op.includeDefaults(true);
        Result result = connection.execute(op);
        if (result.isSuccess()) {
            return result.getResult().toString();
        }
View Full Code Here


        }
        return hostConfig;
    }

    private void collectServerKindTraits(MeasurementReport report, Set<MeasurementScheduleRequest> skmRequests) {
        Address address = new Address();

        ReadResource op = new ReadResource(address);
        op.includeRuntime(true);

        ComplexResult res = getASConnection().executeComplex(op);
View Full Code Here

      for (MeasurementScheduleRequest request: requests) {
         if (request.getName().equals("startTime")) {
            String path = getPath();
            path = path.replace("server-config","server");
            Address address = new Address(path);
            address.add("core-service","platform-mbean");
            address.add("type","runtime");
            Operation op = new ReadAttribute(address,"start-time");
            Result res = getASConnection().execute(op);

            if (res.isSuccess()) {
               Long startTime= (Long) res.getResult();
View Full Code Here

    public  void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {

         for (MeasurementScheduleRequest req : metrics) {
            if (req.getName().equals("appuid")) {

                Address addr = new Address("core-service=platform-mbean,type=runtime");
                ReadAttribute op = new ReadAttribute(addr,"system-properties");
                ASConnection conn = parent.getASConnection();
                ComplexResult result = conn.executeComplex(op);

                if (result.isSuccess()) {
View Full Code Here

        if (verbose) {
            log.info("total path: [" + path + "]");
        }

        Address addr = new Address(parentPath);
        Result result = connection.execute(new ReadChildrenNames(addr, confPath));

        if (result.isSuccess()) {

            @SuppressWarnings("unchecked")
View Full Code Here

    // TODO: Re-enable if appropriate.
    @Test(enabled = false)
    public void readSocketBindings() throws Exception {
        ConfigurationDefinition configDef = loadServiceDescriptor("SocketBindingGroupDomain");

        Address a = new Address("socket-binding-group=standard-sockets");
        ConfigurationLoadDelegate loadDelegate = new ConfigurationLoadDelegate(configDef,
            getDomainControllerASConnection(), a);
        Configuration conf = loadDelegate.loadResourceConfiguration();

        assert conf != null : "Did not get a configuration back";
View Full Code Here

    // TODO: Re-enable if appropriate.
    @Test(enabled = false)
    public void readUpdateSocketBindings() throws Exception {
        ConfigurationDefinition configDef = loadServiceDescriptor("SocketBindingGroupDomain");

        Address a = new Address("socket-binding-group=standard-sockets");
        ConfigurationLoadDelegate loadDelegate = new ConfigurationLoadDelegate(configDef,
            getDomainControllerASConnection(), a);
        Configuration conf = loadDelegate.loadResourceConfiguration();

        assert conf != null : "Did not get a configuration back";
View Full Code Here

        Address address = new Address();

        ReadResource op = new ReadResource(address);
        op.includeRuntime(true);

        ComplexResult res = getASConnection().executeComplex(op);
        if (res.isSuccess()) {
            Map<String, Object> props = res.getResult();

            for (MeasurementScheduleRequest request : skmRequests) {
                String requestName = request.getName();
                String realName = requestName.substring(requestName.indexOf(':') + 1);
                String val = null;
                if (props.containsKey(realName)) {
                    val = getStringValue(props.get(realName));
                }

                if ("null".equals(val)) {
                    if (realName.equals("product-name"))
                        val = "JBoss AS";
                    else if (realName.equals("product-version"))
                        val = getStringValue(props.get("release-version"));
                    else if (LOG.isDebugEnabled()) {
                        LOG.debug("Value for " + realName + " was 'null' and no replacement found");
                    }
                }
                MeasurementDataTrait data = new MeasurementDataTrait(request, val);
                report.addData(data);
            }
        } else if (LOG.isDebugEnabled()) {
            LOG.debug("getSKMRequests failed: " + res.getFailureDescription());
        }
    }
View Full Code Here

            if (req.getName().equals("appuid")) {

                Address addr = new Address("core-service=platform-mbean,type=runtime");
                ReadAttribute op = new ReadAttribute(addr,"system-properties");
                ASConnection conn = parent.getASConnection();
                ComplexResult result = conn.executeComplex(op);

                if (result.isSuccess()) {
                    Map<String,Object> data = result.getResult();
                    if (data.containsKey("OPENSHIFT_APP_UUID")) {
                        String uid = (String) data.get("OPENSHIFT_APP_UUID");
                        MeasurementDataTrait res = new MeasurementDataTrait(req,uid);
                 report.addData(res);
                    }
                }
                else {
                    log.warn("Operation failed: " + result.getFailureDescription());
                }
            }
            // TODO add more metrics here
         }
    }
View Full Code Here

        Address address= new Address();
        address.add("subsystem","web");
        address.add("connector","http");
        address.add("profile","default");

        CompositeOperation op = new CompositeOperation();

        Operation step1 = new Operation("add", address);
        op.addStep(step1);

        Operation step2 = new Operation("deploy", address);
        op.addStep(step2);

        ObjectMapper mapper = new ObjectMapper();

        String result = mapper.writeValueAsString(op);
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.json.CompositeOperation

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.