Examples of ReadAttribute


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

        ContentFileInfo contentFileInfo = new JarContentFileInfo(file);
        return contentFileInfo.getVersion(null);
    }

    private String getDeploymentName() {
        Operation op = new ReadAttribute(getAddress(), "name");
        Result res = getASConnection().execute(op);

        return (String) res.getResult();
    }
View Full Code Here

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

        return errorMessage;
    }

    private boolean isServerUp(ASConnection connection) {
        Operation op = new ReadAttribute(new Address(), "release-version");
        try {
            org.rhq.modules.plugins.jbossas7.json.Result res = connection.execute(op);
            if (res.isSuccess()) { // If op succeeds, server is not down
                return true;
            }
View Full Code Here

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

            }
        }

        // Now enable/disable datasource as required

        ReadAttribute readEnabledAttribute = new ReadAttribute(datasourceAddress, ENABLED_ATTRIBUTE);
        Result readEnabledAttributeResult = getASConnection().execute(readEnabledAttribute);
        if (!readEnabledAttributeResult.isSuccess()) {
            report.setStatus(INVALID_ARTIFACT);
            report.setErrorMessage("Datasource was added but the agent could not read its configuration: "
                + readEnabledAttributeResult.getFailureDescription());
View Full Code Here

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

            pluginConfig.setSimpleValue(RESPONSE_TIME_LOG_FILE_CONFIG_PROP, rtFilePath);
        }
    }

    private String getContextRootAttribute(Address address, ASConnection asConnection) {
        ReadAttribute readAttribute = new ReadAttribute(address, CONTEXT_ROOT_ATTRIBUTE);
        Result readAttributeResult = asConnection.execute(readAttribute);
        if (!readAttributeResult.isSuccess()) {
            throw new RuntimeException("Could not read [" + CONTEXT_ROOT_ATTRIBUTE + "] attribute of node ["
                + address.getPath() + "]: " + readAttributeResult.getFailureDescription());
        }
View Full Code Here

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

        if (context.getResourceType().getName().equals(MANAGED_SERVER_TYPE_NAME)) {
            Address theAddress = new Address();
            String host = pluginConfiguration.getSimpleValue("domainHost", "local");
            theAddress.add("host", host);
            theAddress.add("server-config", myServerName);
            Operation getStatus = new ReadAttribute(theAddress, "status");
            Result result;
            try {
                result = getASConnection().execute(getStatus, AVAIL_OP_TIMEOUT_SECONDS);
            } catch (Exception e) {
                getLog().warn(e.getMessage());
View Full Code Here

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

                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();
                    MeasurementDataTrait data = new MeasurementDataTrait(request, new Date(startTime).toString());
                    report.addData(data);
                }
            } else if (request.getName().equals("multicastAddress")) {
                collectMulticastAddressTrait(report, request);
            } else {
                leftovers.add(request);
            }
        }

        // Now handle the skm (this could go into a common method with BaseServerComponent's impl.
        if (skmRequests.size() > 0) {
            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) {
View Full Code Here

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

     * @param asConnection ASConnection to the parent
     * @return Host name
     */
    private String getHostName(ASConnection asConnection) {

        Operation op = new ReadAttribute(new Address(),"local-host-name");
        String hostname;
        Result res = asConnection.execute(op);
        if (res.isSuccess()) {
            hostname = (String) res.getResult();
            return hostname;
View Full Code Here

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

        return hostname;
    }

    private String resolveSocketBindingGroup(String serverGroup) {
        Address address = new Address("server-group", serverGroup);
        Operation operation = new ReadAttribute(address, "socket-binding-group");
        Result result = parentComponent.getASConnection().execute(operation);
        return (String) result.getResult();
    }
View Full Code Here

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

        @Override
        public boolean matches(Object argument) {
            if (!(argument instanceof ReadAttribute)) {
                return false;
            }
            ReadAttribute readAttribute = (ReadAttribute) argument;
            return address.getPath().equals(readAttribute.getAddress().getPath())
                && attributeName.equals(readAttribute.getName());
        }
View Full Code Here

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

                ResourceType parentType = (ResourceType) resourceType.getParentResourceTypes().toArray()[0];
                attribute = attributeMap.get(parentType.getName());
               
                //retrieve existing attribute definition
                //get the current attribute value
                ReadAttribute op = new ReadAttribute(address, attribute);
                Result result = getASConnection().execute(op);
                if (result.isSuccess()) {
                    //populate attribute values
                    List<Value> currentAttributeState = new ArrayList<Value>();
                    currentAttributeState = ModuleOptionsComponent.populateSecurityDomainModuleOptions(result,
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.