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 TypeMethodDescriptionvoid
close()
Close this project.boolean
destroyUnit
(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.void
If the artifacts wereprocessed
withdoNoProcessUnit
set to true, this method may be called afterward to finish processing to process all top-level units yielded by the artifact.int
Retrieve the count of artifacts living in this project.Get the bookmark manager.long
Retrieve 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.int
This convenience routine is used to retrieve the JDB2PersistenceStrategy
currently 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.long
Retrieve the last time this project was saved to JDB2.long
Retrieve the duration this project has been opened JEB since it's been last opened.boolean
isClosed()
boolean
Determine 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.void
Retrieve this project name.void
Set or update the user notes.void
setPersistenceStrategy
(int strategy) This convenience routine is used to set the JDB2PersistenceStrategy
currently used by this project.Methods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSource
Methods 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:
-
getPropertyDefinitionManager
IPropertyDefinitionManager getPropertyDefinitionManager()Get the PDM of this project. Each project has it own PDM.- Returns:
-
getPropertyManager
IPropertyManager getPropertyManager()Get the PM of this project. Each project has its own PM.- Returns:
-
getKey
String getKey()Retrieve this project key, used to uniquely identify a project within anIEnginesContext
.- Returns:
-
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:
-
getPersistenceStrategy
int getPersistenceStrategy()This convenience routine is used to retrieve the JDB2PersistenceStrategy
currently used by this project.- Returns:
-
setPersistenceStrategy
void setPersistenceStrategy(int strategy) This convenience routine is used to set the JDB2PersistenceStrategy
currently used by this project.- Parameters:
strategy
-
-
isReloaded
boolean isReloaded()Determine whether this project is new (it was created), or was reloaded from a JDB2 database.- Returns:
-
getName
String getName()Set this project name.- Returns:
-
setName
Retrieve this project name.- Parameters:
name
-
-
getNotes
String getNotes()Retrieve the user notes.- Returns:
-
setNotes
Set or update the user notes.- Parameters:
notes
-
-
getProcessor
IUnitProcessor getProcessor()Retrieve the processor (parser) used by this project to process input data and generate units.- Returns:
-
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()- Returns:
-
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 afile
wantedType
- leave null to let the parser determine the type of artifact; seeIUnitProcessor
for detailssoftDelegation
- prefer soft delegation and avoid creating generic unit if the input type was undetermined; seeIUnitProcessor
for 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
unit
s
-
finishArtifactProcessing
If the artifacts wereprocessed
withdoNoProcessUnit
set 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(...)
-
getLiveArtifacts
List<ILiveArtifact> getLiveArtifacts()Retrieve the list of artifacts managed by this project.- Returns:
-
getLiveArtifact
Retrieve a live artifact by index.- Parameters:
index
-- Returns:
-
getArtifactCount
int getArtifactCount()Retrieve the count of artifacts living in this project.- Returns:
-
destroyUnit
This method is used to destroy a unit living in this project. All sub-units will be destroyed as well.- Parameters:
unit
-- Returns:
- success indicator
-
getBookmarkManager
BookmarkManager getBookmarkManager()Get the bookmark manager.- Returns:
-
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:
-
findUnits
Convenience method used to retrieve units of the project by their class type.- Parameters:
unitClazz
-unit
type- 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
-unit
type- Returns:
- a unit or null
-