Package org.globus.workspace.network

Examples of org.globus.workspace.network.Association


    public String getNetworkPool(String pool, int inUse) throws RemoteException {
        try {
            Hashtable cAssociations = persistenceAdapter.currentAssociations();

            final Association assoc = (Association) cAssociations.get(pool);

            if (assoc == null)
                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);
                }
View Full Code Here


        final ArrayList inserts = new ArrayList();
        Iterator iter = associations.keySet().iterator();
        while (iter.hasNext()) {
            String name = (String) iter.next();
            Association assoc = (Association)associations.get(name);
            StringBuffer buf = new StringBuffer();
            buf.append("INSERT INTO associations VALUES ('").
                append(name).
                append("'");

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

            buf.append(", ").
                append(assoc.getFileTime()).
                append(")");

            inserts.add(buf.toString());

            if (assoc.getEntries() == null) {
                continue;
            }

            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 (");
View Full Code Here

            do {
                // rs was next'd above already
                String name = rs.getString(1);
                String dns = rs.getString(2);
                long fileTime = rs.getLong(3);
                Association assoc = new Association(dns);
                assoc.setFileTime(fileTime);

                pstmt2 = c.prepareStatement(SQL_SELECT_ASSOCIATION);
                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);
                assocs.put(name,assoc);
                if (this.dbTrace) {
                    logger.trace("found previously stored network '" +
                            name + "':\n" + assoc);
                }
View Full Code Here

TOP

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

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.