FileDocCategorySizeDatePackage
PELocalTargetResolver.javaAPI DocGlassfish v2 API4406Fri May 04 22:34:40 BST 2007com.sun.enterprise.diagnostics

PELocalTargetResolver

public class PELocalTargetResolver extends TargetResolver
author
mu125243

Fields Summary
Constructors Summary
public PELocalTargetResolver(String target, String repositoryDir, boolean local)
Creates a new instance of PELocalTargetResolver

        super(target,repositoryDir,local);
    
Methods Summary
protected voiddetermineInstances()

        addInstance(TargetType.DAS.getType());
    
protected voiddetermineRepositoryDetails()

        repositoryName = target;
    
protected voiddetermineTargetDir()

        //do nothing
    
protected voiddetermineTargetType()

        if(type == null)
            setTargetType(TargetType.DAS);
    
private booleanisAInstance(java.lang.String repositoryDir, java.lang.String target)

        if(repositoryDir != null && target != null){
            String absoluteDir = repositoryDir + File.separator + target;
            File applicationsDirObj = new File(absoluteDir +
                    Constants.APPLICATIONS_DIR);
            File generatedDirObj = new File(absoluteDir +
                    Constants.GENERATED_DIR);
            File configDirObj = new File(absoluteDir +
                    Constants.CONFIG_DIR);
            if(applicationsDirObj.exists() &&
                    generatedDirObj.exists() &&
                    configDirObj.exists())
                return true;
            return false;
        }//if
        return false;
    
protected voidsetExecutionContext()

        context = ExecutionContext.LOCAL_EC;
    
    
public booleanvalidateTarget()
Combination of targetDir and target in local mode is expected to be appserver's nodeagent's or server instance's directory structure

param
targetDir targetDir in local mode
param
target target name for which report generation is initiated
return
true if directory structure seems inline with nodeagent / instance directory structure
throw
DiagnosticException if targetDir and target are null

        if(repositoryDir != null && target != null){
            logger.log(Level.FINEST, "validate_local_target" , new String[]{target, repositoryDir});
            return isAInstance(repositoryDir,target);
        } // if
        throw new DiagnosticException("Targetdir and targetname are null");