org.apache.slide.common
Class Uri

java.lang.Object
  extended byorg.apache.slide.common.Uri
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ResourceId

public 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.19.2.1 $
See Also:
Serialized Form

Field Summary
protected  Namespace namespace
          Uri's namespace.
protected  Scope scope
          FIXME : Is that still used ?
protected  ScopeTokenizer scopes
          Scopes to which this Uri belongs.
protected  Store store
          Associated Store instance.
protected  SlideToken token
          Associated SlideToken.
protected  java.lang.String uri
          uri MUST be unique.
 
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.
static Uri getRoot(Uri uri)
          Method getRoot
 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.
 boolean isStoreRoot()
          Test whether this Uri is equivalent to its scope
 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
 

Field Detail

namespace

protected transient Namespace namespace
Uri's namespace.


uri

protected transient java.lang.String uri
uri MUST be unique.


scopes

protected transient ScopeTokenizer scopes
Scopes to which this Uri belongs.


scope

protected transient Scope scope
FIXME : Is that still used ?


store

protected transient Store store
Associated Store instance.


token

protected transient SlideToken token
Associated SlideToken.

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

getRoot

public static Uri getRoot(Uri uri)
Method getRoot

Parameters:
uri - an Uri
Returns:
an 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.


isStoreRoot

public boolean isStoreRoot()
Test whether this Uri is equivalent to its scope

Returns:
a boolean

toString

public java.lang.String toString()
String representation of the uri object.

Returns:
String

hashCode

public int hashCode()
Hash code.

Returns:
int hash code

equals

public boolean equals(java.lang.Object obj)
Tests equivalence of two Uris.

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