protected void validateCurrentTimeBetweenSinceUntil(FactoryDto factory) throws BadRequestException {
  final PoliciesDto policies=factory.getPolicies();
  if (policies == null) {
    return;
  }
  final Long since=policies.getSince() == null ? 0L : policies.getSince();
  final Long until=policies.getUntil() == null ? 0L : policies.getUntil();
  if (since != 0 && currentTimeMillis() < since) {
    throw new BadRequestException(FactoryConstants.ILLEGAL_FACTORY_BY_SINCE_MESSAGE);
  }
  if (until != 0 && currentTimeMillis() > until) {
    throw new BadRequestException(FactoryConstants.ILLEGAL_FACTORY_BY_UNTIL_MESSAGE);
  }
}

protected void validateCurrentTimeBetweenSinceUntil ( FactoryDto factory ) throws BadRequestException { final PoliciesDto policies = factory . getPolicies ( ) ; if ( policies == null ) { return ; } final Long since = policies . getSince ( ) == null ? 0L : policies . getSince ( ) ; final Long until = policies . getUntil ( ) == null ? 0L : policies . getUntil ( ) ; if ( since != 0 && currentTimeMillis ( ) < since ) { throw new BadRequestException ( FactoryConstants . ILLEGAL_FACTORY_BY_SINCE_MESSAGE ) ; } if ( until != 0 && currentTimeMillis ( ) > until ) { throw new BadRequestException ( FactoryConstants . ILLEGAL_FACTORY_BY_UNTIL_MESSAGE ) ; } }
validates that factory can be used at present time ( used on accept )
