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 boolean gaveFactory;
     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. Only one instance of AddressFactory is created, to control who is allowed to create Addresses.

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

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:
AddressFactory.newAddress(), CommSpaceElement.getAddress(), AddressFactory.newAddress(), RouteEntry.getPhysicalNext()





  Fields

· gaveFactory

Summary  |  Top
   private static boolean gaveFactory

Flag to indicate if the factory has been given out or not. Once the factory has been created, no more are created.

XXX this static is a global system property.


· protocolSpec

Summary  |  Top
   private final String protocolSpec

The physical protocol specification. This defines the method by which the addrssSpecification 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.


  Constructors

· Address

Summary  |  Top

   Address(int anAddress, 
           String protocolSpec, 
           String addressSpec) 

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

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



· Address

Summary  |  Top
   Address(Address other) 


  Methods

· getAddressFactory

Summary  |  Top
   public static synchronized AddressFactory getAddressFactory() 

First caller wins. The first caller of this method gets a handle on the AddressFactory. Subsequent callers get diddly. Weak-ass access control, thank you very much.

XXX implications of the 'static'-ness of this method?



· 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 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".

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