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

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


            .setPassword(pass)//
            .createASConnectionParams();
        ASConnection conn = new ASConnection(asConnectionParams);
        try {
   
            Address address = new Address(path);
   
            //create request to get metadata type information
            Operation op = new Operation("read-resource-description", address);
            //recurse down the tree.
            op.addAdditionalProperty("recursive", "true");
View Full Code Here


     * @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

        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

        Result result = parentComponent.getASConnection().execute(operation);
        return (String) result.getResult();
    }

    private List<ServerInfo> getManagedServers(String domainHost) {
        Address address = new Address("host", domainHost);
        Operation operation = new ReadChildrenNames(address, "server-config");
        ASConnection connection = parentComponent.getASConnection();
        Result res = connection.execute(operation);
        List<String> servers = (List<String>) res.getResult();
        List<ServerInfo> ret = new ArrayList<ServerInfo>(servers.size());
        for (String server : servers) {
            ServerInfo info = new ServerInfo();
            info.name = server;
            ret.add(info);

            address = new Address("host", domainHost);
            address.add("server-config", server);
            operation = new ReadResource(address);
            ComplexResult cres = connection.executeComplex(operation);
            Map<String, Object> map = cres.getResult();
            info.group = (String) map.get("group");
            info.autoStart = (Boolean) map.get("auto-start");
View Full Code Here

        return ret;
    }

    private HostInfo getHostInfo(String domainHost) {
        Address address = new Address("host", domainHost);
        Operation operation = new ReadResource(address);
        HostInfo info = new HostInfo();

        ComplexResult cres = parentComponent.getASConnection().executeComplex(operation);
        if (!cres.isSuccess())
View Full Code Here

    @BeforeMethod(alwaysRun = true)
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        report = new MeasurementReport();
        requests = new HashSet<MeasurementScheduleRequest>();
        address = new Address("path");
        sampleComponent = new SampleComponent();
    }
View Full Code Here

                List<Value> newAttributeState = new ArrayList<Value>();
                newAttributeState.add(loaded);

                //build the operation
                //update the address to point to the new child being created
                Address newChildLocation = new Address(path + "," + newChild);
                Operation op = createAddModuleOptionTypeOperation(newChildLocation, attribute, newAttributeState);

                Result result = connection.execute(op);
                if (result.isSuccess()) {
                    report.setStatus(CreateResourceStatus.SUCCESS);
                    report.setResourceKey(newChildLocation.getPath());
                    report.setResourceName(report.getResourceType().getName());
                } else {
                    report.setStatus(CreateResourceStatus.FAILURE);
                    report.setErrorMessage(result.getFailureDescription());
                }
View Full Code Here

            if (subPath.endsWith("*")) {
                subPath = subPath.substring(0,subPath.length()-1);
                includeRuntime=true;
            }

            Address address1 = new Address(address);
            address1.addSegment(subPath);
            operation = new ReadResource(address1);
            if (includeRuntime)
                ((ReadResource)operation).includeRuntime(true);
        } else {//no special handling of <c:groups> details required.
            //Just assume normal group operations aggregation semantics, so retrieve entries and load.
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private void loadAssignedServerGroups(Configuration configuration) {
        String managementNodeName = getManagementNodeName();
        Address theAddress = new Address("/");
        Operation op = new ReadChildrenResources(theAddress, "server-group");
        op.addAdditionalProperty("recursive-depth", "1");
        Result res = getASConnection().execute(op);
        PropertyList propGroups = new PropertyList("*1");
        configuration.put(propGroups);
View Full Code Here

        }
    }

    private Operation createServerGroupAssignmentStep(String action, String serverGroup, String runtimeName,
        boolean enabled) {
        Address addr = new Address();
        addr.add("server-group", serverGroup);
        addr.add("deployment", getManagementNodeName());
        Operation op = new Operation(action, addr);
        if ("add".equals(action)) {
            if (runtimeName != null && !runtimeName.isEmpty()) {
                op.addAdditionalProperty("runtime-name", runtimeName);
            }
View Full Code Here

TOP

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

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.