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

DottedNameAliasedQuery

public class DottedNameAliasedQuery extends Object implements DottedNameQuery

Fields Summary
protected final DottedNameQuery
mSrcQuery
protected final DottedNameServerInfo
mServerInfo
final DottedNameResolverForAliases
mAliasResolver
Constructors Summary
public DottedNameAliasedQuery(DottedNameQuery srcQuery, DottedNameServerInfo serverInfo)

		mSrcQuery	= srcQuery;
		mServerInfo	= serverInfo;
		mAliasResolver	= new DottedNameResolverForAliases( srcQuery, serverInfo );
	
Methods Summary
protected voidaddAllNamesForConfig(DottedName configDN, java.util.Set outSet)

		final String []	serverNames	= mServerInfo.getServerNamesForConfig( configDN.getScope() );
		
		// there may be none if no servers refer to the config--that's OK
		for( int i = 0; i < serverNames.length; ++i )
		{
			final String		newName	=
					DottedName.toString( configDN.getDomain(), serverNames[ i ], configDN.getParts() );

			outSet.add( newName );
		}
	
protected voidaddAllNamesForDomain(DottedName domainDN, java.util.Set outSet)

		final Iterator iter	= mServerInfo.getServerNames().iterator();
		
		// there may be none if no servers refer to the config--that's OK
		while ( iter.hasNext() )
		{
			final String	serverName	= (String)iter.next();
			
			final String		dottedNameString	=
					DottedName.toString( domainDN.getDomain(), serverName, domainDN.getParts() );
					
			final DottedName	newName	= DottedNameFactory.getInstance().get( dottedNameString );
			outSet.add( newName.toString() );
		}
	
public java.util.SetallDottedNameStrings()

		Set	result	= Collections.EMPTY_SET;
		
		try
		{
			result	= allDottedNameStringsThrow();
		}
		catch( DottedNameServerInfo.UnavailableException e )
		{
			DottedNameLogger.logException( e );
		}
		return( result );
	
protected java.util.SetallDottedNameStringsThrow()

		final Set		srcSet	= mSrcQuery.allDottedNameStrings();
		final Iterator	iter	= srcSet.iterator();
		final HashSet	destSet	= new HashSet();
		
		final Set	configNames	= mServerInfo.getConfigNames();
		
		while ( iter.hasNext() )
		{
			final String		dottedName	= (String)iter.next();
			final DottedName	dn	= DottedNameFactory.getInstance().get( dottedName );
			
			final String	scope	= dn.getScope();
			
			if ( DottedNameAliasSupport.scopeIsDomain( scope ) )
			{
				if ( DottedNameAliasSupport.isAliasedDomain( dn ) )
				{
					destSet.add (dottedName);
                    addAllNamesForDomain( dn, destSet );
				}
			}
			else
			{
				if ( configNames.contains( scope ) )
				{
					addAllNamesForConfig( dn, destSet );
				}
				else
				{
					// not a config name.
					destSet.add( dottedName );
				}
			}
			
		}
		
		return( destSet );
	
public javax.management.ObjectNamedottedNameToObjectName(java.lang.String dottedName)

		return( mAliasResolver.resolveDottedName( dottedName ) );