Package org.globus.workspace.network

Examples of org.globus.workspace.network.AssociationEntry


                }
            }

        }

        final AssociationEntry entry =
                new AssociationEntry(ipaddress, mac, hostname,
                gateway, broadcast, subnetmask);
        entry.setExplicitMac(mac != null);
        return entry;

    }
View Full Code Here


        final List oldentries = oldassoc.getEntries();
        final List newentries = newassoc.getEntries();
        final Iterator oldEntriesIter = oldentries.iterator();
        while (oldEntriesIter.hasNext()) {
            final AssociationEntry oldentry =
                        (AssociationEntry) oldEntriesIter.next();

            boolean foundOldEntry = false;

            final Iterator newEntriesIter = newentries.iterator();
            while (newEntriesIter.hasNext()) {
                final AssociationEntry newentry =
                            (AssociationEntry) newEntriesIter.next();
                if (oldentry.getIpAddress().equals(newentry.getIpAddress())) {
                    foundOldEntry = true;
                    break;
                }
            }
View Full Code Here

        }

        final StringBuffer buf = new StringBuffer("Contents: ");
        final Iterator oldEntriesIter = oldentries.iterator();
        while (oldEntriesIter.hasNext()) {
            final AssociationEntry entry =
                    (AssociationEntry) oldEntriesIter.next();
            buf.append("ip '")
               .append(entry.getIpAddress())
               .append("' host '")
               .append(entry.getHostname())
               .append("' inuse? ")
               .append(entry.isInUse())
               .append("; ");
        }
        return buf.toString();
    }
View Full Code Here

            List<AssociationEntry> allEntries = new ArrayList<AssociationEntry>();
            for(Association assoc: assocs) {
                Iterator it = assoc.getEntries().iterator();
                while(it.hasNext()) {
                    AssociationEntry next = (AssociationEntry) it.next();
                    if(inUse == ALL_ENTRIES) {
                        allEntries.add(next);
                    }
                    else if(inUse == FREE_ENTRIES) {
                        if(!next.isInUse())
                            allEntries.add(next);
                    }
                    else if(inUse == USED_ENTRIES) {
                        if(next.isInUse())
                            allEntries.add(next);
                    }
                }
            }
View Full Code Here

                return null;

            List<AssociationEntry> entries = new ArrayList<AssociationEntry>();
            Iterator it = assoc.getEntries().iterator();
            while(it.hasNext()) {
                AssociationEntry next = (AssociationEntry) it.next();
                if(inUse == ALL_ENTRIES) {
                    entries.add(next);
                }
                else if(inUse == FREE_ENTRIES) {
                    if(!next.isInUse())
                        entries.add(next);
                }
                else if(inUse == USED_ENTRIES) {
                    if(next.isInUse())
                        entries.add(next);
                }
            }

            if (entries == null || entries.isEmpty())
View Full Code Here

            List entries = assoc.getEntries();
            Iterator innerIter = entries.iterator();
            while (innerIter.hasNext()) {
                buf = new StringBuffer();
                AssociationEntry entry = (AssociationEntry)innerIter.next();
                buf.append("INSERT INTO association_entries VALUES (");

                buf.append("'").
                    append(name).
                    append("'");

                // IP address must be present
                buf.append(", '").
                    append(entry.getIpAddress()).
                    append("'");

                if (entry.getMac() != null) {
                    // Prefix explicit MAC addresses so they can be detected on load
                    buf.append(", '").
                        append(entry.isExplicitMac() ? EXPLICIT_MAC_PREFIX : "").
                        append(entry.getMac()).
                        append("'");
                } else {
                    buf.append(", NULL");
                }

                if (entry.getHostname() != null) {
                    buf.append(", '").
                        append(entry.getHostname()).
                        append("'");
                } else {
                    buf.append(", NULL");
                }

                if (entry.getGateway() != null) {
                    buf.append(", '").
                        append(entry.getGateway()).
                        append("'");
                } else {
                    buf.append(", NULL");
                }

                if (entry.getBroadcast() != null) {
                    buf.append(", '").
                        append(entry.getBroadcast()).
                        append("'");
                } else {
                    buf.append(", NULL");
                }

                if (entry.getSubnetMask() != null) {
                    buf.append(", '").
                        append(entry.getSubnetMask()).
                        append("'");
                } else {
                    buf.append(", NULL");
                }

                if (entry.isInUse()) {
                    buf.append(", 1)");
                } else {
                    buf.append(", 0)");
                }
View Full Code Here

                pstmt2.setString(1, name);
                rs2 = pstmt2.executeQuery();

                ArrayList entries = new ArrayList();
                while (rs2.next()) {
                    AssociationEntry entry =
                                new AssociationEntry(rs2.getString(2),
                                                     rs2.getString(3),
                                                     rs2.getString(4),
                                                     rs2.getString(5),
                                                     rs2.getString(6),
                                                     rs2.getString(7));
                    entry.setInUse(rs2.getBoolean(8));

                    // Encoding that MAC is explicit in the MAC field itself.
                    // better to introduce a new field to schema?
                    String mac = entry.getMac();
                    if (mac.startsWith(AssociationPersistenceUtil.EXPLICIT_MAC_PREFIX)) {
                        mac = mac.substring(AssociationPersistenceUtil.EXPLICIT_MAC_PREFIX.length());
                        entry.setMac(mac);
                        entry.setExplicitMac(true);
                    }

                    entries.add(entry);
                }
                assoc.setEntries(entries);
View Full Code Here

TOP

Related Classes of org.globus.workspace.network.AssociationEntry

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.