com.ibm.websphere.collective.repository

Interface RepositoryPathUtilityMBean


  1. public interface RepositoryPathUtilityMBean
The RepositoryPathUtilityMBean provides utility methods to construct repository node paths and server tuples.

The ObjectName for this MBean is WebSphere:feature=collectiveController,type=RepositoryPathUtility,name=RepositoryPathUtility.

A server tuple is defined as (hostName,wlpUserDir,serverName). The host name is always in lower case. The wlpUserDir is not encoded. The elements of the tuple can always be safely parsed as follows:

 String hostName = tuple.substring(0, tuple.indexOf(','));
 String wlpUserDir = tuple.substring(tuple.indexOf(',') + 1, tuple.lastIndexOf(','));
 String serverName = tuple.substring(tuple.lastIndexOf(',') + 1);
 

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
OBJECT_NAME
A String representing the ObjectName that this MBean maps to.

Method Summary

Modifier and Type Method and Description
  1. java.lang.String
buildHostRepositoryPath(java.lang.String hostName)
Builds the host's path in the repository.
  1. java.lang.String
buildServerRepositoryPath(java.lang.String hostName,java.lang.String urlEncodedUserDir,java.lang.String serverName)
Builds the server's path in the repository.
  1. java.lang.String
buildServerTuple(java.lang.String hostName,java.lang.String wlpUserDir,java.lang.String serverName)
Builds the server tuple from the given host name, wlp user directory and server name.
  1. java.lang.String
getServerTuple(java.lang.String path)
Extracts the server tuple from the given path.
  1. java.lang.String
getURLEncodedPath(java.lang.String path)
Encodes an OS file system path with a UTF-8 URL encoding.

Field Detail

OBJECT_NAME

  1. static final java.lang.String OBJECT_NAME
A String representing the ObjectName that this MBean maps to.
See Also:

Method Detail

getURLEncodedPath

  1. java.lang.String getURLEncodedPath( java.lang.String path)
Encodes an OS file system path with a UTF-8 URL encoding.

The encoded form can be used in the repository as a path element.

Windows drive-letters are always converted to their upper-case form to ensure consistency.

e.g. RepositoryPathUtility.getURLEncodedPath("c:\\wlp\\usr\\") will result in: C%3A%2Fwlp%2Fusr

Note that URL-style prefixing, such as file:// is stripped.

e.g. RepositoryPathUtility.getURLEncodedPath("file:/c:/wlp/usr") will result in: C%3A%2Fwlp%2Fusr

Parameters:
path - The OS filesystem path to encode. Must not be null.
Returns:
The URL encoded path, without a trailing slash

buildHostRepositoryPath

  1. java.lang.String buildHostRepositoryPath( java.lang.String hostName)
Builds the host's path in the repository.

The host name will automatically converted to lower-case.

Parameters:
hostName - The host name. Must not be null or empty.
Returns:
The path to the host in the repository, with the trailing slash.

buildServerRepositoryPath

  1. java.lang.String buildServerRepositoryPath( java.lang.String hostName,
  2. java.lang.String urlEncodedUserDir,
  3. java.lang.String serverName)
Builds the server's path in the repository.

A server is uniquely identified by its host name, its user dir, and its server name.

The host name will automatically converted to lower-case.

Parameters:
hostName - The host name for the server. Must not be null or empty.
urlEncodedUserDir - The URL encoded canonical path for the user directory of server. Must not be null or empty.
serverName - The name of the server. Must not be null or empty.
Returns:
The path to the server in the repository, with the trailing slash.
See Also:

getServerTuple

  1. java.lang.String getServerTuple( java.lang.String path)
  2. throws java.lang.IllegalArgumentException
Extracts the server tuple from the given path. If the path is not a server repository path, an IllegalArgumentException will be thrown.
Parameters:
path - A server repository path. Must not be null or empty.
Returns:
A server tuple, or null if the path is not a server repository path
Throws:
java.lang.IllegalArgumentException - If the path is not a server repository path

buildServerTuple

  1. java.lang.String buildServerTuple( java.lang.String hostName,
  2. java.lang.String wlpUserDir,
  3. java.lang.String serverName)
Builds the server tuple from the given host name, wlp user directory and server name.
Parameters:
hostName - The host name for the server. Must not be null or empty.
wlpUserDir - The canonical path for the user directory of server. Must not be null or empty.
serverName - The name of the server. Must not be null or empty.
Returns:
The server tuple
See Also: