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

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


        OperationResult result = new OperationResult();

        Operation operation;
        if (name.equals("jndi-view")) {
            Address address = new Address(path);
            operation = new Operation("jndi-view",address);
            Result res = getASConnection().execute(operation);

            if (!res.isSuccess()) {
                result.setErrorMessage(res.getFailureDescription());
View Full Code Here


        BaseComponent<?> parentResourceComponent = context.getParentResourceComponent();
        BaseServerComponent serverComponent = parentResourceComponent.getServerComponent();
        DiscoveredResourceDetails resourceDetails = discoveredResources.iterator().next();
        Configuration pluginConfig = resourceDetails.getPluginConfiguration();
        String nodePath = pluginConfig.getSimpleValue(PATH_ATTRIBUTE);
        String contextRoot = getContextRootAttribute(new Address(nodePath), parentResourceComponent.getASConnection());

        discoverResponseTimeLogFile(serverComponent, pluginConfig, nodePath, contextRoot);

        return discoveredResources;
    }
View Full Code Here

        }
        //get root modcluster component
        String resourceKey = component.key;
        String[] resourceKeyComponents = resourceKey.split(":");

        Operation op = new Operation("read-proxies-info", new Address(resourceKeyComponents[0]));
        Result result = getASConnection().execute(op);
        //get ProxyInfo and parse
        rawProxyInfo = ModClusterContextDiscoveryComponent.extractRawProxyInfo(result);

        return rawProxyInfo;
View Full Code Here

    }

    @Override
    public Address getAddress() {
        int indexOfSeparator = this.context.getResourceKey().indexOf(":");
        return new Address(this.context.getResourceKey().substring(0, indexOfSeparator));
    }
View Full Code Here

            + currentConfigConnectionProperties.size());
        allConnectionPropertyNames.addAll(newConfigConnectionProperties.keySet());
        allConnectionPropertyNames.addAll(currentConfigConnectionProperties.keySet());

        for (String connectionPropertyName : allConnectionPropertyNames) {
            Address propertyAddress = new Address(getAddress());
            propertyAddress.add(connPropAttributeNameOnServer, connectionPropertyName);

            String newConfigConnectionPropertyValue = newConfigConnectionProperties.get(connectionPropertyName);
            String currentConfigConnectionPropertyValue = currentConfigConnectionProperties.get(connectionPropertyName);

            if (newConfigConnectionPropertyValue == null) {
View Full Code Here

     * @return Availability of the managed AS instance.
     */
    @Override
    public AvailabilityType getAvailability() {
        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) {
View Full Code Here

            if (request.getName().startsWith("_skm:")) {
                skmRequests.add(request);
            } else 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();
                    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();
View Full Code Here

    @Override
    protected Address getServerAddress() {
        String serverConfigElement = getAddress().get(1);
        String serverName = serverConfigElement.substring(serverConfigElement.indexOf('=') + 1);
        Address serverAddress = getAddress().getParent();
        serverAddress.add("server", serverName);
        return serverAddress;
    }
View Full Code Here

                group = readAttribute("group");
            } catch (Exception e) {
                group = null;
            }
            if (group != null) {
                Address groupAddress = new Address("server-group", group);
                try {
                    socketBindingGroup = readAttribute(groupAddress, "socket-binding-group");
                } catch (Exception e) {
                    // ignore
                }
View Full Code Here

        // No success -> no point in continuing
        if (report.getStatus() != SUCCESS) {
            return report;
        }

        Address datasourceAddress = new Address(report.getResourceKey());

        // outer create resource did not cater for the connection or xa properties, so lets add them now
        String connPropAttributeNameOnServer, connPropPluginConfigPropertyName, keyName;
        if (isXADatasourceResource(resourceType)) {
            connPropAttributeNameOnServer = "xa-datasource-properties";
            connPropPluginConfigPropertyName = XA_DATASOURCE_PROPERTIES_ATTRIBUTE;
            keyName = "key";
        } else {
            connPropAttributeNameOnServer = "connection-properties";
            connPropPluginConfigPropertyName = CONNECTION_PROPERTIES_ATTRIBUTE;
            keyName = "pname";
        }
        PropertyList listPropertyWrapper = config.getList(connPropPluginConfigPropertyName);
        Map<String, String> connectionPropertiesAsMap = getConnectionPropertiesAsMap(listPropertyWrapper, keyName);
        // if no conn or xa props supplied in the create resource request, skip and continue
        if (!connectionPropertiesAsMap.isEmpty()) {
            CompositeOperation cop = new CompositeOperation();
            for (Map.Entry<String, String> connectionProperty : connectionPropertiesAsMap.entrySet()) {
                Address propertyAddress = new Address(datasourceAddress);
                propertyAddress.add(connPropAttributeNameOnServer, connectionProperty.getKey());
                Operation op = new Operation("add", propertyAddress);
                op.addAdditionalProperty("value", connectionProperty.getValue());
                cop.addStep(op);
            }
            Result res = getASConnection().execute(cop);
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.