nl.west.aaa
Class Message

java.lang.Object
  |
  +--nl.west.aaa.Message

public class Message
extends java.lang.Object

A AAA message. A Messages consists of a type and attributes. The attributes are stored in attributename-attributevalue pairs. A message should at least have the following attributes:

  • sid - session-id identifying the session this message belongs to. Replies are found by mathcing session-ids.
  • uid - user-id identifying the user of the session (or the user wishing authentication.

  • Field Summary
    static int ACCOUNTING_INDICATION
              The server requests that the client send accounting messages regarding specified (may be all) sessions currently active.
    static int ACCOUNTING_POLL
              The server requests that the client send accounting messages regarding specified (may be all) sessions currently active.
    static int ACCOUNTING_REPLY
              Server confirms receiving accounting data.
    static int ACCOUNTING_REQUEST
              Client has accounting data for server.
    static int AUTHENTICATION_ACCEPT
              Server accepts authentication of user based on sent data.
    static int AUTHENTICATION_CHALLENGE
              Server needs more data to complete authentication of user.
    static int AUTHENTICATION_REDO
              Server requests redo of athentication.
    static int AUTHENTICATION_REJECT
              Server rejects authentication of user based on sent data.
    static int AUTHENTICATION_REQUEST
              Client requests authentication of user.
    static int AUTHORISATION_ACCEPT
               
    static int AUTHORISATION_CHALLENGE
               
    static int AUTHORISATION_REDO
               
    static int AUTHORISATION_REJECT
               
    static int AUTHORISATION_REQUEST
               
     byte[] data
              The encoded encoded form of the message.
    static int MESSAGE_REJECT
              A reject is sent when a received message cannot be processed for any reason.
    static int MESSAGES_READY
              Thge client indicates that there are buffered messages waiting to be delivered.
    static int MESSAGES_REQUEST
              The server requests that all buffered messages be sent.
     Identifier receiver
              The receiver of this message.
     RecordFormat recordFormat
              Idicates the used RecordFormat to encode this message.
     Identifier sender
              The sender of the message.
     TransportProtocol transportProtocol
              Idicates the used TransportProtocol to send this message.
     
    Constructor Summary
      Message(int type, java.util.Hashtable attrs)
              Make a new message of the given type with the given attributes.
    protected Message(Message msg)
              Make a new message based on the given message.
     
    Method Summary
     Message forward(Identifier to)
              Make a new message to forward to the specified destination.
     java.lang.Object getAttribute(java.lang.String attname)
               
     java.util.Hashtable getAttributes()
               
     int getMessageType()
               
     boolean isReplyTo(Message msg)
              Checks if this message is a valid reply to the given message.
     Message reply(int type, java.util.Hashtable attrs)
              Make a reply to this message with given messageType and attributes.
     java.lang.String toString()
              Produces a string representation of the message for debug purposes.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    AUTHENTICATION_REQUEST

    public static final int AUTHENTICATION_REQUEST
    Client requests authentication of user.

    AUTHENTICATION_ACCEPT

    public static final int AUTHENTICATION_ACCEPT
    Server accepts authentication of user based on sent data.

    AUTHENTICATION_REJECT

    public static final int AUTHENTICATION_REJECT
    Server rejects authentication of user based on sent data.

    AUTHENTICATION_CHALLENGE

    public static final int AUTHENTICATION_CHALLENGE
    Server needs more data to complete authentication of user.

    AUTHENTICATION_REDO

    public static final int AUTHENTICATION_REDO
    Server requests redo of athentication. Client should respond with a request. Session may be suspended depending on attributes and settings.

    AUTHORISATION_REQUEST

    public static final int AUTHORISATION_REQUEST

    AUTHORISATION_ACCEPT

    public static final int AUTHORISATION_ACCEPT

    AUTHORISATION_REJECT

    public static final int AUTHORISATION_REJECT

    AUTHORISATION_CHALLENGE

    public static final int AUTHORISATION_CHALLENGE

    AUTHORISATION_REDO

    public static final int AUTHORISATION_REDO

    ACCOUNTING_REQUEST

    public static final int ACCOUNTING_REQUEST
    Client has accounting data for server.

    ACCOUNTING_REPLY

    public static final int ACCOUNTING_REPLY
    Server confirms receiving accounting data. This may be used to transmit a signature over the sent data.

    ACCOUNTING_POLL

    public static final int ACCOUNTING_POLL
    The server requests that the client send accounting messages regarding specified (may be all) sessions currently active.

    ACCOUNTING_INDICATION

    public static final int ACCOUNTING_INDICATION
    The server requests that the client send accounting messages regarding specified (may be all) sessions currently active.

    MESSAGES_REQUEST

    public static final int MESSAGES_REQUEST
    The server requests that all buffered messages be sent.

    MESSAGES_READY

    public static final int MESSAGES_READY
    Thge client indicates that there are buffered messages waiting to be delivered.

    MESSAGE_REJECT

    public static final int MESSAGE_REJECT
    A reject is sent when a received message cannot be processed for any reason.

    data

    public transient byte[] data
    The encoded encoded form of the message. This field may be null at any time.

    recordFormat

    public RecordFormat recordFormat
    Idicates the used RecordFormat to encode this message. This field may be null and is not part of the content of the Message.

    transportProtocol

    public TransportProtocol transportProtocol
    Idicates the used TransportProtocol to send this message. This field may be null and is not part of the content of the Message.

    sender

    public Identifier sender
    The sender of the message. This field may be null and is not part of the content of the Message.

    receiver

    public Identifier receiver
    The receiver of this message. This field may be null and is not part of the content of the Message.
    Constructor Detail

    Message

    public Message(int type,
                   java.util.Hashtable attrs)
    Make a new message of the given type with the given attributes.

    Message

    protected Message(Message msg)
    Make a new message based on the given message.
    Method Detail

    toString

    public java.lang.String toString()
    Produces a string representation of the message for debug purposes.
    Overrides:
    toString in class java.lang.Object

    isReplyTo

    public boolean isReplyTo(Message msg)
    Checks if this message is a valid reply to the given message. Subclasses could check signatures. This class compares session ids (sid attributes) and messagetypes.

    reply

    public Message reply(int type,
                         java.util.Hashtable attrs)
    Make a reply to this message with given messageType and attributes.

    forward

    public Message forward(Identifier to)
    Make a new message to forward to the specified destination. The attributes and messageType are not modified.

    getMessageType

    public int getMessageType()

    getAttribute

    public java.lang.Object getAttribute(java.lang.String attname)

    getAttributes

    public java.util.Hashtable getAttributes()



    Arthur <arthur@ch.twi.tudelft.nl> http://ch.twi.tudelft.nl/~arthur/
    2002-05-27