List of usage examples for java.util.concurrent TimeUnit DAYS
TimeUnit DAYS
To view the source code for java.util.concurrent TimeUnit DAYS.
Click Source Link
From source file:org.kuali.rice.kim.impl.role.RoleInternalServiceImpl.java
@Override public void principalInactivated(String principalId) { if (StringUtils.isBlank(principalId)) { throw new IllegalArgumentException("principalId is null or blank"); }/*w w w. j av a 2 s . c o m*/ long oneDayInMillis = TimeUnit.DAYS.toMillis(1); Timestamp yesterday = new Timestamp(System.currentTimeMillis() - oneDayInMillis); inactivatePrincipalRoleMemberships(principalId, yesterday); inactivatePrincipalGroupMemberships(principalId, yesterday); inactivatePrincipalDelegations(principalId, yesterday); inactivateApplicationRoleMemberships(principalId, yesterday); }
From source file:at.ac.univie.isc.asio.flock.FlockAssemblerTest.java
@Test public void should_use_default_values_if_config_empty() throws Exception { final FlockConfig result = make(Id.valueOf("test"), Payload.encodeUtf8("{}")); assertThat(result.getName(), equalTo(Id.valueOf("test"))); assertThat(result.getTimeout(), equalTo(Timeout.from(23, TimeUnit.DAYS))); assertThat(result.getIdentifier(), equalTo(URI.create("asio:///flock/"))); }
From source file:org.openrepose.core.services.ratelimit.cache.NextAvailableResponseTest.java
@Before public void setUp() throws Exception { ConfiguredRatelimit configLimit = mock(ConfiguredRatelimit.class); CachedRateLimit cachedLimit = mock(CachedRateLimit.class); expirationTime = new Date(System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1)).getTime(); when(cachedLimit.amount()).thenReturn(5); when(cachedLimit.maxAmount()).thenReturn(10); when(cachedLimit.getNextExpirationTime()).thenReturn(expirationTime); limitPair = Pair.of(configLimit, cachedLimit); nextAvailableResponse = new NextAvailableResponse(limitPair); }
From source file:cn.edu.zjnu.acm.judge.service.LoginlogServiceTest.java
@After public void tearDown() throws InterruptedException { executorService.shutdown();//from ww w . ja va 2 s. com executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); loginlogService.destory(); loginlogService.getExecutor().awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); }
From source file:edu.ucuenca.authorsdisambiguation.nwd.Cache.java
private Cache() { InputStream resourceAsStream = this.getClass().getResourceAsStream("/config.cnf"); String theString = null;//from w w w. j a va2s. c o m try { theString = IOUtils.toString(resourceAsStream, Charset.defaultCharset().toString()); } catch (IOException ex) { Logger.getLogger(Cache.class.getName()).log(Level.SEVERE, null, ex); } config = JSON.parse(theString).getAsObject(); db = DBMaker.fileDB(config.get("CacheFile").getAsString().value()).make(); create = db.hashMap("cache", Serializer.STRING, new SerializerCompressionWrapper(Serializer.STRING)) .expireAfterCreate(30, TimeUnit.DAYS).createOrOpen(); Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { public void run() { try { System.out.println("Killing "); Kill(); } catch (SQLException ex) { Logger.getLogger(Cache.class.getName()).log(Level.SEVERE, null, ex); } } })); }
From source file:org.nuxeo.ecm.core.redis.contribs.RedisBlockingQueue.java
@Override public Runnable take() throws InterruptedException { for (;;) {//from w ww . j a v a 2 s . co m Runnable r = poll(1, TimeUnit.DAYS); if (r != null) { return r; } } }
From source file:com.taotaosou.data.cachedata.BackCategoryCache.java
public void init() { reSetCategoryMap();/*from w w w .j av a 2s .c om*/ schThreadPool.scheduleAtFixedRate(new Runnable() { public void run() { logger.info("start update the category cache"); reSetCategoryMap(); } }, 1, 1, TimeUnit.DAYS); }
From source file:com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.java
static Module module() { return new CacheModule() { @Override/*from w ww. j a va2s . co m*/ protected void configure() { persist(REPO_SIZE_CACHE, Project.NameKey.class, AtomicLong.class).loader(Loader.class) .expireAfterWrite(1, TimeUnit.DAYS); bind(RepoSizeCache.class).to(MaxRepositorySizeQuota.class); } }; }
From source file:org.blocks4j.reconf.client.validation.ConfigurationRepositoryElementValidator.java
private static void checkUpdateFrequency(ConfigurationRepositoryElement arg, Map<String, String> errors) { if (arg.getRate() == null || arg.getRate() < 1) { errors.put("@ConfigurationRepository", msg.get("rate.error")); }// www .j a v a2 s .co m if (arg.getTimeUnit() == null || !EnumSet.of(TimeUnit.MINUTES, TimeUnit.HOURS, TimeUnit.DAYS).contains(arg.getTimeUnit())) { errors.put("@ConfigurationRepository", msg.get("timeUnit.null")); } }
From source file:se.uu.it.cs.recsys.ruleminer.config.CourseRecommenderRuleMinerSpringConfig.java
@Bean public CacheManager cacheManager() { SimpleCacheManager cacheManager = new SimpleCacheManager(); GuavaCache fpTreeCache = new GuavaCache("FPTrees", CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.DAYS).maximumSize(100).build()); GuavaCache fpPatternCache = new GuavaCache("FPPatterns", CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.DAYS).maximumSize(100).build()); cacheManager.setCaches(Stream.of(fpTreeCache, fpPatternCache).collect(Collectors.toList())); return cacheManager; }