SAP NetWeaver '04

com.sap.netweaver.bc.rf.common
Interface IRid

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.common_api.jar]
All Known Implementing Classes:
Rid

public interface IRid

A Rid is an identifier for a CM resource. It holds all information to identify a CM resource and retrieve it via the CM Framework. Each CM resource has its unique Rid. The first pathsegment must be a valid name of a repository (prefix).

A Rid has a path-like structure, like a path in a file system and follows the following production:

   Rid         ::= '/' pathsegment | '/' pathsegment '?' query
   pathsegment ::= name | name '/' pathsegment | empty
   name        ::= any char except '/'
   query       ::= parameter | parameter '&' query | empty
   parameter   ::= varname | varname '=' value
   varname         ::= any char except '=', '&'   value       ::= any
 character except '&'
 
Equality is defined as ignoring trailing '/' characters. Thus, the Rids "/docs/" and /docs" are considered equal. There is special handling for the root collection "/", which is not equal to the empty Rid "".

Copyright (c) SAP AG 2001-2003


Method Summary
 IRid add(IRid uri)
          Concatenate this Rid with the given Rid.
 IRid add(java.lang.String uri)
          Concatenate this Rid with the given Rid.
 IRid addPathSegment(java.lang.String segment)
          Adds a path segment.
 boolean endsWithSlash()
          Return if this Rid ends with a slash.
 java.lang.String extension()
          Get the extension part of the resource name.
 java.lang.String getPath()
          Return the path component of this Rid.
 java.lang.String getQuery()
          Return the query component of this Rid (null if it does not exist).
 java.util.Properties getQueryParameter()
          Get the query parameters of the Rid.
 boolean isAbsolute()
          Return if Rid is absolute, e.g. start with a slash.
 boolean isAncestorOf(IRid child)
          Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid.
 boolean isAncestorOfOrSelf(IRid child)
          Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid or the same.
 boolean isRoot()
          Return if Rid is root collection.
 int length()
          Return length of Rid in string representation
 IRid name()
          Get the name of the resource, designated by this Rid.
 IRid parent()
          Get the Rid of the parent collection of this Rid
 IRid removeExtension()
          Remove the (optional) extension of the resource name.
 IRid removeName()
          Remove the name of the resource, same as parent()
 IRid removeRoot()
          Get a new Rid with the toplevel collection removed
 IRid removeTrailingSlash()
          Remove a possible trailing slash from the Rid.
 IRid resolveRelativeRid(java.lang.String uri)
          Resolve relative Rids
 IRid root()
          Get Rid of toplevel collection (below root) of this Rid.
 IRid setQueryParameter(java.util.Properties parameter)
          Create a new Rid by setting the given parameters as query part of this Rid.
 java.util.List split()
          Splits the Rid into its path components
 java.lang.String toExternalForm()
          Convert this Rid to a representation usable in RFC2396 URI references.
 

Method Detail

toExternalForm

public java.lang.String toExternalForm()
Convert this Rid to a representation usable in RFC2396 URI references. Non-ASCII and reserved characters are encoded.

Note that such an encoded string cannot be used to construct an new Rid object! The path in Rid objects is never, ever encoded.

Returns:
Rid suitable escaped as RFC2396 URI reference

getPath

public java.lang.String getPath()
Return the path component of this Rid.
Returns:
the path component

getQuery

public java.lang.String getQuery()
Return the query component of this Rid (null if it does not exist).
Returns:
the query component

getQueryParameter

public java.util.Properties getQueryParameter()
Get the query parameters of the Rid. Will return an empty Properties object if Rid has no query part. Modifying the Properties object has no effect on the Rid itself.
Returns:
query parameters as Properties

root

public IRid root()
Get Rid of toplevel collection (below root) of this Rid.

The root Rid of a toplevel collection is the root collection Rid. The root Rid of the root Rid is the root Rid itself.

Returns:
Rid of toplevel collection below root

name

public IRid name()
Get the name of the resource, designated by this Rid. If the Rid has query parameter, these are discarded.
Returns:
the name of the resource, designated by this Rid

parent

public IRid parent()
Get the Rid of the parent collection of this Rid
Returns:
the Rid of the parent collection

extension

public java.lang.String extension()
Get the extension part of the resource name. Returns the empty string if there is no extension.
Returns:
the extension part of the resource name

removeRoot

public IRid removeRoot()
Get a new Rid with the toplevel collection removed
Returns:
Rid with toplevel collection removed

removeName

public IRid removeName()
Remove the name of the resource, same as parent()
Returns:
parent of the resource

removeExtension

public IRid removeExtension()
Remove the (optional) extension of the resource name. Query parameters are discarded.
Returns:
uri with extension of name removed

removeTrailingSlash

public IRid removeTrailingSlash()
Remove a possible trailing slash from the Rid. Query parameters are preserved.
Returns:
Rid without trailing slash

isAbsolute

public boolean isAbsolute()
Return if Rid is absolute, e.g. start with a slash.
Returns:
if Rid is absolute path

isRoot

public boolean isRoot()
Return if Rid is root collection.
Returns:
if this is the root collection

isAncestorOf

public boolean isAncestorOf(IRid child)
Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid.
Parameters:
child - to test against
Returns:
if this Rid is ancestor of child

isAncestorOfOrSelf

public boolean isAncestorOfOrSelf(IRid child)
Determine if this Rid is an ancestor (parent or parent's parent, etc.) of the given child Rid or the same.
Parameters:
child - to test against
Returns:
if this Rid is ancestor of child

endsWithSlash

public boolean endsWithSlash()
Return if this Rid ends with a slash.
Returns:
if this Rid ends with a slash

add

public IRid add(java.lang.String uri)
Concatenate this Rid with the given Rid. Treats this Rid as if it ends with a slash and the parameter Rid as if it starts without a slash.
Parameters:
uri - to append to this
Returns:
new Rid as concatenation

add

public IRid add(IRid uri)
Concatenate this Rid with the given Rid. Treats this Rid as if it ends with a slash and the parameter Rid as if it starts without a slash.
Parameters:
uri - to append to this
Returns:
new Rid as concatenation

split

public java.util.List split()
Splits the Rid into its path components
Returns:
List of Strings

length

public int length()
Return length of Rid in string representation
Returns:
length of Rid in string representation

resolveRelativeRid

public IRid resolveRelativeRid(java.lang.String uri)
Resolve relative Rids
Parameters:
uri - An Rid, which may be relative or absolute
Returns:
resolved Rid

addPathSegment

public IRid addPathSegment(java.lang.String segment)
                    throws java.lang.Exception
Adds a path segment.
Parameters:
segment - String containing the new path segment
Returns:
new Rid
Throws:
java.lang.Exception - Exception raised in failure situation

setQueryParameter

public IRid setQueryParameter(java.util.Properties parameter)
Create a new Rid by setting the given parameters as query part of this Rid.
Parameters:
parameter - to set to query
Returns:
new Rid with parameter in query

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.