Package org.nimbustools.ctxbroker.generated.gt4_0.description

Examples of org.nimbustools.ctxbroker.generated.gt4_0.description.Provides_Type


        // one section will be marked active
        int totalNodes = this.clusterSanityAndCount(cluster);
        logger.debug("total nodes: " + totalNodes);

        final Cloudworkspace_Type[] vms = cluster.getWorkspace();
        Contextualization_Type ctxDoc = null;
        for (Cloudworkspace_Type vm : vms) {
            if (Boolean.TRUE.equals(vm.getActive())) {
                ctxDoc = vm.getCtx(); // clusterSanityAndCount guarantees one and only one
                break;
            }
        }

        // clusterSanity checked this already, this is to satisfy automatic
        // code analysis
        if (ctxDoc == null) {
            throw new NullPointerException();
        }

        this.basicCtxdocValidate(ctxDoc);

        for (Identity identity : identities) {
            final String hostname = identity.getHostname();
            if (hostname != null) {
                logger.debug("hostname: " + hostname);
                this.newHostname(workspaceID, hostname, resource);
            }
            final String ip = identity.getIp();
            if (ip != null) {
                logger.debug("ip: " + ip);
                this.newIP(workspaceID, ip, resource);
            }
        }

        resource.addWorkspace(workspaceID,
                              identities,
                              ctxDoc.getRequires(),
                              ctxDoc.getProvides(),
                              totalNodes);
    }
View Full Code Here


        args.setCluster(clusta);
        this.ctxRetrieve.setRetrieveSend(args);
    }

    private IdentityProvides_Type getFake_0() {
        final IdentityProvides_Type id = new IdentityProvides_Type();
        id.set_interface("publicnic");
        id.setIp("1.2.3.4");
        id.setHostname("example.com");
        id.setPubkey("pubkey text");
        return id;
    }
View Full Code Here

        id.setPubkey("pubkey text");
        return id;
    }

    private IdentityProvides_Type getFake_1() {
        final IdentityProvides_Type id = new IdentityProvides_Type();
        id.set_interface("localnic");
        id.setIp("7.8.9.0");
        id.setHostname("example2.com");
        id.setPubkey("pubkey text 2");
        return id;
    }
View Full Code Here

    private String identitiesDump(IdentityProvides_Type[] identities) {
        final StringBuffer buf = new StringBuffer();
        for (int i = 0; i < identities.length; i++) {
            buf.append("IdentityProvides_Type #")
               .append(i);
            IdentityProvides_Type id = identities[i];
            if (id == null) {
                buf.append(" is null.\n");
            } else {
               buf.append(":\n")
                  .append(" - interface: '")
                  .append(id.get_interface())
                  .append("'\n");
               buf.append(" - ip: '")
                  .append(id.getIp())
                  .append("'\n");
                buf.append(" - hostname: '")
                  .append(id.getHostname())
                  .append("'\n");
                buf.append(" - ssh pubkey: '")
                  .append(id.getPubkey())
                  .append("'\n");
            }
        }
        return buf.toString();
    }
View Full Code Here

            }
        }
    }

    public static void main(String[] args) throws Exception {
        IdentityProvides_Type id = new IdentityProvides_Type();
        id.set_interface(null);
        id.setHostname("xyz");
        id.setIp("1.2.3.4");
        id.setPubkey("ssh-rsa 132reoi3nfoi3nfoin3f#$@$@#$@#$@#$@#$");

        IdentityProvides_Type[] ids = {id};
        Node_Type node = new Node_Type();
        node.setIdentity(ids);
        Node_Type[] nodes = {node};
View Full Code Here

        }
        if (cluster == null) {
            throw new IllegalArgumentException("cluster may not be null");
        }

        Nimbusctx_Type wrapper = new Nimbusctx_Type();
        wrapper.setCluster(cluster);
        wrapper.setContact(brokerContact);

        final QName qName = new QName("", "NIMBUS_CTX");

        File f = new File(newdir, userdata_fileName);
View Full Code Here

            final File datafile = new File(ctxTempDir, "userdata-" + i);

            ctxUserDataPaths[i] = datafile.getAbsolutePath();

            Nimbusctx_Type wrapper = new Nimbusctx_Type();
            wrapper.setCluster(oneCtx);
            wrapper.setContact(brokerContact);

            final QName qName = new QName("", "NIMBUS_CTX");

            try {
                final String data =
View Full Code Here

        if (ctx == null) {
            throw new IllegalArgumentException("contextualization " +
                    "document given to validate is null");
        }
       
        Provides_Type provides = ctx.getProvides();
        Requires_Type requires = ctx.getRequires();

        if (provides == null && requires == null) {
            throw new ContextBrokerException("Both provides and " +
                    "requires are missing. Will not contextualize this. " +
                    "If there is nothing to do, do not include " +
                    "contextualization document.");
        }

        if (provides != null) {
            IdentityProvides_Type[] givenIDs = provides.getIdentity();
            if (givenIDs == null || givenIDs.length == 0) {
                throw new ContextBrokerException("Provides section is " +
                        "present but has no identity elements.  Will not " +
                        "contextualize.");
            }
View Full Code Here

        if (id == null) {
            throw ContextFault.makeCtxFault(
                    "broker cannot resolve this caller's identity", null);
        }

        final Requires_Type requires;
        try {
            requires = resource.retrieve(id);
        } catch (ContextBrokerException e) {
            if (logger.isDebugEnabled()) {
                logger.error(e.getMessage(), e);
View Full Code Here

            throw new IllegalArgumentException("contextualization " +
                    "document given to validate is null");
        }
       
        Provides_Type provides = ctx.getProvides();
        Requires_Type requires = ctx.getRequires();

        if (provides == null && requires == null) {
            throw new ContextBrokerException("Both provides and " +
                    "requires are missing. Will not contextualize this. " +
                    "If there is nothing to do, do not include " +
                    "contextualization document.");
        }

        if (provides != null) {
            IdentityProvides_Type[] givenIDs = provides.getIdentity();
            if (givenIDs == null || givenIDs.length == 0) {
                throw new ContextBrokerException("Provides section is " +
                        "present but has no identity elements.  Will not " +
                        "contextualize.");
            }
        }

        if (requires == null) {
            return;
        }

        Requires_TypeIdentity[] givenID = requires.getIdentity();

        if (givenID == null || givenID.length == 0) {
            return;
        }
       
View Full Code Here

TOP

Related Classes of org.nimbustools.ctxbroker.generated.gt4_0.description.Provides_Type

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.