com.ibm.aglet
Class Ticket

java.lang.Object
  extended bycom.ibm.aglet.Ticket
All Implemented Interfaces:
java.io.Serializable

public class Ticket
extends java.lang.Object
implements java.io.Serializable

An agent who wants to trip somewhere, he has a ticket to there. A ticket denotes destination of the trip and way to trip.

See Also:
Serialized Form

Field Summary
private  java.lang.String _file
           
private  java.lang.String _host
           
private  int _port
           
private  java.lang.String _protocol
           
private  QoC _qoc
           
static java.lang.String ATP
           SCHEME = Protocol of agent transfer
private static int DEFAULTATPPORTNO
           
private static int DEFAULTHTTPPORTNO
           
private static int defaultPortNo
           
static java.lang.String DEFAULTSCHEME
          Scheme Name : default scheme name.
static java.lang.String HTTP
          Scheme Name : Hyper Text Transfer Protocol HTTP is defined by World Wide Web Consortium.
static java.lang.String IIOP
          Scheme Name : Internet Interoperable Object Reference IIOP is defined by OMG.
static java.lang.String RMI
          Scheme Name : Remote Method Invocation
 
Constructor Summary
Ticket(java.lang.String host)
          Constructor with desitnation address of the trip.
Ticket(java.lang.String destination, QoC qoc)
          Constructor with desitnation address of the trip.
Ticket(java.lang.String host, QoC qoc, java.lang.String scheme, int portNo)
          Constructor with desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.
Ticket(java.net.URL address)
          Constructor with desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.
Ticket(java.net.URL address, QoC qoc)
          Constructor with desitnation address of the trip and quality of aglet cummunication in the trip.
 
Method Summary
static int getDefaultPort()
          Get default port number for connection.
 java.net.URL getDestination()
          Get destination to where the aglet wants to trip.
private  java.lang.String getDestinationString()
          Returns a string representation of the destination.
 java.lang.String getFile()
          Get specified file.
 java.lang.String getHost()
          Get specified host.
 int getPort()
          Get specified port.
 java.lang.String getProtocol()
          Get specified protocol.
 QoC getQoC()
          Get quality of aglet communication.
 boolean isDefaultPort()
          Returns whether prot number is default.
static void main(java.lang.String[] args)
           
private  void set(java.lang.String address, QoC qoc)
          Set desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.
private  void set(java.lang.String address, QoC qoc, java.lang.String scheme, int portNo)
          Set desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.
private  void set(java.net.URL address, QoC qoc)
          Set desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.
static void setDefaultPort(int portNo)
          Set default port number for connection.
 void setDestination(java.lang.String urlstr)
          Set destination to where the aglet wants to trip.
 void setDestination(java.lang.String address, java.lang.String scheme, int portNo)
          Set destination to where the aglet wants to trip.
 void setDestination(java.net.URL destination)
          Set destination to where the aglet wants to trip.
 void setQoC(QoC qoc)
          Set quality of aglet communication.
 java.lang.String toString()
          Returns a string representation of the ticket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATP

public static final java.lang.String ATP
 SCHEME = Protocol of agent transfer
 
Scheme Name : Agent Transfer Protocol.

See Also:
Constant Field Values

HTTP

public static final java.lang.String HTTP
Scheme Name : Hyper Text Transfer Protocol HTTP is defined by World Wide Web Consortium.

See Also:
Constant Field Values

RMI

public static final java.lang.String RMI
Scheme Name : Remote Method Invocation

See Also:
Constant Field Values

IIOP

public static final java.lang.String IIOP
Scheme Name : Internet Interoperable Object Reference IIOP is defined by OMG.

See Also:
Constant Field Values

DEFAULTSCHEME

public static final java.lang.String DEFAULTSCHEME
Scheme Name : default scheme name.

See Also:
Constant Field Values

_protocol

private java.lang.String _protocol

_host

private java.lang.String _host

_file

private java.lang.String _file

_port

private int _port

_qoc

private QoC _qoc

DEFAULTATPPORTNO

private static final int DEFAULTATPPORTNO
See Also:
Constant Field Values

DEFAULTHTTPPORTNO

private static final int DEFAULTHTTPPORTNO
See Also:
Constant Field Values

defaultPortNo

private static int defaultPortNo
Constructor Detail

Ticket

