ajanta.naming
Class URN
java.lang.Object
|
+--ajanta.naming.URN
- All Implemented Interfaces:
- java.io.Serializable
- public class URN
- extends java.lang.Object
- implements java.io.Serializable
The Uniform Resource Name scheme is used for location idependent naming.
Syntax of URN is defined as RFC2141
::= "urn:" ":"
NID is Namespace Identifier
NSS is Namespace Specific String
::= '%" | "/" | "?" | "#"
Note: following two URN are lexically equivalent
URN:foo:a123,456
urn:FOO:a123,456
- See Also:
- Serialized Form
Constructor Summary |
URN(java.lang.String urn)
This constructor takes a string and parse it to fill the
URN structure |
Method Summary |
boolean |
equals(java.lang.Object obj)
Checks equiality of the passed object with this object. |
java.lang.String |
getCreationDomain()
Return the string representation of the creation domain. |
ajanta.naming.URN |
getCreationDomainURN()
Return the the creation domain. |
ajanta.naming.URN |
getNamingAuthority()
Returns the naming authoruty for this URN. |
java.lang.String |
getNID()
Return the NID part of the URN |
java.lang.String |
getNSS()
Return the NSS part of the URN |
int |
hashCode()
hashCode of the URN |
java.lang.String |
toString()
Returns a string representation of the URN |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
URN
public URN(java.lang.String urn)
throws MalformedURNException
- This constructor takes a string and parse it to fill the
URN structure
- Parameters:
urn
- - string representation of a URN
getNSS
public java.lang.String getNSS()
- Return the NSS part of the URN
- Returns:
- a string that represent the NSS( NameSpace Specific String)
getNID
public java.lang.String getNID()
- Return the NID part of the URN
- Returns:
- a string that represent the NID ( NameSpace Identifier)
getNamingAuthority
public ajanta.naming.URN getNamingAuthority()
- Returns the naming authoruty for this URN. Currently it is the
string before the last slash of the NSS
- Returns:
- the URN of its naming authority
getCreationDomain
public java.lang.String getCreationDomain()
- Return the string representation of the creation domain. In our URN, the first component
of the NSS is the creation domain
- Returns:
- the first componnent of NSS as creation domain, if there is only one component
the NSS is the creation domain
getCreationDomainURN
public ajanta.naming.URN getCreationDomainURN()
- Return the the creation domain. In our URN, the first component
of the NSS is the creation domain
- Returns:
- URN first componnent of NSS as creation domain, if there is only one component
the NSS is the creation domain
toString
public java.lang.String toString()
- Returns a string representation of the URN
- Overrides:
toString
in class java.lang.Object
- Returns:
- a string representation of the URN
equals
public boolean equals(java.lang.Object obj)
- Checks equiality of the passed object with this object. Note: the NID is case insensitive.
The following two URN are equivalent
URN:foo:a123,456
urn:FOO:a123,456
- Overrides:
equals
in class java.lang.Object
- Returns:
- true is equal
false otherwise
hashCode
public int hashCode()
- hashCode of the URN
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- int value of the hashCode of this URN