FileDocCategorySizeDatePackage
DottedNameAliasSupport.javaAPI DocGlassfish v2 API5282Fri May 04 22:24:08 BST 2007com.sun.enterprise.admin.dottedname

DottedNameAliasSupport

public class DottedNameAliasSupport extends Object

Fields Summary
public static final String
DOMAIN_SCOPE
public static final String
DOMAIN_SCOPE_DOT
public static final Set
DOMAIN_PARTS
private static final Set
NON_ALIASED_PARTS_SET
static Logger
sLogger
Constructors Summary
public DottedNameAliasSupport()


	
Methods Summary
static voiddm(java.lang.Object o)

		 
	   
	
		if (sLogger == null )
		{
        	sLogger	= java.util.logging.Logger.getLogger( "DottedNameGetSetMBeanImplLogger" );
        	sLogger.setLevel( java.util.logging.Level.INFO );
        }
        
        sLogger.info( o.toString() );
	
public static booleanisAliasedDomain(DottedName dn)

		
		  
	    
	
		boolean	isAliased	= false;
		
		final java.util.List	parts	= dn.getParts();
		
		if ( parts.size() >= 1 )
		{
			isAliased	= DOMAIN_PARTS.contains( parts.get( 0 ) );
		}
		
		return( isAliased );
	
protected static booleanisNonAliasedServer(DottedName dn)

	
		  
	    
	
		boolean	isNonAliased	= false;
		
		final java.util.List	parts	= dn.getParts();
		
		if ( parts.size() >= 1 )
		{
			isNonAliased	= NON_ALIASED_PARTS_SET.contains( parts.get( 0 ) );
		}
		
		return( isNonAliased );
	
public static java.lang.StringresolveScope(DottedNameServerInfo serverInfo, DottedName dn)

		final String	scopeNameIn		= dn.getScope();
		String			actualScopeName	= scopeNameIn;
		
		if ( scopeIsDomain( scopeNameIn ) )
		{
			// no change required
		}
		else
		{
			final boolean	scopeIsServerName	= serverInfo.getServerNames().contains( actualScopeName );

			if ( scopeIsServerName )
			{
				if ( isAliasedDomain( dn ) )
				{
					actualScopeName	= DottedNameAliasSupport.DOMAIN_SCOPE;
				}
				else if ( isNonAliasedServer( dn ) )
				{
					// no change
				}
				else
				{
					// it's a server name, and it *is* aliased, but wasn't alised into domain
					// so it must be aliased into a config
					actualScopeName	= serverInfo.getConfigNameForServer( scopeNameIn );
				}
			}
		}
		
		return( actualScopeName );
	
public static booleanscopeIsDomain(java.lang.String scope)

	
	
		  
	   
	
		return( scope.equals( DOMAIN_SCOPE ) || scope.startsWith( DOMAIN_SCOPE_DOT ) );