Package org.nimbustools.ctxbroker

Examples of org.nimbustools.ctxbroker.Identity


            final StringBuffer buf = new StringBuffer();
            buf.append("Broker hearing from a VM for first time, IP(s)=");

            Identity[] ids = new Identity[identities.length];
            for (int i = 0; i < identities.length; i++) {
                ids[i] = new Identity();
                ids[i].setIface(identities[i].get_interface());
                ids[i].setIp(identities[i].getIp());
                buf.append(" '").append(identities[i].getIp()).append("'");
                ids[i].setHostname(identities[i].getHostname());
                ids[i].setPubkey(identities[i].getPubkey());
View Full Code Here


    private String identitiesDump(Identity[] identities) {
        final StringBuffer buf = new StringBuffer();
        for (int i = 0; i < identities.length; i++) {
            buf.append("IdentityProvides_Type #")
               .append(i);
            Identity id = identities[i];
            if (id == null) {
                buf.append(" is null.\n");
            } else {
               buf.append(":\n")
                  .append(" - interface: '")
                  .append(id.getIface())
                  .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

    private synchronized Integer getWorkspaceID() {
        return nextWorkspaceID++;
    }
    private Identity getIdentity(int workspaceID) {
        return new Identity("publicnic",
                "192.168.0."+workspaceID,
                "id-"+workspaceID,
                "asdfghjk");
    }
View Full Code Here

    }

    synchronized void addIdentity(String iface, Identity id)
            throws ContextBrokerException {

        Identity perhaps = this.identities.get(iface);
        if (perhaps != null) {
            // Binding does not allow different NIC names in the real id's,
            // it must be the provides section's fault
            throw new ContextBrokerException("Duplicate interface found." +
                    "  Identity names in provides section can not be" +
View Full Code Here

        }

        identities = new ArrayList<Identity>();
        final Enumeration<Identity> idEnum = node.getIdentities();
        while (idEnum.hasMoreElements()) {
            Identity identity = idEnum.nextElement();
            identities.add(identity);
        }

        final CtxResult ctxResult = node.getCtxResult();
        this.okOccurred = ctxResult.hasOkOccurred();
View Full Code Here

            final String iface = roleDesc.getIface();
            if (iface != null) {

                // only this specific interface provides the role

                final Identity identity = node.getParticularIdentity(iface);
                if (identity == null) {
                    throw new ContextBrokerException("There is an " +
                            "interface specification ('" + iface + "') in " +
                            "the provides section for role '" + roleName +
                            "' that does not have matching identity element " +
View Full Code Here

        for (Enumeration<Node> e = this.allNodes.elements(); e.hasMoreElements();) {

            final Node node = e.nextElement();

            for (Enumeration e2 = node.getIdentities(); e2.hasMoreElements();) {
                final Identity ident = (Identity) e2.nextElement();

                if (host != null) {
                    if (host.equals(ident.getHostname())) {
                        return node;
                    }
                } else {
                    if (ip.equals(ident.getIp())) {
                        return node;
                    }
                }
            }
        }
View Full Code Here

        requires.setData(datas);

        final Requires_TypeIdentity[] ids =
                new Requires_TypeIdentity[manifest.getIdentities().size()];
        for (int i = 0; i < ids.length; i++) {
            final Identity identity = manifest.getIdentities().get(i);

            ids[i] = new Requires_TypeIdentity(
                    identity.getHostname(),
                    identity.getIp(),
                    identity.getPubkey());
        }
        requires.setIdentity(ids);

        return requires;
    }
View Full Code Here

TOP

Related Classes of org.nimbustools.ctxbroker.Identity

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.