Interface IRuntimeProject

All Superinterfaces:
IEventSource, IUserDataSupport

public interface IRuntimeProject extends IEventSource, IUserDataSupport
A runtime project represents a loaded instance of a JEB project.
  • Field Details

  • 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 an IEnginesContext.
      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 JDB2 PersistenceStrategy currently used by this project.
      Returns:
    • setPersistenceStrategy

      void setPersistenceStrategy(int strategy)
      This convenience routine is used to set the JDB2 PersistenceStrategy 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

      void setName(String name)
      Retrieve this project name.
      Parameters:
      name -
    • getNotes

      String getNotes()
      Retrieve the user notes.
      Returns:
    • setNotes

      void setNotes(String notes)
      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 the managing context's unload() method.
    • isClosed

      boolean isClosed()
      Returns:
    • processArtifact

      ILiveArtifact processArtifact(IArtifact artifact)
      Process an artifact into this project.
      Parameters:
      artifact - an Artifact, likely backed by a file
      Returns:
      an artifact living in the project, likely to hold one or more parent units
    • processArtifact

      ILiveArtifact processArtifact(IArtifact artifact, String wantedType, boolean softDelegation, boolean doNotProcessUnit)
      Process an artifact into this project.
      Parameters:
      artifact - an Artifact, likely backed by a file
      wantedType - leave null to let the parser determine the type of artifact; see IUnitProcessor for details
      softDelegation - prefer soft delegation and avoid creating generic unit if the input type was undetermined; see IUnitProcessor for details
      doNotProcessUnit - 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

      void finishArtifactProcessing(ILiveArtifact a)
      If the artifacts were processed with doNoProcessUnit 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 to process(...)
    • getLiveArtifacts

      List<ILiveArtifact> getLiveArtifacts()
      Retrieve the list of artifacts managed by this project.
      Returns:
    • getLiveArtifact

      ILiveArtifact getLiveArtifact(int index)
      Retrieve a live artifact by index.
      Parameters:
      index -
      Returns:
    • getArtifactCount

      int getArtifactCount()
      Retrieve the count of artifacts living in this project.
      Returns:
    • destroyUnit

      boolean destroyUnit(IUnit unit)
      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

      <T extends IUnit> List<T> findUnits(Class<T> unitClazz)
      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

      <T extends IUnit> T findUnit(Class<T> unitClazz)
      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