Methods Summary |
---|
public static java.lang.String | getApplicationName(java.lang.String moduleName)
if (isEmbeddedConnectorModule(moduleName)) {
int idx = moduleName.indexOf(
ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER);
return moduleName.substring(0, idx);
} else {
return null;
}
|
public static java.lang.String | getConnectorModuleName(java.lang.String moduleName)
if (isEmbeddedConnectorModule(moduleName)) {
int idx = moduleName.indexOf(
ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER);
return moduleName.substring(idx+1);
} else {
return moduleName;
}
|
public static ResourcePrincipal | getDefaultResourcePrincipal(java.lang.String poolName)
// All this to get the default user name and principal
ConnectorConnectionPool connectorConnectionPool = null;
try {
String jndiNameForPool = getReservePrefixedJNDINameForPool(poolName) ;
InitialContext ic = new InitialContext();
connectorConnectionPool =
(ConnectorConnectionPool) ic.lookup(jndiNameForPool);
} catch (NamingException ne ) {
throw ne;
}
ConnectorDescriptorInfo cdi = connectorConnectionPool.
getConnectorDescriptorInfo();
Set mcfConfigProperties = cdi.getMCFConfigProperties();
Iterator mcfConfPropsIter = mcfConfigProperties.iterator();
String userName = "";
String password = "";
while( mcfConfPropsIter.hasNext() ) {
EnvironmentProperty prop =
(EnvironmentProperty)mcfConfPropsIter.next();
if ( prop.getName().toUpperCase().equals("USERNAME") ||
prop.getName().toUpperCase().equals("USER") ) {
userName = prop.getValue();
} else if ( prop.getName().toUpperCase().equals("PASSWORD") ) {
password = prop.getValue();
}
}
//Now return the ResourcePrincipal
return new ResourcePrincipal( userName, password );
|
public static java.lang.String | getOriginalResourceName(java.lang.String reservePrefixedJNDIName)
String prefix = null;
if ( reservePrefixedJNDIName.startsWith(ConnectorConstants.POOLS_JNDINAME_PREFIX) ) {
prefix = ConnectorConstants.POOLS_JNDINAME_PREFIX;
} else if ( reservePrefixedJNDIName.startsWith(ConnectorConstants.DD_PREFIX) ) {
prefix = ConnectorConstants.DD_PREFIX;
} else if ( reservePrefixedJNDIName.startsWith( ConnectorConstants.RESOURCE_JNDINAME_PREFIX) ) {
prefix = ConnectorConstants.RESOURCE_JNDINAME_PREFIX;
}
return (( prefix == null ) ? reservePrefixedJNDIName : reservePrefixedJNDIName.substring(prefix.length()) );
|
private static java.lang.String | getReservePrefixedJNDIName(java.lang.String prefix, java.lang.String resourceName)
return prefix + resourceName;
|
public static java.lang.String | getReservePrefixedJNDINameForDescriptor(java.lang.String moduleName)
return getReservePrefixedJNDIName(ConnectorConstants.DD_PREFIX, moduleName);
|
public static java.lang.String | getReservePrefixedJNDINameForPool(java.lang.String poolName)
return getReservePrefixedJNDIName(ConnectorConstants.POOLS_JNDINAME_PREFIX, poolName);
|
public static java.lang.String | getReservePrefixedJNDINameForResource(java.lang.String moduleName)
return getReservePrefixedJNDIName(ConnectorConstants.RESOURCE_JNDINAME_PREFIX, moduleName);
|
public static boolean | isEmbeddedConnectorModule(java.lang.String moduleName)
return (moduleName.indexOf(ConnectorConstants.EMBEDDEDRAR_NAME_DELIMITER) != -1);
|
public static boolean | isJMSRA(java.lang.String moduleName)
return moduleName.equalsIgnoreCase(ConnectorConstants.DEFAULT_JMS_ADAPTER);
|