|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.util.Names
public class Names
Utility classes needed to support consistent naming behavior.
Field Summary | |
---|---|
static int |
MAX_VARIABLE_NAME_LENGTH
The maximum length of a SAS Variable name. |
static int |
UNIX
UNIX operating system. |
static int |
UNKNOWN
Unknown operating system. |
static int |
WEBDAV
WebDAV |
static int |
WINDOWS
Windows operating system. |
static int |
ZOS_HFS
z/OS HFS operating system. |
static int |
ZOS_PDS
z/OS PDS operating system. |
Method Summary | |
---|---|
static java.lang.String |
generateName(int numOfChars)
Attempt to generate a unique name. |
static java.lang.String |
getObjectName(java.lang.String name,
RemoteServiceInterface remoteService)
Create the String representation of the MBean object name. |
static java.lang.String |
mapNameToFilesystem(java.lang.String name,
int hostOS,
java.lang.String prefix,
java.lang.String suffix)
Map the object name to a file system path. |
static java.lang.String |
mapNameToOMRObjectName(java.lang.String name)
Map the parameter name to a valid OMR object name. |
static java.lang.String |
mapNameToSASVariableName(java.lang.String name,
java.util.Collection existingNames)
Map the parameter name to a valid SAS variable name. |
static java.lang.String |
mapUrlToFilesystem(java.lang.String url,
int hostOS,
java.lang.String prefix,
java.lang.String suffix)
Map the object SBIP URLto a file system path. |
static java.lang.String |
trimName(java.lang.String name)
Trim leading and trailing space and control characters. |
static boolean |
validateOMRObjectName(java.lang.String name,
boolean throwException)
Test for a valid Metadata Repository object name. |
static boolean |
validateParameterName(java.lang.String name,
boolean throwException)
Test for valid parameter name or parameter group name. |
static boolean |
validateSASFilerefName(java.lang.String name,
boolean throwException)
Test for valid SAS fileref name. |
static boolean |
validateSASLibrefName(java.lang.String name,
boolean throwException)
Test for valid SAS libref name. |
static boolean |
validateSASVariableName(java.lang.String name,
boolean throwException)
Test for valid SAS variable name. |
Field Detail |
---|
public static final int MAX_VARIABLE_NAME_LENGTH
public static final int UNKNOWN
public static final int WINDOWS
public static final int UNIX
public static final int ZOS_HFS
public static final int ZOS_PDS
public static final int WEBDAV
Method Detail |
---|
public static java.lang.String mapNameToFilesystem(java.lang.String name, int hostOS, java.lang.String prefix, java.lang.String suffix) throws java.lang.IllegalArgumentException
name
- The name to map to a file system path.hostOS
- The host operating system. Valid values include
UNKNOWN
,WINDOWS
,UNIX
,
ZOS_HFS
,ZOS_PDS
and WEBDAV
.prefix
- The prefix to use when creating the file system path.suffix
- The suffix to use when creating the file system path.
String
The file system path.
java.lang.IllegalArgumentException
- If a null
name is
specified or if an invalid host operating system value is
specified.public static java.lang.String mapUrlToFilesystem(java.lang.String url, int hostOS, java.lang.String prefix, java.lang.String suffix) throws java.lang.IllegalArgumentException
url
- The url to map to a file system path.hostOS
- The host operating system. Valid values include
UNKNOWN
,WINDOWS
,UNIX
,
ZOS_HFS
,ZOS_PDS
and WEBDAV
.prefix
- The prefix to use when creating the file system path.suffix
- The suffix to use when creating the file system path.
String
The file system path.
java.lang.IllegalArgumentException
- If an invalid SBIP URL is specified.public static java.lang.String mapNameToSASVariableName(java.lang.String name, java.util.Collection existingNames) throws java.lang.IllegalArgumentException
name
- The name to map to a SAS variable name.existingNames
- Is an optional collection containingg all
pre-existing parameters so that the method can avoid name
collisions. A value of null for this Collection would disable
any name collision checking.
String
the SAS variable name.
java.lang.IllegalArgumentException
- If a null
name is
specified.public static java.lang.String mapNameToOMRObjectName(java.lang.String name)
name
- the name to map to a valid OMR object name
String
the OMR object name.
java.lang.IllegalArgumentException
- If a null
name is specified.public static boolean validateOMRObjectName(java.lang.String name, boolean throwException) throws java.lang.IllegalArgumentException
null
name
- The name to validatethrowException
- indicates whether to throw an exception if the
value is not valid.
boolean
is true
if this is a valid
name; is false
if the name contains an illegal
character or is too long.
java.lang.IllegalArgumentException
- If the throwException parameter is
true
and the name is invalid.public static boolean validateParameterName(java.lang.String name, boolean throwException) throws java.lang.IllegalArgumentException
name
- The name to validate.throwException
- indicates whether to throw an exception if the
value is not valid.
boolean
is true
if this is a valid
name; is false
if the name contains an illegal
character or is too long.
java.lang.IllegalArgumentException
- If the throwException parameter is
true
and the name is invalid.public static boolean validateSASVariableName(java.lang.String name, boolean throwException) throws java.lang.IllegalArgumentException
name
- The SAS variable name to validate.throwException
- indicates whether to throw an exception if the
value is not valid.
boolean
is true
if this is a valid
name; is false
if the name contains an illegal
character or is too long.
java.lang.IllegalArgumentException
- If the throwException parameter is
code>true and the name is invalid.public static boolean validateSASLibrefName(java.lang.String name, boolean throwException) throws java.lang.IllegalArgumentException
name
- The SAS libref name to validate.throwException
- indicates whether to throw an exception if the
value is not valid.
boolean
is true
if this is a valid
name; is false
if the name contains an illegal
character or is too long.
java.lang.IllegalArgumentException
- If the throwException parameter is
code>true and the name is invalid.public static boolean validateSASFilerefName(java.lang.String name, boolean throwException) throws java.lang.IllegalArgumentException
name
- The SAS fileref name to validate.throwException
- indicates whether to throw an exception if the
value is not valid.
boolean
is true
if this is a valid
name; is false
if the name contains an illegal
character or is too long.
java.lang.IllegalArgumentException
- If the throwException parameter is
code>true and the name is invalid.public static java.lang.String trimName(java.lang.String name) throws java.lang.IllegalArgumentException
name
- The name to trim.
String
The trimmed name.
java.lang.IllegalArgumentException
- If a null
name is
specified.public static java.lang.String generateName(int numOfChars)
The unique name generation is not guaranteed to be 100% unique so calling applications should handle duplicates accordingly.
numOfChars
- the number of characters in the generated name. Specify
zero to get the default name/length.
public static java.lang.String getObjectName(java.lang.String name, RemoteServiceInterface remoteService)
name
- The name of the Service.remoteService
- the remote service
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |