public void pruneEvents() { try { if (runningPruner.compareAndSet(false, true)) { LocalDateTime now = DateUtils.currentLocalDateTime(); List<Account> accounts = appContext.getAccountStore().getAll(); List<Domain> domains = appContext.getDomainStore().getAll(); for (Domain domain : domains) { pruneEvents(now, domain); } } } catch (Exception ex) { ex.printStackTrace(); } finally { runningPruner.set(false); } }
public Account(CreateAccountAction action) { this.accountId = CpIdGenerator.newId(); this.createdAt = DateUtils.currentLocalDateTime(); validatePasswords(action.getPassword(), action.getPasswordConfirmed()); this.password = action.getPassword(); this.firstName = action.getFirstName(); this.lastName = action.getLastName(); this.emailAddress = action.getEmailAddress(); this.emailConfirmed = false; this.emailConfirmationCode = String.valueOf(System.currentTimeMillis()); this.emailConfirmationCode = emailConfirmationCode.substring(emailConfirmationCode.length()-5); }
@Override public PushResponse send(Push push) { this.lastPush = push; return new PushResponse( "mock:"+TimeUuid.randomUUID().toString(), "mock:"+TimeUuid.randomUUID().toString(), DateUtils.currentLocalDateTime(), RequestStatus.pending, Collections.<String>emptyList() ); }
public PushRequest(int apiVersion, Domain domain, Push push) { this.pushRequestId = CpIdGenerator.newId(); this.revision = null; this.apiVersion = apiVersion; this.domainId = domain.getDomainId(); this.domainKey = domain.getDomainKey(); this.createdAt = DateUtils.currentLocalDateTime(); this.requestStatus = RequestStatus.pending; this.remoteHost = push.getRemoteHost(); this.remoteAddress = push.getRemoteAddress(); this.pushType = push.getPushType(); this.push = push; }