Package com.pnfsoftware.jeb.core
Interface IRuntimeProject
- All Superinterfaces:
IEventSource,IUserDataSupport
A runtime project represents a loaded instance of a JEB project.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this project.booleandestroyUnit(IUnit unit) This method is used to destroy a unit living in this project.<T extends IUnit>
TConvenience method used to retrieve a unit of the project by its class type.Convenience method used to retrieve units of the project by their class type.voidIf the artifacts wereprocessedwithdoNoProcessUnitset to true, this method may be called afterward to finish processing to process all top-level units yielded by the artifact.intRetrieve the count of artifacts living in this project.Get the bookmark manager.longRetrieve the project creation timestamp.Retrieve the JEB Engines context that's managing this project.List<? extends IInputRecord> Retrieve the list of inputs processed into the project.getKey()Retrieve this project key, used to uniquely identify a project within anIEnginesContext.getLiveArtifact(int index) Retrieve a live artifact by index.Retrieve the list of artifacts managed by this project.getName()Set this project name.getNotes()Retrieve the user notes.Retrieve the project persistence key.intThis convenience routine is used to retrieve the JDB2PersistenceStrategycurrently used by this project.Retrieve the processor (parser) used by this project to process input data and generate units.Get the PDM of this project.Get the PM of this project.longRetrieve the last time this project was saved to JDB2.longRetrieve the duration this project has been opened JEB since it's been last opened.booleanDetermine whether the project currently contains live artifacts.booleanisClosed()Determine whether this project has been closed.booleanDetermine whether this project is new (it was created), or was reloaded from a JDB2 database.processArtifact(IArtifact artifact) Process an artifact into this project.processArtifact(IArtifact artifact, String wantedType, boolean softDelegation, boolean doNotProcessUnit) Process an artifact into this project.processArtifact(File file) Process a file artifact into this project.voidRetrieve this project name.voidSet or update the user notes.voidsetPersistenceStrategy(int strategy) This convenience routine is used to set the JDB2PersistenceStrategycurrently used by this project.Methods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSourceMethods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Field Details
-
ArtifactProcessingDepth
Project property- See Also:
-
AlwaysProcessDuplicateInputs
Project property- See Also:
-
CompressPersistedProject
Project property- See Also:
-
PersistenceStrategy
Project property: 0=default (full); 1=full; 2=quick.- See Also:
-
PersistArtifactFiles
Project property- See Also:
-
-
Method Details
-
getEnginesContext
IEnginesContext getEnginesContext()Retrieve the JEB Engines context that's managing this project.- Returns:
- owning engines context
-
getPropertyDefinitionManager
IPropertyDefinitionManager getPropertyDefinitionManager()Get the PDM of this project. Each project has it own PDM.- Returns:
- project property-definition manager
-
getPropertyManager
IPropertyManager getPropertyManager()Get the PM of this project. Each project has its own PM.- Returns:
- project property manager
-
getKey
String getKey()Retrieve this project key, used to uniquely identify a project within anIEnginesContext.- Returns:
- project key
-
getPersistenceKey
String getPersistenceKey()Retrieve the project persistence key. The persistence key may be different from the actual project key. It indicates the location of the persisted database.- Returns:
- persistence key
-
getPersistenceStrategy
int getPersistenceStrategy()This convenience routine is used to retrieve the JDB2PersistenceStrategycurrently used by this project.- Returns:
- persistence strategy value
-
setPersistenceStrategy
void setPersistenceStrategy(int strategy) This convenience routine is used to set the JDB2PersistenceStrategycurrently used by this project.- Parameters:
strategy- persistence strategy value
-
isReloaded
boolean isReloaded()Determine whether this project is new (it was created), or was reloaded from a JDB2 database.- Returns:
- true if the project was reloaded from persisted data
-
getName
String getName()Set this project name.- Returns:
- project name
-
setName
Retrieve this project name.- Parameters:
name- project name
-
getNotes
String getNotes()Retrieve the user notes.- Returns:
- project notes
-
setNotes
Set or update the user notes.- Parameters:
notes- project notes
-
getProcessor
IUnitProcessor getProcessor()Retrieve the processor (parser) used by this project to process input data and generate units.- Returns:
- unit processor
-
getCreationTimestamp
long getCreationTimestamp()Retrieve the project creation timestamp.- Returns:
- unix timestamp in milliseconds
-
getRecordedTimestamp
long getRecordedTimestamp()Retrieve the last time this project was saved to JDB2.- Returns:
- unix timestamp in milliseconds; 0 if the project was never saved
(
isReloaded()would also return false)
-
getUptime
long getUptime()Retrieve the duration this project has been opened JEB since it's been last opened.- Returns:
- duration in milliseconds
-
close
void close()Close this project. This method should not be called directly; to close a project, use themanaging context's unload()method. -
isClosed
boolean isClosed()Determine whether this project has been closed.- Returns:
- true if the project is closed
-
processArtifact
Process a file artifact into this project.- Parameters:
file- input file- Returns:
- an artifact living in the project, likely to hold one or more parent
units - Throws:
IOException- on artifact-processing error
-
processArtifact
Process an artifact into this project. -
processArtifact
ILiveArtifact processArtifact(IArtifact artifact, String wantedType, boolean softDelegation, boolean doNotProcessUnit) Process an artifact into this project.- Parameters:
artifact- anArtifact, likely backed by afilewantedType- leave null to let the parser determine the type of artifact; seeIUnitProcessorfor detailssoftDelegation- prefer soft delegation and avoid creating generic unit if the input type was undetermined; seeIUnitProcessorfor detailsdoNotProcessUnit- set to true to skip unit processing (the yielded unit, if any, would simply be created)- Returns:
- an artifact living in the project, likely to hold one or more parent
units
-
finishArtifactProcessing
If the artifacts wereprocessedwithdoNoProcessUnitset to true, this method may be called afterward to finish processing to process all top-level units yielded by the artifact.- Parameters:
a- live artifact resulting from a call toprocess(...)
-
hasLiveArtifacts
boolean hasLiveArtifacts()Determine whether the project currently contains live artifacts.- Returns:
- true if at least one live artifact is present
-
getLiveArtifacts
List<ILiveArtifact> getLiveArtifacts()Retrieve the list of artifacts managed by this project.- Returns:
- live artifacts managed by this project
-
getLiveArtifact
Retrieve a live artifact by index.- Parameters:
index- artifact index- Returns:
- live artifact at the requested index
-
getArtifactCount
int getArtifactCount()Retrieve the count of artifacts living in this project.- Returns:
- artifact count
-
destroyUnit
This method is used to destroy a unit living in this project. All sub-units will be destroyed as well.- Parameters:
unit- unit to destroy- Returns:
- success indicator
-
getBookmarkManager
BookmarkManager getBookmarkManager()Get the bookmark manager.- Returns:
- bookmark manager
-
getInputRecords
List<? extends IInputRecord> getInputRecords()Retrieve the list of inputs processed into the project. Those inputs may or may no longer be present as artifacts.- Returns:
- processed input records
-
findUnits
Convenience method used to retrieve units of the project by their class type.- Parameters:
unitClazz-unittype- Returns:
- a list of units, potentially empty
-
findUnit
Convenience method used to retrieve a unit of the project by its class type. The first retrieved unit is returned.- Parameters:
unitClazz-unittype- Returns:
- a unit or null
-