|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.matthias_burbach.deputy.core.Deputy
Is the main class of the core application.
Field Summary | |
static int |
CHANGE_ACTION_APPLY_RULES
Flags that the last change action was 'Apply Rules'. |
static int |
CHANGE_ACTION_CHANGE_DEPENDENCIES
Flags that the last change action was 'Add Dependency' or 'Remove Dependency'. |
static int |
CHANGE_ACTION_CHANGE_RULES
Flags that the last change action was 'Change Default Rule', 'Add Enforcement Rule', 'Add Deprecation Rule', 'Add Replacement Rule' or 'Remove Rule'. |
static int |
CHANGE_ACTION_UNKNOWN
Flags that the last change action is unknown. |
static int |
FORMAT_DEPUTYXML
The export format 'Deputy XML'. |
static int |
FORMAT_GRAPHML
The export format 'GraphML'. |
Constructor Summary | |
Deputy(Log log)
Constructs and starts the application. |
Method Summary | |
void |
addChangeListener(DeputyChangeListener listener)
Adds a listener to be notified on changes in the current project. |
void |
addedDependency(Project addedDependency,
int index)
Is fired when a dependency has been added to the project. |
void |
addedRule(Rule addedRule,
int index)
Is fired when a rule has been added to the rule set. |
Project |
applyRulesToProject()
Loads the currently set project file into Deputy and applies rules on the fly. |
void |
changedDefaultRule()
Is fired when the default rule has been changed. |
void |
deriveEnforcementsFromProject(java.lang.String aProjectFile)
Adds an enforcement rule for each dependency in the given project. |
void |
exitApplication()
Cleans up the application on exit. |
void |
exportDependencyGraph(int format)
Exports the currently loaded project as a dependency graph XML that can be imported into Rational Rose or yEd for diagramming purposes. |
java.lang.String |
getDependencyGraphFile()
|
java.lang.String |
getImportFile()
|
int |
getLastChangeAction()
|
Log |
getLog()
|
java.lang.String |
getProjectFile()
|
java.lang.String |
getProperty(java.lang.String key)
|
java.util.List |
getRepositoryConfigs()
|
Project |
getRootProject()
|
java.lang.String |
getVersion()
|
boolean |
isSaved()
|
boolean |
isVirtualRepositoryActive()
|
static void |
main(java.lang.String[] args)
Executes Deputy in batch mode. |
Project |
openProjectAsIs()
Loads the currently set project file 'as is' into Deputy. |
void |
removeChangeListener(DeputyChangeListener listener)
Removes a listener to be notified on changes in the current project. |
void |
removedDependency(Project removedDependency)
Is fired when a dependency has been removed from the project. |
void |
removedIndirectDependency(Project removedDependency)
Is fired when an indirect dependency has been removed from the project. |
void |
removedRule(Rule removedRule)
Is fired when a rule has been removed from the rule set. |
void |
saveProjectAs(java.lang.String newProjectFileName)
Saves the currently loaded project under the new project file name. |
void |
setDependencyGraphFile(java.lang.String dependencyGraphFile)
|
void |
setImportFile(java.lang.String importProjectFile)
|
void |
setLog(Log log)
|
void |
setProjectFile(java.lang.String projectFile)
|
void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
setRepositoryConfigs(java.util.List repositoryConfigs)
|
void |
setVirtualRepositoryActive(boolean virtualRepositoryActive)
|
void |
sortSnapshotsTopologically()
Retrieves all direct and indirect SNAPSHOT dependencies of the current root project and prints them to the log in topological order such that leaves in the topological order occur first. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FORMAT_GRAPHML
public static final int FORMAT_DEPUTYXML
public static final int CHANGE_ACTION_UNKNOWN
public static final int CHANGE_ACTION_APPLY_RULES
public static final int CHANGE_ACTION_CHANGE_DEPENDENCIES
public static final int CHANGE_ACTION_CHANGE_RULES
Constructor Detail |
public Deputy(Log log) throws java.lang.Exception
log
- The log for messages.
java.lang.Exception
- if anything goes unexpectedly wrongMethod Detail |
public void exitApplication()
public java.lang.String getVersion()
public java.lang.String getProjectFile()
public void setProjectFile(java.lang.String projectFile)
projectFile
- The absolute file path and name of the project that is
currently loaded into Deputy or which is to be loaded
next into Deputy.public java.lang.String getImportFile()
public void setImportFile(java.lang.String importProjectFile)
importProjectFile
- The absolute file path and name of the project
that was last imported from.public boolean isVirtualRepositoryActive()
public void setVirtualRepositoryActive(boolean virtualRepositoryActive)
virtualRepositoryActive
- The virtualRepositoryActive to set.public Project openProjectAsIs() throws java.lang.Exception
java.lang.Exception
- if anything goes unexpectedly wrong.public void deriveEnforcementsFromProject(java.lang.String aProjectFile) throws java.lang.Exception
aProjectFile
- Absolute path of the project whose dependencies to
derive the enforcement rules from.
java.lang.Exception
- if anything goes unexpectedly wrong.public Project applyRulesToProject() throws java.lang.Exception
java.lang.Exception
- if anything goes unexpectedly wrong.public void sortSnapshotsTopologically()
public Project getRootProject()
null.
public void saveProjectAs(java.lang.String newProjectFileName) throws java.lang.Exception
newProjectFileName
- The absolute path and name to save the project
under.
java.lang.Exception
- if anything goes unexpectedly wrongpublic boolean isSaved()
true
if the current state of the project is saved.public java.lang.String getDependencyGraphFile()
public void setDependencyGraphFile(java.lang.String dependencyGraphFile)
dependencyGraphFile
- The absolute path and name of the file to
export the dependency graph under.public void exportDependencyGraph(int format) throws java.lang.Exception
format
- The export format. Can be FORMAT_GRAPHML
or FORMAT_DEPUTYXML
.
java.lang.Exception
- if anything goes unexpectedly wrongpublic java.util.List getRepositoryConfigs() throws java.lang.Exception
RepositoryConfig
.
java.lang.Exception
- if anything goes unexpectedly wrongpublic void setRepositoryConfigs(java.util.List repositoryConfigs) throws java.lang.Exception
repositoryConfigs
- A list of configs of type
RepositoryConfig
.
java.lang.Exception
- if anything goes unexpectedly wrongpublic void addChangeListener(DeputyChangeListener listener)
listener
- The listener to be added.public void removeChangeListener(DeputyChangeListener listener)
listener
- The listener to be removed.public void changedDefaultRule()
changedDefaultRule
in interface RuleSetChangeListener
public void addedRule(Rule addedRule, int index)
addedRule
in interface RuleSetChangeListener
addedRule
- The added rule.index
- The index of the added rule in the sorted list of rules of
the rule set.public void removedRule(Rule removedRule)
removedRule
in interface RuleSetChangeListener
removedRule
- The removed rule.public Log getLog()
null
. Can change, don't cache a reference.public void setLog(Log log)
log
- The log to write messages to. Can be set by the creator of
this class to define where to log to.public int getLastChangeAction()
CHANGE_ACTION_UNKNOWN
,
CHANGE_ACTION_APPLY_RULES
,
CHANGE_ACTION_CHANGE_DEPENDENCIES
,public void addedDependency(Project addedDependency, int index)
addedDependency
in interface ProjectChangeListener
addedDependency
- The added dependency.index
- The index of the dependency in the sorted list of the
project's dependencies.public void removedDependency(Project removedDependency)
removedDependency
in interface ProjectChangeListener
removedDependency
- The removed dependency.public void removedIndirectDependency(Project removedDependency)
removedIndirectDependency
in interface ProjectChangeListener
removedDependency
- The removed indirect dependency.public java.lang.String getProperty(java.lang.String key)
key
- The property's key.
null
if the property does not
exist.public void setProperty(java.lang.String key, java.lang.String value)
key
- The property's key. Must not be null
.value
- The property's value. Must not be null
.public static void main(java.lang.String[] args)
args
- The command line arguments:
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |