org.apache.slide.common
Class Uri

java.lang.Object
  |
  +--org.apache.slide.common.Uri
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class Uri
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This class manages the unique identifier of an object which is manipulated by Slide.

Version:
$Revision: 1.7 $
Author:
Remy Maucherat
See Also:
Serialized Form

Constructor Summary
Uri(Namespace namespace, java.lang.String uri)
          Constructor.
Uri(SlideToken token, Namespace namespace, java.lang.String uri)
          Constructor.
 
Method Summary
 Uri cloneObject()
          Do a fast clone of the Uri object.
 boolean equals(java.lang.Object obj)
          Tests equivalence of two Uris.
 Namespace getNamespace()
          Return the namespace to which this Uri belongs.
 Uri getParentUri()
          Get the parent uri.
 java.lang.String getRelative()
          Get the relative path to the matched scope.
 Scope getScope()
          Scope accessor.
 java.util.Enumeration getScopes()
          Returns the scopes tokenized by the ScopeTokenizer associated with this Uri object.
 Store getStore()
          Store accessor.
 SlideToken getToken()
          Token accessor.
 int hashCode()
          Hash code.
 void invalidateServices()
          Invalidate the current Services and PK.
 boolean isParent(Uri uri)
          Tests if the given uri represents a parent object.
 void reconnectServices()
          Reconnect the Uri services.
 void setToken(SlideToken token)
          Token mutator.
 void setUri(java.lang.String uri)
          Uri mutator.
 java.lang.String toString()
          String representation of the uri object.
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Uri

public Uri(Namespace namespace,
           java.lang.String uri)
Constructor.
Parameters:
namespace - Namespace associated with this Uri
uri - Uri

Uri

public Uri(SlideToken token,
           Namespace namespace,
           java.lang.String uri)
Constructor.
Parameters:
token - Slide token
namespace - Namespace associated with this Uri
uri - Uri
Method Detail

setUri

public void setUri(java.lang.String uri)
Uri mutator.
Parameters:
uri - New uri

getScope

public Scope getScope()
Scope accessor.
Returns:
StringTokenizer

getScopes

public java.util.Enumeration getScopes()
Returns the scopes tokenized by the ScopeTokenizer associated with this Uri object.
Returns:
Enumeration

getStore

public Store getStore()
Store accessor.
Returns:
Store

getToken

public SlideToken getToken()
Token accessor.
Returns:
The SlideToken, or null if no token has been set (which is valid)

setToken

public void setToken(SlideToken token)
Token mutator.
Parameters:
token - New Slide token

getNamespace

public Namespace getNamespace()
Return the namespace to which this Uri belongs.
Returns:
Namespace

getParentUri

public Uri getParentUri()
Get the parent uri.
Returns:
Uri

invalidateServices

public void invalidateServices()
Invalidate the current Services and PK. Used if there are changes in the namespace at runtime.

reconnectServices

public void reconnectServices()
Reconnect the Uri services.

getRelative

public java.lang.String getRelative()
Get the relative path to the matched scope.

toString

public java.lang.String toString()
String representation of the uri object.
Overrides:
toString in class java.lang.Object
Returns:
String

hashCode

public int hashCode()
Hash code.
Overrides:
hashCode in class java.lang.Object
Returns:
int hash code

equals

public boolean equals(java.lang.Object obj)
Tests equivalence of two Uris.
Overrides:
equals in class java.lang.Object
Parameters:
obj - Object to test
Returns:
boolean

cloneObject

public Uri cloneObject()
Do a fast clone of the Uri object.

isParent

public boolean isParent(Uri uri)
Tests if the given uri represents a parent object.
Parameters:
uri - Uri to test
Returns:
boolean