public class Lifetime extends Object
This class represents a WS-Trust Lifetime
. It wraps the JAXB LifetimeType
and offer methods that
allows for
easy retrieval of the creation and expiration times as XMLGregorianCalendar
and GregorianCalendar
objects.
Constructor and Description |
---|
Lifetime(GregorianCalendar created,
GregorianCalendar expires)
Creates an instance of
Lifetime with the specified parameters. |
Lifetime(LifetimeType lifetime)
Creates a
Lifetime instance using the specified LifetimeType . |
Modifier and Type | Method and Description |
---|---|
XMLGregorianCalendar |
getCreated()
Obtains the creation time as a
XMLGregorianCalendar . |
GregorianCalendar |
getCreatedCalendar()
Obtains the creation time as a
GregorianCalendar . |
LifetimeType |
getDelegate()
Obtains a reference to the
LifetimeType delegate. |
XMLGregorianCalendar |
getExpires()
Obtains the expiration time as a
XMLGregorianCalendar . |
GregorianCalendar |
getExpiresCalendar()
Obtains the expiration time as a
GregorianCalendar . |
void |
setCreated(XMLGregorianCalendar created)
Sets the creation time.
|
void |
setCreatedCalendar(GregorianCalendar created)
Sets the creation time.
|
void |
setExpires(XMLGregorianCalendar expires)
Sets the expiration time.
|
void |
setExpiresCalendar(GregorianCalendar expires)
Sets the expiration time.
|
public Lifetime(GregorianCalendar created, GregorianCalendar expires)
Creates an instance of Lifetime
with the specified parameters.
created
- a GregorianCalendar
representing the token creation time.expires
- a GregorianCalendar
representing the token expiration time.public Lifetime(LifetimeType lifetime)
Creates a Lifetime
instance using the specified LifetimeType
.
lifetime
- a reference to the LifetimeType
instance that contains the information used in the
Lifetime
construction.public XMLGregorianCalendar getCreated()
Obtains the creation time as a XMLGregorianCalendar
.
XMLGregorianCalendar
that represents the creation time.public void setCreated(XMLGregorianCalendar created)
Sets the creation time.
created
- a reference to the XMLGregorianCalendar
that represents the creation time to be set.public GregorianCalendar getCreatedCalendar()
Obtains the creation time as a GregorianCalendar
.
GregorianCalendar
that represents the creation time.public void setCreatedCalendar(GregorianCalendar created)
Sets the creation time.
created
- a reference to the GregorianCalendar
that represents the creation time to be set.public XMLGregorianCalendar getExpires()
Obtains the expiration time as a XMLGregorianCalendar
.
XMLGregorianCalendar
that represents the expiration time.public void setExpires(XMLGregorianCalendar expires)
Sets the expiration time.
expires
- a reference to the XMLGregorianCalendar
that represents the expiration time.public GregorianCalendar getExpiresCalendar()
Obtains the expiration time as a GregorianCalendar
.
GregorianCalendar
that represents the expiration time.public void setExpiresCalendar(GregorianCalendar expires)
Sets the expiration time.
expires
- a reference to the GregorianCalendar
that represents the expiration time.public LifetimeType getDelegate()
Obtains a reference to the LifetimeType
delegate.
Copyright © 2019 JBoss by Red Hat. All rights reserved.