com.dtolabs.rundeck.core.resources
Class FileResourceModelSource

java.lang.Object
  extended by com.dtolabs.rundeck.core.resources.FileResourceModelSource
All Implemented Interfaces:
Configurable, ResourceModelSource

public class FileResourceModelSource
extends java.lang.Object
implements ResourceModelSource, Configurable

FileResourceModelSource can parse files to provide node results


Nested Class Summary
static class FileResourceModelSource.Configuration
           
 
Method Summary
 void configure(FileResourceModelSource.Configuration configuration)
          Configure the Source
 void configure(java.util.Properties configs)
          Configure the object with the configuration properties.
protected  ResourceFormatParser createParser(java.io.File file, java.lang.String format)
          Create a NodeFileParser given the project and the source file, using the predetermined format
 INodeSet getNodes()
           
 INodeSet getNodes(java.io.File nodesFile, java.lang.String format)
          Returns a INodeSet object conatining the nodes config data.
static INodeSet parseFile(java.io.File file, Framework framework, java.lang.String project)
          Utility method to directly parse the nodes from a file
static INodeSet parseFile(java.io.File file, java.lang.String format, Framework framework, java.lang.String project)
          Utility method to directly parse the nodes from a file
static INodeSet parseFile(java.lang.String file, Framework framework, java.lang.String project)
          Utility method to directly parse the nodes from a file
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

configure

public void configure(java.util.Properties configs)
               throws ConfigurationException
Description copied from interface: Configurable
Configure the object with the configuration properties.

Specified by:
configure in interface Configurable
Parameters:
configs - the properties to use
Throws:
ConfigurationException - if there is an invalid configuration

configure

public void configure(FileResourceModelSource.Configuration configuration)
               throws ConfigurationException
Configure the Source

Throws:
ConfigurationException

getNodes

public INodeSet getNodes()
                  throws ResourceModelSourceException
Specified by:
getNodes in interface ResourceModelSource
Throws:
ResourceModelSourceException

getNodes

public INodeSet getNodes(java.io.File nodesFile,
                         java.lang.String format)
                  throws ResourceModelSourceException
Returns a INodeSet object conatining the nodes config data.

Parameters:
nodesFile - the source file
format -
Returns:
an instance of INodeSet
Throws:
ResourceModelSourceException

createParser

protected ResourceFormatParser createParser(java.io.File file,
                                            java.lang.String format)
                                     throws ResourceModelSourceException
Create a NodeFileParser given the project and the source file, using the predetermined format

Parameters:
file - the nodes resource file
Returns:
a new parser based on the determined format
Throws:
ResourceModelSourceException

parseFile

public static INodeSet parseFile(java.lang.String file,
                                 Framework framework,
                                 java.lang.String project)
                          throws ResourceModelSourceException,
                                 ConfigurationException
Utility method to directly parse the nodes from a file

Throws:
ResourceModelSourceException
ConfigurationException

parseFile

public static INodeSet parseFile(java.io.File file,
                                 Framework framework,
                                 java.lang.String project)
                          throws ResourceModelSourceException,
                                 ConfigurationException
Utility method to directly parse the nodes from a file

Throws:
ResourceModelSourceException
ConfigurationException

parseFile

public static INodeSet parseFile(java.io.File file,
                                 java.lang.String format,
                                 Framework framework,
                                 java.lang.String project)
                          throws ResourceModelSourceException,
                                 ConfigurationException
Utility method to directly parse the nodes from a file

Throws:
ResourceModelSourceException
ConfigurationException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object