org.rhq.bundle.ant
Class BundleAntProject

java.lang.Object
  extended by org.apache.tools.ant.Project
      extended by org.rhq.bundle.ant.BundleAntProject
All Implemented Interfaces:
org.apache.tools.ant.types.ResourceFactory

public class BundleAntProject
extends org.apache.tools.ant.Project

This is the Ant project object that is used when processing bundle Ant scripts (aka "bundle recipes"). It extends the normal Ant project object by providing additional methods that help collect additional information about the Ant script. This project object is to be used by either the bundle AntLauncher or custom bundle Ant tasks. The launcher or tasks can inform this project object of things that are happening as the Ant script is being parsed and/or executed. Also provides a common method for any task to invoke to send an audit message.

Author:
John Mazzitelli, Ian Springer

Nested Class Summary
static class BundleAntProject.AuditStatus
           
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Project
JAVA_1_0, JAVA_1_1, JAVA_1_2, JAVA_1_3, JAVA_1_4, MSG_DEBUG, MSG_ERR, MSG_INFO, MSG_VERBOSE, MSG_WARN, TOKEN_END, TOKEN_START
 
Constructor Summary
BundleAntProject()
           
BundleAntProject(boolean parseOnly)
           
 
Method Summary
 void auditLog(BundleAntProject.AuditStatus status, String action, String info, String message, String details)
          Logs a message in a format that our audit task/agent-side audit log listener knows about.
 String getBundleDescription()
           
 Set<String> getBundleFileNames()
           
 String getBundleName()
           
 String getBundleVersion()
           
 org.rhq.core.domain.configuration.Configuration getConfiguration()
           
 org.rhq.core.domain.configuration.definition.ConfigurationDefinition getConfigurationDefinition()
           
 DeployDifferences getDeployDifferences()
           
 File getDeployDir()
           
 int getDeploymentId()
           
 DeploymentPhase getDeploymentPhase()
           
 Set<File> getDownloadedFiles()
          If there were url-file or url-archives, this returns the set of files that were downloaded from the URLs.
 boolean isDryRun()
           
 boolean isParseOnly()
           
 void setBundleDescription(String bundleDescription)
           
 void setBundleName(String bundleName)
           
 void setBundleVersion(String bundleVersion)
           
 void setDeployDir(File deployDir)
           
 void setDeploymentId(int deploymentId)
           
 void setDeploymentPhase(DeploymentPhase deploymentPhase)
           
 void setDryRun(boolean dryRun)
           
 
Methods inherited from class org.apache.tools.ant.Project
addBuildListener, addDataTypeDefinition, addFilter, addIdReference, addOrReplaceTarget, addOrReplaceTarget, addReference, addTarget, addTarget, addTaskDefinition, checkTaskClass, copyFile, copyFile, copyFile, copyFile, copyFile, copyFile, copyFile, copyFile, copyInheritedProperties, copyUserProperties, createClassLoader, createClassLoader, createDataType, createSubProject, createTask, defaultInput, demuxFlush, demuxInput, demuxOutput, executeSortedTargets, executeTarget, executeTargets, fireBuildFinished, fireBuildStarted, fireMessageLogged, fireMessageLogged, fireMessageLogged, fireMessageLogged, fireMessageLogged, fireMessageLogged, fireSubBuildFinished, fireSubBuildStarted, fireTargetFinished, fireTargetStarted, fireTaskFinished, fireTaskStarted, getBaseDir, getBuildListeners, getCoreLoader, getDataTypeDefinitions, getDefaultInputStream, getDefaultTarget, getDescription, getElementName, getExecutor, getFilters, getGlobalFilterSet, getInheritedProperties, getInputHandler, getJavaVersion, getName, getProject, getProperties, getProperty, getReference, getReferences, getResource, getTargets, getTaskDefinitions, getThreadTask, getUserProperties, getUserProperty, hasReference, inheritIDReferences, init, initProperties, initSubProject, isKeepGoingMode, log, log, log, log, log, log, log, registerThreadTask, removeBuildListener, replaceProperties, resolveFile, resolveFile, setBaseDir, setBasedir, setCoreLoader, setDefault, setDefaultInputStream, setDefaultTarget, setDescription, setExecutor, setFileLastModified, setInheritedProperty, setInputHandler, setJavaVersionProperty, setKeepGoingMode, setName, setNewProperty, setProjectReference, setProperty, setSystemProperties, setUserProperty, toBoolean, topoSort, topoSort, topoSort, translatePath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleAntProject

public BundleAntProject()

BundleAntProject

public BundleAntProject(boolean parseOnly)
Method Detail

isParseOnly

public boolean isParseOnly()

getBundleFileNames

public Set<String> getBundleFileNames()

getConfigurationDefinition

public org.rhq.core.domain.configuration.definition.ConfigurationDefinition getConfigurationDefinition()

getConfiguration

public org.rhq.core.domain.configuration.Configuration getConfiguration()

getBundleName

public String getBundleName()

setBundleName

public void setBundleName(String bundleName)

getBundleVersion

public String getBundleVersion()

setBundleVersion

public void setBundleVersion(String bundleVersion)

getBundleDescription

public String getBundleDescription()

setBundleDescription

public void setBundleDescription(String bundleDescription)

getDeployDir

public File getDeployDir()

setDeployDir

public void setDeployDir(File deployDir)

getDeploymentId

public int getDeploymentId()

setDeploymentId

public void setDeploymentId(int deploymentId)

getDeploymentPhase

public DeploymentPhase getDeploymentPhase()

setDeploymentPhase

public void setDeploymentPhase(DeploymentPhase deploymentPhase)

setDryRun

public void setDryRun(boolean dryRun)

isDryRun

public boolean isDryRun()

getDeployDifferences

public DeployDifferences getDeployDifferences()

getDownloadedFiles

public Set<File> getDownloadedFiles()
If there were url-file or url-archives, this returns the set of files that were downloaded from the URLs.

Returns:
downloaded files from remote URLs that contain our bundle content

auditLog

public void auditLog(BundleAntProject.AuditStatus status,
                     String action,
                     String info,
                     String message,
                     String details)
Logs a message in a format that our audit task/agent-side audit log listener knows about. When running in the agent, this audit log will be sent to the server. It is always logged at part of the normal Ant logger mechanism.

Parameters:
status - SUCCESS, FAILURE, WARN, INFO
action - audit action, a short summary easily displayed (e.g "File Download")
info - information about the action target, easily displayed (e.g. "myfile.zip")
message - Optional, brief (one or two lines) information message
details - Optional, verbose data, such as full file text or long error messages/stack traces


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.