net.vattp.data
Class EARL

java.lang.Object
  |
  +--net.vattp.data.EARL

public class EARL
extends Object

Untamed: A parsed URI designating an E object. Created by parsing of a human-readible reference to an E-object. The human readable form is:

    cap://searchpath/vatID/swissStr[/expirationDate]
where

Note that base 64 is supported by BigIntegerSugar.toString64(BigInteger) and BigIntegerMakerSugar.fromString64(String).

Author:
Bill Frantz based on work by Eric Messick., Mark Miller (changed the date format and some comments)

Field Summary
private  long myExpiration
           
private  ConstList mySearchPath
           
private  String mySwissStr
           
private  String myURI
           
private  String myVatID
           
 
Constructor Summary
EARL(ConstList searchPath, String vatID, BigInteger swissNum, long expiration)
          Enabled: Construct an EARL given the components of the URI.
EARL(String uri)
          Enabled: Construct an EARL given the URI string.
 
Method Summary
 void __printOn(TextWriter out)
          Enabled: Since this corresponds to an E URI expression, print with angle brackets.
 long expiration()
          Enabled: Return the expiration date string for this EARL.
static String flattenSearchPath(ConstList path)
          Enabled:
private  void parseEARL(String uri)
          Parse a URI into its constituent elements, saving them as our own.
static ConstList parseSearchPath(String path)
          Enabled: Parse a (semicolon-separated) search path into its constituent elements
 ConstList searchPath()
          Enabled: Return the search path for this EARL.
 BigInteger swissNumber()
          Enabled: Return the swissStr for this EARL as a swissNumber.
 String swissStr()
          Enabled: Return the swissStr string for this EARL.
 String toString()
          Suppressed: Return the fully-composed URI string for this EARL.
 String vatID()
          Enabled: Return the vatID string for this EARL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myURI

private String myURI

mySearchPath

private ConstList mySearchPath

myVatID

private String myVatID

mySwissStr

private String mySwissStr

myExpiration

private long myExpiration
Constructor Detail

EARL

public EARL(ConstList searchPath,
            String vatID,
            BigInteger swissNum,
            long expiration)
     throws MalformedURLException
Enabled: Construct an EARL given the components of the URI.

Parameters:
searchPath - The search path, a list of domain names and/or IP addresses.
vatID - is the vatID for the object, a base-36 encoded public key fingerprint.
swissNum - is the swissNumber for the object.
expiration - is the registration expiration date. It is the difference, measured in milliseconds, between the expiration time and midnight, January 1, 1970 UTC (the epoch). A value equal to Long.MAX_VALUE will also be treated as infinite expiration.

EARL

public EARL(String uri)
     throws MalformedURLException
Enabled: Construct an EARL given the URI string.

Parameters:
uri - is an URI of the form:
     "cap://searchpath/vatID/swissStr[/expirationDate]".
 
See the class comment for an explanation of the fields of this format.
Method Detail

expiration

public long expiration()
Enabled: Return the expiration date string for this EARL. Infinite expiration is indicated as Long.MAX_VALUE.


flattenSearchPath

public static String flattenSearchPath(ConstList path)
Enabled:


swissStr

public String swissStr()
Enabled: Return the swissStr string for this EARL.


swissNumber

public BigInteger swissNumber()
Enabled: Return the swissStr for this EARL as a swissNumber.


parseEARL

private void parseEARL(String uri)
                throws MalformedURLException
Parse a URI into its constituent elements, saving them as our own.

Modified by MarkM so that it strips off any number of leading "cap:" prefixes, including zero, enabling it to accept URI bodies as well.

Parameters:
uri - The URI string to be parsed.
MalformedURLException

parseSearchPath

public static ConstList parseSearchPath(String path)
Enabled: Parse a (semicolon-separated) search path into its constituent elements

Parameters:
path - The search path to be parsed
Returns:
An array of Strings containing the elements of the search path

searchPath

public ConstList searchPath()
Enabled: Return the search path for this EARL.

Returns:
an array of strings, one element for each search path member

toString

public String toString()
Suppressed: Return the fully-composed URI string for this EARL.

Overrides:
toString in class Object
Returns:
a string representation of the object.

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled: Since this corresponds to an E URI expression, print with angle brackets.

IOException

vatID

public String vatID()
Enabled: Return the vatID string for this EARL.



comments?