Package com.volantis.devrep.repository.impl

Examples of com.volantis.devrep.repository.impl.TACValue


        JDBCAccessorHelper.setStringValue(pstmt, 1, projectName);
        JDBCAccessorHelper.setStringValue(pstmt, 2, deviceName);

        Iterator it = tacs.iterator();
        while (it.hasNext()) {
          TACValue tac = (TACValue) it.next();
          pstmt.setLong(3, tac.getLongTAC());

          if (logger.isDebugEnabled()) {
            logger.debug("Inserting into "
                + resolvedDeviceTACsTableName
                + " NAME: " + deviceName
                + " TAC: " + tac.getLongTAC());
          }

          pstmt.executeUpdate();
        }
        // Close the statement and set it to null to prevent the finally clause
View Full Code Here


      Set tacs = null;
      if (rs.next()) {
        tacs = new HashSet();
        do {
          tacs.add(new TACValue(rs.getLong(1)));
        } while (rs.next());
      }

      DefaultDevice device =
          new DefaultDevice(deviceName, policies, getPolicyValueFactory());
View Full Code Here

        Set tacSet = new HashSet();
        while (numbers.hasNext()) {
            String number = (String) numbers.next();
            try {
                long tac = Long.parseLong(number);
                tacSet.add(new TACValue(tac));
            } catch (NumberFormatException nfe) {
                // Shouldn't get any of these since the schema
                // carries out validation - if we do, then ignore the
                // invalid TAC and log it as a warning.
                logger.warn("long-tac-conversion-error", new Object[]{
View Full Code Here

                cache = new HashMap();
                RepositoryEnumeration deviceTACPairs =
                        enumerateDeviceTACs(connection);
                while (deviceTACPairs.hasNext()) {
                    DeviceTACPair pair = (DeviceTACPair) deviceTACPairs.next();
                    cache.put(new TACValue(pair.getTAC()),
                              pair.getDeviceName());
                }
                tacCache = cache;
            } else {
                cache = tacCache;
View Full Code Here

        // The creation of a new TACValue object with each query could be
        // avoided by using a manual implementation of the cache (based on
        // a binary search, perhaps) but this implementation is clearer,
        // and more flexible in terms of expected future changes to the TAC
        // format.
        return (String) tacCacheLoc.get(new TACValue(tac));
    }
View Full Code Here

                        "Nokia-6210", nokia.getName());
                Set tacs = nokia.getTACValues();
                assertEquals("Nokia-6210 should have two TACs",
                        2, tacs.size());
                assertTrue("Nokia-6210 TACs should include 35061220",
                        tacs.contains(new TACValue(35061220)));
                assertTrue("Nokia-6210 TACs should include 350612",
                        tacs.contains(new TACValue(350612)));
            }
        });
    }
View Full Code Here

TOP

Related Classes of com.volantis.devrep.repository.impl.TACValue

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.