org.jasig.cas.client.validation
Class AssertionImpl

java.lang.Object
  extended by org.jasig.cas.client.validation.AssertionImpl
All Implemented Interfaces:
Serializable, Assertion

public final class AssertionImpl
extends Object
implements Assertion

Concrete Implementation of the Assertion.

Since:
3.1
Version:
$Revision$ $Date$
Author:
Scott Battaglia
See Also:
Serialized Form

Constructor Summary
AssertionImpl(AttributePrincipal principal)
          Creates a new Assertion with the supplied Principal.
AssertionImpl(AttributePrincipal principal, Date validFromDate, Date validUntilDate, Date authenticationDate, Map<String,Object> attributes)
          Creates a new Assertion with the supplied principal, Assertion attributes, and start and valid until dates.
AssertionImpl(AttributePrincipal principal, Map<String,Object> attributes)
          Create a new Assertion with the supplied principal and Assertion attributes.
AssertionImpl(String name)
          Constructs a new Assertion with a Principal of the supplied name, a valid from date of now, no valid until date, and no attributes.
 
Method Summary
 Map<String,Object> getAttributes()
          The key/value pairs associated with this assertion.
 Date getAuthenticationDate()
          The date the authentication actually occurred on.
 AttributePrincipal getPrincipal()
          The principal for which this assertion is valid.
 Date getValidFromDate()
          The date from which the assertion is valid from.
 Date getValidUntilDate()
          The date which the assertion is valid until.
 boolean isValid()
          Determines whether an Assertion is considered usable or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssertionImpl

public AssertionImpl(String name)
Constructs a new Assertion with a Principal of the supplied name, a valid from date of now, no valid until date, and no attributes.

Parameters:
name - the name of the principal for which this assertion is valid.

AssertionImpl

public AssertionImpl(AttributePrincipal principal)
Creates a new Assertion with the supplied Principal.

Parameters:
principal - the Principal to associate with the Assertion.

AssertionImpl

public AssertionImpl(AttributePrincipal principal,
                     Map<String,Object> attributes)
Create a new Assertion with the supplied principal and Assertion attributes.

Parameters:
principal - the Principal to associate with the Assertion.
attributes - the key/value pairs for this attribute.

AssertionImpl

public AssertionImpl(AttributePrincipal principal,
                     Date validFromDate,
                     Date validUntilDate,
                     Date authenticationDate,
                     Map<String,Object> attributes)
Creates a new Assertion with the supplied principal, Assertion attributes, and start and valid until dates.

Parameters:
principal - the Principal to associate with the Assertion.
validFromDate - when the assertion is valid from.
validUntilDate - when the assertion is valid to.
attributes - the key/value pairs for this attribute.
Method Detail

getAuthenticationDate

public Date getAuthenticationDate()
Description copied from interface: Assertion
The date the authentication actually occurred on. If its unable to be determined, it should be set to the current time.

Specified by:
getAuthenticationDate in interface Assertion
Returns:
the authentication date, or the current time if it can't be determined.

getValidFromDate

public Date getValidFromDate()
Description copied from interface: Assertion
The date from which the assertion is valid from.

Specified by:
getValidFromDate in interface Assertion
Returns:
the valid from date.

getValidUntilDate

public Date getValidUntilDate()
Description copied from interface: Assertion
The date which the assertion is valid until.

Specified by:
getValidUntilDate in interface Assertion
Returns:
the valid until date.

getAttributes

public Map<String,Object> getAttributes()
Description copied from interface: Assertion
The key/value pairs associated with this assertion.

Specified by:
getAttributes in interface Assertion
Returns:
the map of attributes.

getPrincipal

public AttributePrincipal getPrincipal()
Description copied from interface: Assertion
The principal for which this assertion is valid.

Specified by:
getPrincipal in interface Assertion
Returns:
the principal.

isValid

public boolean isValid()
Description copied from interface: Assertion
Determines whether an Assertion is considered usable or not. A naive implementation may just check the date validity.

Specified by:
isValid in interface Assertion
Returns:
true if its valid, false otherwise.


Copyright © 2006-2015 Jasig. All Rights Reserved.