Search in sources :

Example 1 with DataBaseObject

use of com.xrtb.db.DataBaseObject in project XRTB by benmfaul.

the class Configuration method readBlackListIntoCache.

/**
	 * Reads the blacklist into cache2k when aerospike is not being used.
	 * 
	 * @param fname
	 *            String. The name of the blacklist.
	 * @throws Exception
	 *             on file I/O or cache2k errors.
	 */
private static void readBlackListIntoCache(String fname) throws Exception {
    String content = new String(Files.readAllBytes(Paths.get(fname)), StandardCharsets.UTF_8);
    System.out.println(content);
    List<String> list = DbTools.mapper.readValue(content, List.class);
    DataBaseObject shared = DataBaseObject.getInstance();
    shared.addToBlackList(list);
}
Also used : DataBaseObject(com.xrtb.db.DataBaseObject)

Aggregations

DataBaseObject (com.xrtb.db.DataBaseObject)1