org.jasig.cas.util
Class DefaultUniqueTicketIdGenerator

java.lang.Object
  extended by org.jasig.cas.util.DefaultUniqueTicketIdGenerator
All Implemented Interfaces:
UniqueTicketIdGenerator

public final class DefaultUniqueTicketIdGenerator
extends java.lang.Object
implements UniqueTicketIdGenerator

Default implementation of UniqueTicketIdGenerator. Implementation utilizes a DefaultLongNumericGeneraor and a DefaultRandomStringGenerator to construct the ticket id.

Tickets are of the form [PREFIX]-[SEQUENCE NUMBER]-[RANDOM STRING]-[SUFFIX]

Since:
3.0
Version:
$Revision: 42053 $ $Date: 2007-06-10 09:17:55 -0400 (Sun, 10 Jun 2007) $
Author:
Scott Battaglia

Constructor Summary
DefaultUniqueTicketIdGenerator()
          Creates an instance of DefaultUniqueTicketIdGenerator with default values including a DefaultLongNumericGenerator with a starting value of 1.
DefaultUniqueTicketIdGenerator(int maxLength)
          Creates an instance of DefaultUniqueTicketIdGenerator with a specified maximum length for the random portion.
DefaultUniqueTicketIdGenerator(int maxLength, java.lang.String suffix)
          Creates an instance of DefaultUniqueTicketIdGenerator with a specified maximum length for the random portion.
DefaultUniqueTicketIdGenerator(java.lang.String suffix)
          Creates an instance of DefaultUniqueTicketIdGenerator with default values including a DefaultLongNumericGenerator with a starting value of 1.
 
Method Summary
 java.lang.String getNewTicketId(java.lang.String prefix)
          Return a new unique ticket id beginning with the prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUniqueTicketIdGenerator

public DefaultUniqueTicketIdGenerator()
Creates an instance of DefaultUniqueTicketIdGenerator with default values including a DefaultLongNumericGenerator with a starting value of 1.


DefaultUniqueTicketIdGenerator

public DefaultUniqueTicketIdGenerator(int maxLength)
Creates an instance of DefaultUniqueTicketIdGenerator with a specified maximum length for the random portion.

Parameters:
maxLength - the maximum length of the random string used to generate the id.

DefaultUniqueTicketIdGenerator

public DefaultUniqueTicketIdGenerator(java.lang.String suffix)
Creates an instance of DefaultUniqueTicketIdGenerator with default values including a DefaultLongNumericGenerator with a starting value of 1.

Parameters:
suffix - the value to append at the end of the unique id to ensure uniqueness across JVMs.

DefaultUniqueTicketIdGenerator

public DefaultUniqueTicketIdGenerator(int maxLength,
                                      java.lang.String suffix)
Creates an instance of DefaultUniqueTicketIdGenerator with a specified maximum length for the random portion.

Parameters:
maxLength - the maximum length of the random string used to generate the id.
suffix - the value to append at the end of the unique id to ensure uniqueness across JVMs.
Method Detail

getNewTicketId

public java.lang.String getNewTicketId(java.lang.String prefix)
Description copied from interface: UniqueTicketIdGenerator
Return a new unique ticket id beginning with the prefix.

Specified by:
getNewTicketId in interface UniqueTicketIdGenerator
Parameters:
prefix - The prefix we want attached to the ticket.
Returns:
the unique ticket id


Copyright © 2004-2010 Java Architectures Special Interest Group. All Rights Reserved.