com.dtolabs.rundeck.core.common
Class FrameworkResource

java.lang.Object
  extended by com.dtolabs.rundeck.core.common.FrameworkResource
All Implemented Interfaces:
IFrameworkResource
Direct Known Subclasses:
FrameworkResourceParent

public class FrameworkResource
extends java.lang.Object
implements IFrameworkResource

Represents a generic framework resource. Each resoure has a name, a base directory and a set of properties.


Field Summary
static java.lang.String VALID_RESOURCE_NAME_REGEX
           
 
Constructor Summary
FrameworkResource(java.lang.String name, java.io.File dir, IFrameworkResourceParent parent)
          Constructor
 
Method Summary
 java.io.File getBaseDir()
          getter to baseDir
protected  org.apache.log4j.Logger getLogger()
           
 java.lang.String getName()
          getter to name property
 IFrameworkResourceParent getParent()
          Get the parent of this resource
 boolean isValid()
           
protected  void storeProperties(java.util.Properties props, java.io.File file)
          Store properties to disk
 java.lang.String toString()
          basic to string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALID_RESOURCE_NAME_REGEX

public static final java.lang.String VALID_RESOURCE_NAME_REGEX
See Also:
Constant Field Values
Constructor Detail

FrameworkResource

public FrameworkResource(java.lang.String name,
                         java.io.File dir,
                         IFrameworkResourceParent parent)
Constructor

Parameters:
name - Name of resource
dir - Base directory of resource
parent - The parent resource
Method Detail

getLogger

protected org.apache.log4j.Logger getLogger()

getName

public java.lang.String getName()
getter to name property

Specified by:
getName in interface IFrameworkResource
Returns:

getBaseDir

public java.io.File getBaseDir()
getter to baseDir

Specified by:
getBaseDir in interface IFrameworkResource
Returns:

getParent

public IFrameworkResourceParent getParent()
Description copied from interface: IFrameworkResource
Get the parent of this resource

Specified by:
getParent in interface IFrameworkResource

isValid

public boolean isValid()
Specified by:
isValid in interface IFrameworkResource

toString

public java.lang.String toString()
basic to string

Overrides:
toString in class java.lang.Object
Returns:

storeProperties

protected void storeProperties(java.util.Properties props,
                               java.io.File file)
                        throws java.io.IOException
Store properties to disk

Parameters:
props - Properties to store
file - File to write property data to
Throws:
java.io.IOException - thrown if file not found or can't write to file