All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.nodeos.Address
java.lang.Object
   |
   +----edu.utah.janos.nodeos.Address

  Summary

public class  Address
     extends java.lang.Object
{
          // Fields 4
     private final String addressSpec;
     private final int anAddress;
     private static final AddressFactory globalFactory;
     private final String protocolSpec;

          // Constructors 2
     Address(Address);
     Address(int, String, String);

          // Methods 7
     public static int fromString(String) throws AddressFormatException;
     public static synchronized AddressFactory getAddressFactory();
     public static String toString(int);

     public int getANAddress();
     public String getAddressSpec();
     public String getProtocolSpec();
     public String toString();
}

An address object hides the details and implementation of addressing in Janos. Addresses can only be created through an AddressFactory.

An Address has two parts a logical "active network" address and an underlying "physical address". The physical address in this implementation of Address is the combination of a protocol specification and an address specification; This is similar to what is described in the NodeOS specification for addressing.

The "active address" is a 32-bit IP-like number.

Address objects are immutable. They must be immutable because anyone(?) can read them out of routing tables...

Author:
Janos Ministry of Development


  Cross Reference

Returned By:
PrimordialNode.nextPhysicalToNode(), AddressFactory.newAddress(), CommSpaceElement.getAddress(), AddressFactory.newAddress(), RouteEntry.getPhysicalNext()





  Fields

· protocolSpec

Summary  |  Top
   private final String protocolSpec

The physical protocol specification. This defines the context in which the addressSpec is interpreted.

See Also: addressSpec


· addressSpec

Summary  |  Top
   private final String addressSpec

The physical address specification.

See Also: protocolSpec


· anAddress

Summary  |  Top
   private final int anAddress

The logical level address that maps to the underlying physical address.

XXX This is somewhat ANTSR specific, as it assumes a logical address is a 32-bit integer.


· globalFactory

Summary  |  Top
   private static final AddressFactory globalFactory

The global address factory.


  Constructors

· Address

Summary  |  Top

   Address(int anAddress, 
           String protocolSpec, 
           String addressSpec) 

Construct a new Address. The address has two parts: an "active address" and a "physical address". The "active address" is a 32-bit integer. The "physical address" consists of the protocol spec and its associated address spec.

Parameter Description
anAddress The virtual active net address
protocolSpec The protocol specification for the `physical' connection
addressSpec The address specification for the protocol



· Address

Summary  |  Top
   Address(Address other) 

Construct an new address from the given Address.



  Methods

· getAddressFactory

Summary  |  Top
   public static synchronized AddressFactory getAddressFactory() 

Get the global AddressFactory. Note that access to the AddressFactory should only be given to trusted code.



· getANAddress

Summary  |  Top
   public int getANAddress() 


· getProtocolSpec

Summary  |  Top
   public String getProtocolSpec() 


· getAddressSpec

Summary  |  Top
   public String getAddressSpec() 


· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


· toString

Summary  |  Top
   public static String toString(int a) 

Generate a string representation of the given 32-bit integer address. Generates standard dotted-quad notation.



· fromString

Summary  |  Top
   public static int fromString(String name)  throws AddressFormatException

Generate a 32-bit integer from the given string address. The string must be a dotted-quad, e.g. "192.168.1.2".

Parameter Description
name A dotted-quad string address

Returns:
the 32-bit integer represented by name
Throws: AddressFormatException
if there aren't 4 parts, any of the 4 parts don't parse, or are out of range.


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7