com.sun.enterprise.util.io
Class ServerDirs

java.lang.Object
  extended by com.sun.enterprise.util.io.ServerDirs

public class ServerDirs
extends Object

The hierarchy of directories above a running DAS or server instance can get messy to deal with -- thus this class. This class is a bullet-proof holder of that information. Instances and DAS are arranged differently: examples: DAS domainDir = getServerDir() == C:/glassfish3/glassfish/domains/domain1 domainsDir = getServerParentDir() == C:/glassfish3/glassfish/domains grandparent-dir is meaningless Instance instanceDir = getServerDir() == C:/glassfish3/glassfish/nodes/mymachine/instance1 agentDir = getServerParentDir() == C:/glassfish3/glassfish/nodes/mymachine agentsDir = getServerGrandParentDir() == C:/glassfish3/glassfish/nodes Currently in all cases the name of the serverDir is the name of the server -- by our definition. THIS CLASS IS GUARANTEED THREAD SAFE THIS CLASS IS GUARANTEED IMMUTABLE Contract: Caller is supposed to NOT call methods on an instance of this class. It's "advanced java" to be able to do that anyway. I don't allow half-baked data out. It's all or none. The "valid" flag is checked and if invalid -- all methods return null. They don't throw an Exception because the caller is not supposed to call the methods - it would just annoy the caller.

Since:
3.1 Created: April 19, 2010
Author:
Byron Nevins

Constructor Summary
ServerDirs()
           
ServerDirs(File leaf)
           
 
Method Summary
 String deletePidFile()
          Return a message suitable for printing, not just for errors.
 File getAgentDir()
           
 File getConfigDir()
           
 File getDasPropertiesFile()
           
 File getDomainXml()
           
 String getLocalPassword()
           
 File getLocalPasswordFile()
           
 File getPidFile()
           
 File getServerDir()
           
 File getServerGrandParentDir()
           
 String getServerName()
           
 File getServerParentDir()
           
 boolean isValid()
           
 ServerDirs refresh()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServerDirs

public ServerDirs()

ServerDirs

public ServerDirs(File leaf)
           throws IOException
Throws:
IOException
Method Detail

getServerName

public final String getServerName()

deletePidFile

public final String deletePidFile()
Return a message suitable for printing, not just for errors.

Returns:

refresh

public ServerDirs refresh()
                   throws IOException
Throws:
IOException

getServerDir

public final File getServerDir()

getAgentDir

public final File getAgentDir()

getServerParentDir

public final File getServerParentDir()

getServerGrandParentDir

public final File getServerGrandParentDir()

getDomainXml

public final File getDomainXml()

getConfigDir

public final File getConfigDir()

getPidFile

public final File getPidFile()

getDasPropertiesFile

public final File getDasPropertiesFile()

getLocalPassword

public String getLocalPassword()

getLocalPasswordFile

public final File getLocalPasswordFile()

isValid

public final boolean isValid()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 GlassFish Community. All Rights Reserved.