org.sapia.ubik.mcast
Class DomainName

java.lang.Object
  extended by org.sapia.ubik.mcast.DomainName
All Implemented Interfaces:
java.io.Serializable

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

Models a "domain name" that is expressed by a path. Allows to filter multicast events on a per-domain basis. Supports the notion of domain partition (where a domain can have subdomains - or partitions).

Partionning is expressed through a path notation, where the parent domain can "contain" subdomains (that necessarily include their parent's path).

This notion of containment is used to determine to which domain or partition in a domain a multicast event is destined. For example, an event that is multicast to domain "parent" will also be received by the following partitions "parent/partition1", "parent/partition2". Yet, the opposite would not be true: an event targeted at "parent/partition2" would not be received by the others - since the latter do not "contain" or "include" the former.

An instance of this class is created as follows:

 DomainName dn = DomainName.parse("domain/partition");
 
Specifying subdomains/partitions is not mandatory.

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
See Also:
Serialized Form

Field Summary
static char DELIM
           
 
Method Summary
 boolean contains(DomainName other)
          Returns true if this instance "contains" or "includes" the domain name passed in.
 boolean equals(java.lang.Object other)
          Compares this instance with another DomainName.
 java.lang.String get(int i)
          Returns the component whose index is given.
static DomainName parse(java.lang.String name)
          Creates an instance of this class out of the given name/path.
 int size()
          Returns the number of "components" in this instance's name.
 java.lang.String toString()
          Returns a string representation of this instance - or, more precisely, this instance's path representation, where subdomains/partitions are separated by '/' characters.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELIM

public static final char DELIM
See Also:
Constant Field Values
Method Detail

size

public int size()
Returns the number of "components" in this instance's name.

Returns:
the number of "components" in this instance's name.

get

public java.lang.String get(int i)
Returns the component whose index is given.

Parameters:
i - an index.
Returns:
a domain name component.

parse

public static DomainName parse(java.lang.String name)
Creates an instance of this class out of the given name/path.

Parameters:
a - domain name/path.
Returns:
a DomainName object.

contains

public boolean contains(DomainName other)
Returns true if this instance "contains" or "includes" the domain name passed in.

Parameters:
other - a DomainName.

equals

public boolean equals(java.lang.Object other)
Compares this instance with another DomainName.

Overrides:
equals in class java.lang.Object
Parameters:
an - Object.
Returns:
true if the passed in object is a DomainName instance and if it has the same domain name string as this instance's.

toString

public java.lang.String toString()
Returns a string representation of this instance - or, more precisely, this instance's path representation, where subdomains/partitions are separated by '/' characters.

Overrides:
toString in class java.lang.Object
Returns:
this instance's string representation.


Copyright © 2010 Sapia OSS. All Rights Reserved.