public Ticket(java.lang.String host)
       throws java.net.MalformedURLException
Constructor with desitnation address of the trip. The quality of communication for the trip is null. The scheme name is default("atp"). The port number is default.

Parameters:
host - destination host of the trip
Throws:
java.net.MalformedURLException

Ticket

public Ticket(java.lang.String destination,
              QoC qoc)
       throws java.net.MalformedURLException
Constructor with desitnation address of the trip. The quality of communication for the trip is null. The scheme name is default("atp"). The port number is default.

Parameters:
qoc - quality of communication for the trip
Throws:
java.net.MalformedURLException
See Also:
QoC

Ticket

public Ticket(java.lang.String host,
              QoC qoc,
              java.lang.String scheme,
              int portNo)
       throws java.net.MalformedURLException
Constructor with desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.

Parameters:
host - destination host of the trip
qoc - quality of communication for the trip
scheme - scheme name of communication
portNo - number of the connection
Throws:
java.net.MalformedURLException
See Also:
QoC

Ticket

public Ticket(java.net.URL address)
Constructor with desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.

Parameters:
address - destination of the trip
See Also:
QoC

Ticket

public Ticket(java.net.URL address,
              QoC qoc)
Constructor with desitnation address of the trip and quality of aglet cummunication in the trip.

Parameters:
address - destination of the trip
qoc - quality of communication for the trip
See Also:
QoC
Method Detail

getDefaultPort

public static int getDefaultPort()
Get default port number for connection.

Returns:
default port number of the connection

getDestination

public java.net.URL getDestination()
Get destination to where the aglet wants to trip.

Returns:
destination of the trip

getDestinationString

private java.lang.String getDestinationString()
Returns a string representation of the destination.

Returns:
a string representation of the destination
See Also:
Object.toString()

getFile

public java.lang.String getFile()
Get specified file.

Returns:
specified file

getHost

public java.lang.String getHost()
Get specified host.

Returns:
specified host

getPort

public int getPort()
Get specified port.

Returns:
specified port

getProtocol

public java.lang.String getProtocol()
Get specified protocol.

Returns:
specified protocol

getQoC

public QoC getQoC()
Get quality of aglet communication.

Returns:
quality of aglet communication in the trip

isDefaultPort

public boolean isDefaultPort()
Returns whether prot number is default.


main

public static void main(java.lang.String[] args)

set

private void set(java.lang.String address,
                 QoC qoc)
          throws java.net.MalformedURLException
Set desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.

Parameters:
address - destination of the trip
qoc - quality of communication for the trip
Throws:
java.net.MalformedURLException
See Also:
QoC

set

private void set(java.lang.String address,
                 QoC qoc,
                 java.lang.String scheme,
                 int portNo)
          throws java.net.MalformedURLException
Set desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.

Parameters:
address - destination of the trip
qoc - quality of communication for the trip
scheme - scheme name of communication
portNo - number of the connection
Throws:
java.net.MalformedURLException
See Also:
QoC

set

private void set(java.net.URL address,
                 QoC qoc)
Set desitnation address of the trip, quality of aglet cummunication in the trip and port number of the connection.

Parameters:
address - destination of the trip
qoc - quality of communication for the trip
See Also:
QoC

setDefaultPort

public static void setDefaultPort(int portNo)
Set default port number for connection.

Parameters:
portNo - default port number of the connection

setDestination

public void setDestination(java.lang.String urlstr)
                    throws java.net.MalformedURLException
Set destination to where the aglet wants to trip.

Parameters:
urlstr - destination of the trip
Throws:
java.net.MalformedURLException

setDestination

public void setDestination(java.lang.String address,
                           java.lang.String scheme,
                           int portNo)
                    throws java.net.MalformedURLException
Set destination to where the aglet wants to trip.

Parameters:
address - destination of the trip
scheme - scheme name of communication
portNo - number of the connection
Throws:
java.net.MalformedURLException

setDestination

public void setDestination(java.net.URL destination)
Set destination to where the aglet wants to trip.

Parameters:
destination - destination of the trip

setQoC

public void setQoC(QoC qoc)
Set quality of aglet communication.

Parameters:
qoc - quality of aglet communication in the trip
See Also:
QoC

toString

public java.lang.String toString()
Returns a string representation of the ticket.

Returns:
a string representation of the ticket
See Also:
Object.toString()