Examples of MQBrokerConfigDTO


Examples of io.fabric8.api.jmx.MQBrokerConfigDTO

        // lets assume 2 required instances for master/slave unless folks use
        // N+1 or replicated
        int requiredInstances = 2;
        if (list.size() == 1) {
            MQBrokerConfigDTO loadedDTO = list.get(0);
            requiredInstances = loadedDTO.requiredInstances();
        } else {
            // assume N+1 broker as there's more than one broker in the profile; so lets set the required size to N+1
            requiredInstances = list.size() + 1;
        }
        if (minimumInstances == null || minimumInstances.intValue() < requiredInstances) {
View Full Code Here

Examples of io.fabric8.api.jmx.MQBrokerConfigDTO

            String key = entry.getKey();
            Map<String, String> configuration = entry.getValue();
            if (isBrokerConfigPid(key)) {
                String brokerName = getBrokerNameFromPID(key);
                String profileId = profile.getId();
                MQBrokerConfigDTO dto = new MQBrokerConfigDTO();
                dto.setProfile(profileId);
                dto.setBrokerName(brokerName);
                String version = profile.getVersion();
                dto.setVersion(version);
                List<String> parentIds = profile.getParentIds();
                if (parentIds.size() > 0) {
                    dto.setParentProfile(parentIds.get(0));
                }
                if (configuration != null) {
                    dto.setData(configuration.get(DATA));
                    dto.setConfigUrl(configuration.get(CONFIG_URL));
                    dto.setGroup(configuration.get(GROUP));
                    dto.setKind(BrokerKind.fromValue(configuration.get(KIND)));
                    dto.setMinimumInstances(Maps.integerValue(configuration, MINIMUM_INSTANCES));
                    dto.setNetworks(Maps.stringValues(configuration, NETWORKS));
                    dto.setNetworksUserName(configuration.get(NETWORK_USER_NAME));
                    dto.setNetworksPassword(configuration.get(NETWORK_PASSWORD));
                    dto.setReplicas(Maps.integerValue(configuration, REPLICAS));
                    for (Map.Entry<String, String> configurationEntry : configuration.entrySet()) {
                        if (configurationEntry.getKey().endsWith("-port")) {
                            dto.getPorts().put(configurationEntry.getKey().substring(0, configurationEntry.getKey().indexOf("-port")) , configurationEntry.getValue());
                        }
                    }
                }
                answer.add(dto);
            }
View Full Code Here

Examples of io.fabric8.api.jmx.MQBrokerConfigDTO

        this.runtimeProperties = runtimeProperties;
    }

    @Override
    protected Object doExecute() throws Exception {
        MQBrokerConfigDTO dto = createDTO();

        Profile profile = MQManager.createOrUpdateProfile(dto, fabricService, runtimeProperties);
        String profileId = profile.getId();

        System.out.println("MQ profile " + profileId + " ready");

        // assign profile to existing containers
        if (assign != null) {
            String[] assignContainers = assign.split(",");
            MQManager.assignProfileToContainers(fabricService, profile, assignContainers);
        }

        // create containers
        if (create != null) {
            String[] createContainers = create.split(",");
            List<CreateContainerBasicOptions.Builder> builderList = MQManager.createContainerBuilders(
                    dto, fabricService, "child", profileId, dto.version(), createContainers);
            for (CreateContainerBasicOptions.Builder builder : builderList) {
                CreateContainerMetadata[] metadatas;
                try {
                    if (builder instanceof CreateChildContainerOptions.Builder) {
                        CreateChildContainerOptions.Builder childBuilder = (CreateChildContainerOptions.Builder) builder;
View Full Code Here

Examples of io.fabric8.api.jmx.MQBrokerConfigDTO

        }
        if (Strings.isNullOrBlank(password)) {
            password = ShellUtils.retrieveFabricUserPassword(session);
        }

        MQBrokerConfigDTO dto = new MQBrokerConfigDTO();
        if( config != null ) {
            dto.setConfigUrl(config);
        } else {
            if( nossl) {
                dto.setConfigUrl("broker.xml");
            } else {
                dto.setConfigUrl("ssl-broker.xml");
            }
        }
        dto.setData(data);
        if (ports != null && ports.length > 0) {
            for (String port : ports) {
                addConfig(port, dto.getPorts());
            }
        }
        dto.setGroup(group);
        dto.setJvmOpts(jvmOpts);
        dto.setBrokerName(name);
        dto.setProfile(profile);
        dto.setClientProfile(clientProfile);
        dto.setClientParentProfile(clientParentProfile);
        dto.setNetworks(networks);
        dto.setNetworksPassword(networksPassword);
        dto.setNetworksUserName(networksUserName);
        dto.setParentProfile(parentProfile);
        dto.setProperties(properties);
        dto.setVersion(version);
        dto.setMinimumInstances(minimumInstances);
        dto.setReplicas(replicas);
        dto.setSsl(!nossl);
        dto.setKind(kind);
        return dto;
    }
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.