org.objectweb.mobilitools.smi.api
Class Location

java.lang.Object
  |
  +--org.objectweb.mobilitools.smi.api.Location
All Implemented Interfaces:
java.io.Serializable

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

MobiliTools $Name: $, $Id: Location.java,v 1.1.1.1 2003/03/28 14:48:06 dillense Exp $

SMI locations are based on a special naming scheme, based on CORBA naming service (see COS naming URI in MAF specification): CosNaming:region_prefix/region_name/agency_prefix/agency_name e.g. CosNaming:MAF/my_region/agency/my_agency Default prefixes are defined in Constants class, and can be overridden by setting appropriate properties.

See Also:
Serialized Form

Constructor Summary
Location(java.lang.String location)
          Creates a new Location object from the provided location string.
Location(java.lang.String region, java.lang.String agency)
          Creates a new Location object from the provided region name and agency name.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getAgency()
           
 java.lang.String getCosNamingName()
           
 java.lang.String getRegion()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Location

public Location(java.lang.String region,
                java.lang.String agency)
Creates a new Location object from the provided region name and agency name.

Location

public Location(java.lang.String location)
         throws BadOperation
Creates a new Location object from the provided location string. String format should be: CosNaming:<region_prefix>/<region_name>/<agency_prefix>/<agency_name>, according to default prefixes defined in Constants class, or according to properties overriding these default prefixes.
Throws:
BadOperation - the provided string format is not recognized as a location.
See Also:
Constants
Method Detail

getRegion

public java.lang.String getRegion()
Returns:
region name for this location.

getAgency

public java.lang.String getAgency()
Returns:
agency name for this location.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

getCosNamingName

public java.lang.String getCosNamingName()
Returns:
location's mapping to a string'fied name in CORBA naming service.