Package org.joda.time

Examples of org.joda.time.DateTime.minusSeconds()


        callbackHandler.setConfirmationMethod(SAML2Constants.CONF_BEARER);
        callbackHandler.setIssuer(TEST_RSTR_ISSUER);
        callbackHandler.setSubjectName(TEST_USER);
        ConditionsBean cp = new ConditionsBean();
        DateTime currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(60);
        cp.setNotAfter(currentTime);
        currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(300);
        cp.setNotBefore(currentTime);
        cp.setAudienceURI(TEST_AUDIENCE);
View Full Code Here


        ConditionsBean cp = new ConditionsBean();
        DateTime currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(60);
        cp.setNotAfter(currentTime);
        currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(300);
        cp.setNotBefore(currentTime);
        cp.setAudienceURI(TEST_AUDIENCE);
        callbackHandler.setConditions(cp);
       
        SAMLParms samlParms = new SAMLParms();
View Full Code Here

        //Create the browser cookie
        final Cookie cookie = this.convertToCookie(portalCookie, this.portalCookieAlwaysSecure || request.isSecure());
       
        //Update the expiration date of the portal cookie stored in the DB if the update interval has passed
        final DateTime expires = portalCookie.getExpires();
        if (DateTime.now().minusMillis(this.maxAgeUpdateInterval).isAfter(expires.minusSeconds(this.maxAge))) {
            this.portletCookieDao.updatePortalCookieExpiration(portalCookie, cookie.getMaxAge());
           
            // Update expiration dates of portlet cookies stored in session
            removeExpiredPortletCookies(request);
        }
View Full Code Here

        callbackHandler.setConfirmationMethod(SAML2Constants.CONF_BEARER);
        callbackHandler.setIssuer(TEST_RSTR_ISSUER);
        callbackHandler.setSubjectName(TEST_USER);
        ConditionsBean cp = new ConditionsBean();
        DateTime currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(60);
        cp.setNotAfter(currentTime);
        currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(300);
        cp.setNotBefore(currentTime);
        cp.setAudienceURI(TEST_AUDIENCE);
View Full Code Here

        ConditionsBean cp = new ConditionsBean();
        DateTime currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(60);
        cp.setNotAfter(currentTime);
        currentTime = new DateTime();
        currentTime = currentTime.minusSeconds(300);
        cp.setNotBefore(currentTime);
        cp.setAudienceURI(TEST_AUDIENCE);
        callbackHandler.setConditions(cp);
       
        SAMLParms samlParms = new SAMLParms();
View Full Code Here

        Map<String, Long> timetable = getResetHashTimetable();
        DateTime current = new DateTime();

        //When //forced assume that time has passed
        timetable.remove(hashString);
        timetable.put(hashString, current.minusSeconds(PasswordReset.HASH_EXPIRE_TIME_MILLISEC +1000).getMillis());

        //Then
        assertThat(PasswordReset.isValidResetHash(hashString)).isFalse();
    }
View Full Code Here

    assertThat(service.search(new ActivityQuery()
      .setSince(t1.minusSeconds(5).toDate()),
      new QueryContext()).getHits()).hasSize(1);

    assertThat(service.search(new ActivityQuery()
      .setSince(t2.minusSeconds(5).toDate()),
      new QueryContext()).getHits()).hasSize(0);

    assertThat(service.search(new ActivityQuery()
      .setTo(t1.minusSeconds(5).toDate()),
      new QueryContext()).getHits()).hasSize(2);
View Full Code Here

    DateTime lastSeen = val.getLastSeen();
   
    DateTime now = new DateTime();
    DateTime before = now.minus(rateInMillis);
    //give it 15 seconds before it really should be up to date in the table
    before = before.minusSeconds(15);
   
    if(lastSeen.isBefore(before)) {
      return false;
    }
    return true;
View Full Code Here

  }

  @Test
  public void testTimeWithinOneMinute() {
    DateTime startDate = new DateTime();
    TaskRun mostRecentTaskRun = new TaskRun(startDate.minusSeconds(5).toDate(), startDate.toDate(), "", "", "", 1);
    String printLastRun = formatter.printLastRun(mostRecentTaskRun);
    assertEquals("0 minutes ago", printLastRun);
  }

}
View Full Code Here

    DateTime lastSeen = val.getLastSeen();
   
    DateTime now = new DateTime();
    DateTime before = now.minus(rateInMillis);
    //give it 15 seconds before it really should be up to date in the table
    before = before.minusSeconds(15);
   
    if(lastSeen.isBefore(before)) {
      return false;
    }
    return true;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.