agents.agent
Class TicketAgent

java.lang.Object
  |
  +--agents.agent.TicketAgent
All Implemented Interfaces:
ObjectStream

public class TicketAgent
extends java.lang.Object
implements ObjectStream

Class for management of the user ticket.


Field Summary
protected  java.lang.String passwd
           
 
Constructor Summary
TicketAgent()
          Method for creating a new instance of the class.
TicketAgent(java.lang.String passwd)
          Method for creating a new instance of the class.
 
Method Summary
static void decode(Message msg)
          Method for decoding the message (which is the ticket).
static Ticket decodeTicket(byte[] tic)
          Method for decoding the ticket with defaults password.
static byte[] encodeTicket(Ticket ticket)
          Method for encode the ticket with defaults password.
 Ticket generateTicket(Message msg)
          Method for generating ticket to login.
 java.lang.Object query(java.lang.Object msg1)
          Method for executing the request.
 void query(java.io.ObjectInput in, java.io.ObjectOutput out)
          Method for receiving the request and sending the response to the database servlet.
static void validateUserTicket(java.lang.String passwd, java.lang.String resource, java.lang.String username, byte[] userTicket)
          Method for validating the user ticket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

passwd

protected java.lang.String passwd
Constructor Detail

TicketAgent

public TicketAgent()
Method for creating a new instance of the class.

TicketAgent

public TicketAgent(java.lang.String passwd)
Method for creating a new instance of the class. The parameter password is used for crypt the ticket.
Method Detail

query

public void query(java.io.ObjectInput in,
                  java.io.ObjectOutput out)
           throws java.lang.Exception
Method for receiving the request and sending the response to the database servlet.
Specified by:
query in interface ObjectStream

query

public java.lang.Object query(java.lang.Object msg1)
                       throws java.lang.Exception
Method for executing the request.

generateTicket

public Ticket generateTicket(Message msg)
                      throws java.lang.Exception
Method for generating ticket to login.

decodeTicket

public static Ticket decodeTicket(byte[] tic)
                           throws java.io.IOException,
                                  java.lang.ClassNotFoundException
Method for decoding the ticket with defaults password.

encodeTicket

public static byte[] encodeTicket(Ticket ticket)
                           throws java.io.IOException
Method for encode the ticket with defaults password.

validateUserTicket

public static void validateUserTicket(java.lang.String passwd,
                                      java.lang.String resource,
                                      java.lang.String username,
                                      byte[] userTicket)
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException
Method for validating the user ticket.

decode

public static void decode(Message msg)
                   throws java.io.IOException,
                          java.lang.ClassNotFoundException
Method for decoding the message (which is the ticket). It decodes the ticket and verifies if the time is not expired.