edu.vt.middleware.ed
Class Ticket

java.lang.Object
  extended by edu.vt.middleware.ed.AbstractNamedDataObject
      extended by edu.vt.middleware.ed.Ticket
All Implemented Interfaces:
DataObject, MutableDataObject, NamedDataObject, Persistable, Serializable, Comparable<NamedDataObject>

public class Ticket
extends AbstractNamedDataObject
implements Serializable

One-time-use security token implementation.

Version:
$Revision: 7971 $
Author:
Marvin S. Addison
See Also:
Serialized Form

Field Summary
static String FIND_BY_EXPIRATION_DATE
          Constant for named query
static String FIND_BY_ID
          Constant for named query
static String FIND_BY_PERSON_UID
          Constant for named query
static String FIND_BY_PERSON_UID_AND_TYPE
          Constant for named query
static String FIND_BY_UUID
          Constant for named query
private  Set<Person> people
          People associated with this ticket
private  Boolean processed
          Flag indicating whether or not this ticket has been processed
private static long serialVersionUID
          Serialization marker
private  TicketType ticketType
          Ticket type
private  String uuid
          Ticket identifier
 
Fields inherited from class edu.vt.middleware.ed.AbstractNamedDataObject
createdBy, creationDate, expirationDate, HASH_CODE_SEED, modificationDate, modifiedBy, uid
 
Constructor Summary
Ticket()
           
 
Method Summary
 ManagedSet<Person> getPeople()
          Gets an immutable set of people associated with this ticket.
private  Set<Person> getPeopleInternal()
          Gets the people associated with this ticket.
 Boolean getProcessed()
          Gets the value of the processed flag.
 TicketType getTicketType()
          Gets the ticket type.
 Long getUid()
          This returns the uid.
 String getUuid()
          Gets the unique string ID for this object.
 void init(IdGenerator generator)
          Initializes this ticket with a cryptographically unique ID that can be accessed by calling getUuid().
 Boolean isProcessed()
          Determines whether or not this ticket has been processed.
private  void setPeopleInternal(Set<Person> s)
          Sets the people associated with this ticket.
 void setProcessed(Boolean b)
          Gets the value of the processed flag.
 void setTicketType(TicketType type)
          Sets the ticket type.
private  void setUuid(String id)
          Sets the ticket unique string identifier.
 
Methods inherited from class edu.vt.middleware.ed.AbstractNamedDataObject
compareTo, getCreatedBy, getCreationDate, getExpirationDate, getModificationDate, getModifiedBy, setCreatedBy, setCreationDate, setExpirationDate, setModificationDate, setModifiedBy, setUid, toString, validateProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIND_BY_UUID

public static final String FIND_BY_UUID
Constant for named query

See Also:
Constant Field Values

FIND_BY_ID

public static final String FIND_BY_ID
Constant for named query

See Also:
Constant Field Values

FIND_BY_PERSON_UID

public static final String FIND_BY_PERSON_UID
Constant for named query

See Also:
Constant Field Values

FIND_BY_PERSON_UID_AND_TYPE

public static final String FIND_BY_PERSON_UID_AND_TYPE
Constant for named query

See Also:
Constant Field Values

FIND_BY_EXPIRATION_DATE

public static final String FIND_BY_EXPIRATION_DATE
Constant for named query

See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
Serialization marker

See Also:
Constant Field Values

uuid

private String uuid
Ticket identifier


processed

private Boolean processed
Flag indicating whether or not this ticket has been processed


ticketType

private TicketType ticketType
Ticket type


people

private Set<Person> people
People associated with this ticket

Constructor Detail

Ticket

public Ticket()
Method Detail

init

public void init(IdGenerator generator)
          throws IdGenerationException
Initializes this ticket with a cryptographically unique ID that can be accessed by calling getUuid(). Subsequent calls to this method have no effect.

Parameters:
generator - id generator used to generate secure random ticket identifier for this ticket.
Throws:
IdGenerationException - if id generation fails

getUid

public Long getUid()
This returns the uid.

Specified by:
getUid in interface DataObject
Overrides:
getUid in class AbstractNamedDataObject
Returns:
Long - uid

getUuid

public String getUuid()
Gets the unique string ID for this object.

Examples of unique IDs:

Specified by:
getUuid in interface NamedDataObject
Returns:
Unique ID string.

setUuid

private void setUuid(String id)
Sets the ticket unique string identifier.

Parameters:
id - Unique string identifier.

getProcessed

public Boolean getProcessed()
Gets the value of the processed flag.

Returns:
Processed flag value.

isProcessed

public Boolean isProcessed()
Determines whether or not this ticket has been processed.

Returns:
True if the ticket has been processed, false otherwise.

setProcessed

public void setProcessed(Boolean b)
Gets the value of the processed flag.

Parameters:
b - Processed flag value.

getTicketType

public TicketType getTicketType()
Gets the ticket type.

Returns:
Ticket type.

setTicketType

public void setTicketType(TicketType type)
Sets the ticket type.

Parameters:
type - Ticket type.

getPeopleInternal

private Set<Person> getPeopleInternal()
Gets the people associated with this ticket.

Returns:
People on this ticket.

setPeopleInternal

private void setPeopleInternal(Set<Person> s)
Sets the people associated with this ticket.

Parameters:
s - People on this ticket.

getPeople

public ManagedSet<Person> getPeople()
Gets an immutable set of people associated with this ticket.

Returns:
People on this ticket.


Copyright © 2008 Virginia Tech. All Rights Reserved.