public class DataManager extends java.lang.Thread implements DataManagerInterface
Geht eine Anfrage über die Methoden addProtocolRequest(ResultData[])
oder addScriptRequest(ResultData[])
ein, so wird diese Anfrage in
einem Ringpuffer abgelegt. Ist der Thread unbeschäftigt, werden sie der Reihe nach (FIFO) abgearbeitet.
Constructor and Description |
---|
DataManager(ClientDavInterface dav,
java.lang.String path,
int quota,
boolean prettyPrinter)
Erzeugen des Data Managers.
|
Modifier and Type | Method and Description |
---|---|
void |
addProtocolRequest(ResultData[] resultData)
Übergeben einer Protokoll-bezogenen Anfrage.
|
void |
addScriptRequest(ResultData[] resultData)
Übergeben einer Skript-bezogenen Anfrage.
|
void |
addScriptRequest(ScriptRequest request)
Übergeben einer Skript-bezogenen Anfrage
|
ProtocolOutputStream |
createProtocolStream(long protocolId,
ProcessingParameter pp)
Erzeugt einen Ausgabestream für ein Protokoll.
|
void |
deleteProtocol(long protocolId)
Löscht ein gespeichertes Protokoll.
|
java.lang.String |
getAbsolutFileNameMeta(SystemObject script)
Liefert Pfad und Dateiname der Metainformation
|
java.lang.String |
getAbsolutFileNameSource(SystemObject script)
Liefert Pfad und Dateiname des Skriptquelltextes
|
java.lang.String |
getFileNameMeta(SystemObject script)
Liefert den Dateinamen der Metainformationen.
|
java.lang.String |
getFileNameSource(SystemObject script)
Liefert den Dateinamen des Skriptquelltexts.
|
AtlMeta |
getMetaInformation(SystemObject script)
Liefert die zum Skript gehörenden Metainformationen.
|
java.lang.String |
getPath()
Gibt den Pfad der Protokoll- und Skriptdateien zurück.
|
ProtocolInputStream |
getSavedProtocol(long protocolId)
Liefert ein Objekt zum Zugriff auf ein gespeichertes Protokoll zurück.
|
ProtocolInputStream |
getUnreadProtocol(long protocolId)
Liefert ein Objekt zum Zugriff auf ein gespeichertes Protokoll zurück.
|
DataManagerRequest[] |
getUpcomingOps(DataManagerRequest[] dmr)
Liefert eine Liste mit anstehenden Aufgaben.
|
boolean |
isUnique(long protocolId)
Überprüft ob es zu der gegebenen Protokoll-Id bereits ein gespeichertes Protokoll gibt.
|
ProcessingInformation |
process(ProcessingParameter parameter)
Startet die Interpretation eines Skriptes:
1. |
ProcessingInformation |
process(java.lang.String source)
Startet die Interpretation eines Skriptes.
|
void |
run()
Arbeitet die Aufträge ab.
|
void |
shutdown()
Fährt den Data-Manager herunter.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public DataManager(ClientDavInterface dav, java.lang.String path, int quota, boolean prettyPrinter) throws FailureException
Thread.start()
gestartet werden.dav
- Verbindung zum Datenverteilerpath
- Pfad unter dem die Dateien (Skriptquelltexte und Protokolldateien) verwaltet werden.quota
- Minimaler verbleibender Speicherplatz auf dem Datenträgern (in MB)prettyPrinter
- Steuert ob der Pretty Printer verwendet werden soll.FailureException
- Falls ein ungültiger Pfad übergeben wird.public ProcessingInformation process(ProcessingParameter parameter) throws FailureException
process
in interface DataManagerInterface
parameter
- AuftragsparameterFailureException
- Fehler beim Interpretieren des Skripts.public AtlMeta getMetaInformation(SystemObject script) throws FailureException
DataManagerInterface
getMetaInformation
in interface DataManagerInterface
script
- Skriptobjekt.null
falls keine Metainformation existiert.FailureException
- Korrupte Metainformation.DataManagerInterface.getMetaInformation(SystemObject)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public boolean isUnique(long protocolId)
isUnique
in interface DataManagerInterface
protocolId
- Protokoll-Idpublic void addScriptRequest(ResultData[] resultData)
addScriptRequest
in interface DataManagerInterface
resultData
- Objekt mit den Anfrageparameternpublic java.lang.String getPath()
DataManagerInterface
File.separator
getPath
in interface DataManagerInterface
DataManagerInterface.getPath()
public ProcessingInformation process(java.lang.String source) throws CriticalParserException
DataManagerInterface
process
in interface DataManagerInterface
source
- Source des SkriptobjektsCriticalParserException
- FehlermeldungDataManagerInterface.process(java.lang.String)
public void addProtocolRequest(ResultData[] resultData)
addProtocolRequest
in interface DataManagerInterface
resultData
- Objekt mit den Anfrageparameternpublic java.lang.String getFileNameSource(SystemObject script)
DataManagerInterface
getFileNameSource
in interface DataManagerInterface
script
- SkriptobjektDataManagerInterface.getFileNameSource(SystemObject)
public java.lang.String getFileNameMeta(SystemObject script)
DataManagerInterface
getFileNameMeta
in interface DataManagerInterface
script
- SkriptobjektDataManagerInterface.getFileNameMeta(SystemObject)
public java.lang.String getAbsolutFileNameMeta(SystemObject script)
DataManagerInterface
getAbsolutFileNameMeta
in interface DataManagerInterface
script
- SkriptobjektDataManagerInterface.getAbsolutFileNameMeta(SystemObject)
public java.lang.String getAbsolutFileNameSource(SystemObject script)
DataManagerInterface
getAbsolutFileNameSource
in interface DataManagerInterface
script
- SkriptobjektDataManagerInterface.getAbsolutFileNameSource(SystemObject)
public void addScriptRequest(ScriptRequest request)
DataManagerInterface
addScriptRequest
in interface DataManagerInterface
request
- AnfrageDataManagerInterface.addScriptRequest(de.bsvrz.pua.prot.manager.requests.ScriptRequest)
public void shutdown()
DataManagerInterface
shutdown
in interface DataManagerInterface
DataManagerInterface.shutdown()
public void deleteProtocol(long protocolId) throws NoncriticalException
DataManagerInterface
deleteProtocol
in interface DataManagerInterface
NoncriticalException
- Fehler beim Löschen.DataManagerInterface.deleteProtocol(long)
public ProtocolInputStream getSavedProtocol(long protocolId) throws FailureException
DataManagerInterface
getSavedProtocol
in interface DataManagerInterface
protocolId
- Id des Protokolls, das gelesen werden soll.FailureException
- Fehler.DataManagerInterface.getSavedProtocol(long)
public ProtocolInputStream getUnreadProtocol(long protocolId) throws FailureException
DataManagerInterface
getUnreadProtocol
in interface DataManagerInterface
protocolId
- Id des Protokolls, das gelesen werden soll.FailureException
- Fehler.DataManagerInterface.getUnreadProtocol(long)
public ProtocolOutputStream createProtocolStream(long protocolId, ProcessingParameter pp) throws NoncriticalException
DataManagerInterface
createProtocolStream
in interface DataManagerInterface
protocolId
- Protokoll-Id.pp
- Auftragsparameter.NoncriticalException
- Die Datei kann nicht angelegt werden; Fehler beim Schreiben der Protokollinformationen.DataManagerInterface.createProtocolStream(long,de.bsvrz.pua.prot.util.ProcessingParameter)
public DataManagerRequest[] getUpcomingOps(DataManagerRequest[] dmr)
DataManagerInterface
getUpcomingOps
in interface DataManagerInterface
dmr
- Array, in den das Ergebnis kopiert wird. Ist der Array zu klein, so wird ein neuer Array angelegt.DataManagerInterface.getUpcomingOps(DataManagerRequest[])