public Class SSOTicket implements TicketGrantingTicket {
private final Date whenCreated = new Date();
private final Principal authenticatedUser;
private final ExpirationPolicy expPolicy;
private final ExpirationPolicyFactory expPolicyFactory;
public SSOTicket(Principal authenticatedUser,
ExpirationPolicy expPolicy,
ExpirationPolicyFactory expPolicyFactory) {
this.authenticatedUser = authenticatedUser;
this.expPolicy = expPolicy;
this.expPolicyFactory = expPolicyFactory;
}
public Principal getUser() {
return this.authenticatedUser;
}
public boolean isValid() {
return this.expPolicy.isValid();
}
public void expire() {
this.expPolicy.expire();
}
public TargettedTicket deriveTicket(URL target) {
return new TargettedTicketImpl(target, this, this.expPolicyFactory.buildPolicyInstance());
}
}
|