Package org.nimbustools.api.repr.vm

Examples of org.nimbustools.api.repr.vm.NIC


            return; // *** EARLY RETURN ***
        }

        final ArrayList nicnames = new ArrayList(nics.length);
        for (int i = 0; i < nics.length; i++) {
            final NIC nic = nics[i];
            final String name = nic.getName();
            if (nicnames.contains(name)) {
                throw new CreationException("You can not specify multiple " +
                        "NICs with the same name");
            }
            nicnames.add(name);
View Full Code Here


            return; // *** EARLY RETURN ***
        }

        for (int i = 0; i < nics.length; i++) {

            final NIC nic = nics[i];
            if (nic == null) {
                logger.error("null NIC in VirtualMachine");
                continue; // *** SKIP ***
            }

            final String method = nic.getAcquisitionMethod();
            if (method == null) {
                logger.error("null acquisition method in VirtualMachine");
                continue; // *** SKIP ***
            }

            if (!NIC.ACQUISITION_AllocateAndConfigure.equals(method)) {
                continue; // *** SKIP ***
            }

            final String name = nic.getNetworkName();
            final String ip = nic.getIpAddress();
            try {
                this.networkAdapter.retireEntry(name, ip, vmid);
            } catch (ManageException e) {
                if (logger.isDebugEnabled()) {
                    logger.error("problem retiring '" + name
View Full Code Here

    protected String localIPV4(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getLocalNIC(vm);
        if (nic != null) {
            final String ip = nic.getIpAddress();
            if (ip != null) {
                return ip.trim();
            }
        }
        return "";
View Full Code Here

    protected String publicIPV4(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getPublicNIC(vm);
        if (nic != null) {
            final String ip = nic.getIpAddress();
            if (ip != null) {
                return ip.trim();
            }
        }
        return "";
View Full Code Here

    protected String localHostname(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getLocalNIC(vm);
        if (nic != null) {
            final String hostname = nic.getHostname();
            if (hostname != null) {
                return hostname.trim();
            }
        }
        return "";
View Full Code Here

    protected String publicHostname(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {
       
        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getPublicNIC(vm);
        if (nic != null) {
            final String hostname = nic.getHostname();
            if (hostname != null) {
                return hostname.trim();
            }
        }
        return "";
View Full Code Here

        final NIC[] nics = vm.getNics();
        if (nics == null || nics.length == 0) {
            return null;
        }
        for (String netname : networkNames) {
            final NIC nic = getParticularNetworkNIC(netname, nics);
            if (nic != null) {
                return nic;
            }
        }
        return null;
View Full Code Here

        }

        final Nic_Type[] wsNics = new Nic_Type[nics.length];

        for (int i = 0; i < nics.length; i++) {
            final NIC nic = nics[i];

            final Nic_Type wsnic = new Nic_Type();
            wsnic.setName(nic.getName());
            wsnic.setMAC(nic.getMAC());
            wsnic.setAssociation(nic.getNetworkName());

            final IPConfig_Type ip = new IPConfig_Type();
            ip.setBroadcast(nic.getBroadcast());
            ip.setGateway(nic.getGateway());
            ip.setHostname(nic.getHostname());
            ip.setIpAddress(nic.getIpAddress());
            ip.setNetmask(nic.getNetmask());
            ip.setNetwork(nic.getNetwork());

            final IPConfig_TypeAcquisitionMethod method =
                    (IPConfig_TypeAcquisitionMethod)
                            acqMethodMap.get(nic.getAcquisitionMethod());
            if (method == null) {
                throw new CannotTranslateException(
                        "do not recognize acquisition method '" +
                                nic.getAcquisitionMethod() + "'");
            }
            ip.setAcquisitionMethod(method);

            wsnic.setIpConfig(ip);
            wsNics[i] = wsnic;
View Full Code Here

        String privateAssignedIp = null;
        String publicAssignedIp = null;

        for (int i = 0; i < nics.length; i++) {

            final NIC nic = nics[i];
            if (nic == null) {
                logger.error("Invalid Manager implementation, " +
                        "missing NIC in NICS array");
                continue; // *** GOTO NEXT VM ***
            }

            final String hostname = nic.getHostname();
            if (hostname == null) {
                logger.error("Invalid Manager implementation, " +
                    "missing hostname in NIC");
                continue; // *** GOTO NEXT VM ***
            }
            final String ipAddress = nic.getIpAddress();
            if (ipAddress == null) {
                logger.error("Invalid Manager implementation, " +
                    "missing IP address in NIC");
                continue; // *** GOTO NEXT VM ***
            }

            final String networkName = nic.getNetworkName();
            if (this.networks.isPublicNetwork(networkName)) {
                if (publicAssignedHostname != null) {
                    logger.warn("Can't understand real NICs from duplicate " +
                            "networks yet, treating second one as unknown NIC");
                } else {
View Full Code Here

TOP

Related Classes of org.nimbustools.api.repr.vm.NIC

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.