org.apache.avalon.tools.model
Class Home

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.types.DataType
          extended byorg.apache.avalon.tools.model.Home

public class Home
extends org.apache.tools.ant.types.DataType

A Home is an immutable data object that aggregates a suite of buildable project defintions relative to local and external dependencies.

Version:
$Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
Author:
Avalon Development Team

Field Summary
static String BANNER
           
static String GPG_EXE_KEY
           
static String HOME_KEY
           
static String HOSTS_KEY
           
static String INDEX_KEY
           
static String KEY
           
 
Fields inherited from class org.apache.tools.ant.types.DataType
checked, description, ref
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
protected Home(org.apache.tools.ant.Project project, Magic system, File index)
          Creation of a new home using a supplied index.
 
Method Summary
 Definition getDefinition(ResourceRef ref)
          Return a definition matching the supplied reference.
 Definition getDefinition(String key)
          Return a definition matching the supplied key.
 Definition[] getDefinitions()
          Return all definitions with the home.
 Repository getDocsRepository()
          Return the immutable docs repository cache descriptor.
 String getGumpSignature()
          Return the gump build signature.
 File getIndex()
          Return the index file used to establish this home.
 long getIndexLastModified()
          Return the last modification time of the index file as a long.
 Plugin getPlugin(ResourceRef ref)
          Return a plugin matching the supplied reference.
 String getProperty(String key)
          Return a property declared undr the project that established the root index.
 Repository getRepository()
          Return the immutable repository descriptor for the main cache.
 Resource getResource(ResourceRef ref)
          Return a resource matching the supplied reference.
 Resource getResource(String key)
          Return a resource matching the supplied key.
 Resource[] getResources()
          Return all of the resource declared within this home.
 boolean isaDefinition(ResourceRef ref)
          Return TRUE if the suppied resource ref references a project definition.
 boolean isaResourceKey(String key)
          Return TRUE if the supplied key is the name of a key of a resource declared within this home.
 boolean isGump()
          Return TRUE if the runtime is initiated by gump.
 
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, getCheckedRef, getDescription, getRefid, isChecked, isReference, noChildrenAllowed, setChecked, setDescription, setRefid, tooManyAttributes
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, log, log, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BANNER

public static final String BANNER
See Also:
Constant Field Values

KEY

public static final String KEY
See Also:
Constant Field Values

HOME_KEY

public static final String HOME_KEY
See Also:
Constant Field Values

INDEX_KEY

public static final String INDEX_KEY
See Also:
Constant Field Values

HOSTS_KEY

public static final String HOSTS_KEY
See Also:
Constant Field Values

GPG_EXE_KEY

public static final String GPG_EXE_KEY
See Also:
Constant Field Values
Constructor Detail

Home

protected Home(org.apache.tools.ant.Project project,
               Magic system,
               File index)
Creation of a new home using a supplied index.

Parameters:
project - the ant project establishing the home
system - the magic system instance
index - the magic project index
Method Detail

getIndex

public File getIndex()
Return the index file used to establish this home.

Returns:
the index file

getIndexLastModified

public long getIndexLastModified()
Return the last modification time of the index file as a long.

Returns:
the last modification time

getProperty

public String getProperty(String key)
Return a property declared undr the project that established the root index.

Parameters:
key - the property key
Returns:
the value matching the supplied property key

isaResourceKey

public boolean isaResourceKey(String key)
Return TRUE if the supplied key is the name of a key of a resource declared within this home.

Parameters:
key - the key

isGump

public boolean isGump()
Return TRUE if the runtime is initiated by gump.

Returns:
TRUE if gumpt is running the show

getGumpSignature

public String getGumpSignature()
Return the gump build signature.

Returns:
a string corresponding to the gump @@DATE@@ value.

getRepository

public Repository getRepository()
Return the immutable repository descriptor for the main cache.

Returns:
the main cache repository descriptor

getDocsRepository

public Repository getDocsRepository()
Return the immutable docs repository cache descriptor.

Returns:
the docs repository descriptor

getResources

public Resource[] getResources()
Return all of the resource declared within this home.

Returns:
the resource defintions

isaDefinition

public boolean isaDefinition(ResourceRef ref)
Return TRUE if the suppied resource ref references a project definition.

Returns:
TRUE is the resource is a definition

getDefinitions

public Definition[] getDefinitions()
                            throws org.apache.tools.ant.BuildException
Return all definitions with the home.

Returns:
array of know definitions
Throws:
org.apache.tools.ant.BuildException

getResource

public Resource getResource(String key)
                     throws org.apache.tools.ant.BuildException
Return a resource matching the supplied key.

Returns:
the resource mathing the key
Throws:
org.apache.tools.ant.BuildException - if the resource is unknown

getResource

public Resource getResource(ResourceRef ref)
                     throws org.apache.tools.ant.BuildException
Return a resource matching the supplied reference.

Returns:
the resource mathing the reference
Throws:
org.apache.tools.ant.BuildException - if the resource is unknown

getDefinition

public Definition getDefinition(String key)
                         throws org.apache.tools.ant.BuildException
Return a definition matching the supplied key.

Returns:
the definition mathing the key
Throws:
org.apache.tools.ant.BuildException - if the definition is unknown

getDefinition

public Definition getDefinition(ResourceRef ref)
                         throws org.apache.tools.ant.BuildException
Return a definition matching the supplied reference.

Returns:
the definition mathing the reference
Throws:
org.apache.tools.ant.BuildException - if the definition is unknown

getPlugin

public Plugin getPlugin(ResourceRef ref)
                 throws org.apache.tools.ant.BuildException
Return a plugin matching the supplied reference.

Returns:
the plugin mathing the reference
Throws:
org.apache.tools.ant.BuildException - if the plugin is unknown