public interface RepositoryPathUtilityMBean
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);
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OBJECT_NAME
A String representing the
ObjectName that this MBean maps to. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
buildHostRepositoryPath(java.lang.String hostName)
Builds the host's path in the repository.
|
java.lang.String |
buildServerRepositoryPath(java.lang.String serverTuple)
Builds the server's path in the repository from a server tuple.
|
java.lang.String |
buildServerRepositoryPath(java.lang.String hostName,
java.lang.String urlEncodedUserDir,
java.lang.String serverName)
Builds the server's path in the repository.
|
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.
|
java.lang.String |
getServerTuple(java.lang.String path)
Extracts the server tuple from the given path.
|
java.lang.String |
getURLEncodedPath(java.lang.String path)
Encodes an OS file system path with a UTF-8 URL encoding.
|
java.lang.String |
normalizePath(java.lang.String path)
Normalizes a file system path to be consistent when used within the collective.
|
java.lang.String[] |
splitServerTuple(java.lang.String tuple)
Safely splits the tuple into its component parts.
|
static final java.lang.String OBJECT_NAME
ObjectName
that this MBean maps to.java.lang.String normalizePath(java.lang.String path)
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
path
- The file system path to be normalized. May be null
.java.lang.String getURLEncodedPath(java.lang.String path)
The encoded form can be used in the repository as a path element.
See normalizePath(String)
for details on the resulting path.
path
- The OS filesystem path to encode. Must not be null
.java.lang.String buildHostRepositoryPath(java.lang.String hostName)
The host name will automatically converted to lower-case.
hostName
- The host name. Must not be null
or empty.java.lang.String buildServerRepositoryPath(java.lang.String hostName, java.lang.String urlEncodedUserDir, java.lang.String serverName)
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.
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.getURLEncodedPath(String)
java.lang.String buildServerRepositoryPath(java.lang.String serverTuple)
The host name will automatically be converted to lower-case.
server
- tuplegetServerTuple(String)
java.lang.String getServerTuple(java.lang.String path) throws java.lang.IllegalArgumentException
path
- A server repository path. Must not be null
or empty.
null if the path is not a server
repository pathjava.lang.IllegalArgumentException
- If the path is not a server repository
pathjava.lang.String buildServerTuple(java.lang.String hostName, java.lang.String wlpUserDir, java.lang.String serverName)
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.getURLEncodedPath(String)
java.lang.String[] splitServerTuple(java.lang.String tuple)
tuple
- The server tuple to split (in host,userdir,server format)null
if the input was not a tuple