org.jboss.identity.federation.core.saml.v2.util
Class XMLTimeUtil

java.lang.Object
  extended by org.jboss.identity.federation.core.saml.v2.util.XMLTimeUtil

public class XMLTimeUtil
extends java.lang.Object

Util class dealing with xml based time

Since:
Jan 6, 2009
Author:
Anil.Saldhana@redhat.com

Constructor Summary
XMLTimeUtil()
           
 
Method Summary
static javax.xml.datatype.XMLGregorianCalendar add(javax.xml.datatype.XMLGregorianCalendar value, long milis)
          Add additional time in miliseconds
static javax.xml.datatype.XMLGregorianCalendar getIssueInstant()
          Get the current instant of time
static javax.xml.datatype.XMLGregorianCalendar getIssueInstant(java.lang.String timezone)
          Returns a XMLGregorianCalendar in the timezone specified.
static long inMilis(int valueInMins)
          Convert the minutes into miliseconds
static boolean isValid(javax.xml.datatype.XMLGregorianCalendar now, javax.xml.datatype.XMLGregorianCalendar notbefore, javax.xml.datatype.XMLGregorianCalendar notOnOrAfter)
          Validate that the current time falls between the two boundaries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLTimeUtil

public XMLTimeUtil()
Method Detail

add

public static javax.xml.datatype.XMLGregorianCalendar add(javax.xml.datatype.XMLGregorianCalendar value,
                                                          long milis)
                                                   throws java.lang.Exception
Add additional time in miliseconds

Parameters:
value - calendar whose value needs to be updated
milis -
Returns:
calendar value with the addition
Throws:
java.lang.Exception

getIssueInstant

public static javax.xml.datatype.XMLGregorianCalendar getIssueInstant(java.lang.String timezone)
                                                               throws java.lang.Exception
Returns a XMLGregorianCalendar in the timezone specified. If the timezone is not valid, then the timezone falls back to "GMT"

Parameters:
timezone -
Returns:
Throws:
java.lang.Exception

getIssueInstant

public static javax.xml.datatype.XMLGregorianCalendar getIssueInstant()
                                                               throws java.lang.Exception
Get the current instant of time

Returns:
Throws:
java.lang.Exception

inMilis

public static long inMilis(int valueInMins)
Convert the minutes into miliseconds

Parameters:
valueInMins -
Returns:

isValid

public static boolean isValid(javax.xml.datatype.XMLGregorianCalendar now,
                              javax.xml.datatype.XMLGregorianCalendar notbefore,
                              javax.xml.datatype.XMLGregorianCalendar notOnOrAfter)
Validate that the current time falls between the two boundaries

Parameters:
now -
notbefore -
notOnOrAfter -
Returns:


Copyright © 2009 JBoss Inc.. All Rights Reserved.