de.bsvrz.ars.ars.persistence
Class ConsistencyCheck

java.lang.Object
  extended by de.bsvrz.ars.ars.persistence.ConsistencyCheck

public class ConsistencyCheck
extends Object

Mit den statischen Methoden dieser Klasse können die Container in einem Verzeichnis geprüft werden.

simpleCheck prüft dabei nur die Container-Header, extendedCheck überprüft auch die Nutzdaten.

Author:
beck et al. projects GmbH, Phil Schrettenbrunner

Field Summary
private static int DII_DIMAX
           
private static int DII_DIMIN
          Array Index für DataIndexIndex
private static int DTI_DIMAX
           
private static int DTI_DIMIN
           
private static int DTI_DTMAX
           
private static int DTI_DTMIN
          Array Index für DataTimeIndex
static int ERROR
           
private static int MON_ATMAX
           
private static int MON_ATMIN
           
private static int MON_DIMAX
           
private static int MON_DIMIN
          Array Index für MonotoneIndex
private static int MON_DTMAX
           
private static int MON_DTMIN
           
static int OK
           
private static Pattern SimVarPattern
           
static int WARN
           
 
Constructor Summary
ConsistencyCheck()
           
 
Method Summary
private static int check(File dir, Debug logger, boolean doExtendedCheck)
           
private static int checkHdrConsistency(ContainerDataIterator iter, File file, Debug logger)
           
static int extendedCheck(File dir, Debug logger)
          Prüft alle Container (Header und Body) im angegebenen Verzeichnis.
static int extendedCheckRecursive(File baseDir, Debug logger)
           
private static long extractId(String id, File path)
           
private static String hashMapToString(HashMap<Long,long[]> hashMap)
           
private static HashMap<Long,long[]> loadDataIndexeIdx(File indexFile)
           
private static HashMap<Long,long[]> loadDataTimeIdx(File indexFile)
           
private static HashMap<Long,long[]> loadMonotoneIndex(File indexFile)
           
private static void logError(Debug logger, String msg)
           
private static void logFine(Debug logger, String msg)
           
private static void logFiner(Debug logger, String msg)
           
private static void logFinest(Debug logger, String msg)
           
static int simpleCheck(File dir, Debug logger)
          Prüft alle Container-Header im angegebenen Verzeichnis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
See Also:
Constant Field Values

WARN

public static final int WARN
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

SimVarPattern

private static final Pattern SimVarPattern

MON_DIMIN

private static final int MON_DIMIN
Array Index für MonotoneIndex

See Also:
Constant Field Values

MON_DIMAX

private static final int MON_DIMAX
See Also:
Constant Field Values

MON_ATMIN

private static final int MON_ATMIN
See Also:
Constant Field Values

MON_ATMAX

private static final int MON_ATMAX
See Also:
Constant Field Values

MON_DTMIN

private static final int MON_DTMIN
See Also:
Constant Field Values

MON_DTMAX

private static final int MON_DTMAX
See Also:
Constant Field Values

DTI_DTMIN

private static final int DTI_DTMIN
Array Index für DataTimeIndex

See Also:
Constant Field Values

DTI_DTMAX

private static final int DTI_DTMAX
See Also:
Constant Field Values

DTI_DIMIN

private static final int DTI_DIMIN
See Also:
Constant Field Values

DTI_DIMAX

private static final int DTI_DIMAX
See Also:
Constant Field Values

DII_DIMIN

private static final int DII_DIMIN
Array Index für DataIndexIndex

See Also:
Constant Field Values

DII_DIMAX

private static final int DII_DIMAX
See Also:
Constant Field Values
Constructor Detail

ConsistencyCheck

public ConsistencyCheck()
Method Detail

simpleCheck

public static int simpleCheck(File dir,
                              Debug logger)
Prüft alle Container-Header im angegebenen Verzeichnis.

Dabei wird geprüft

Parameters:
dir - Das Verzeichnis, in dem die Container-Header geprüft werden.
logger - Logger, auf dem Meldungen ausgegeben werden sollen
Returns:
Binärwert, der angibt, ob alles OK war, ob Warnungen oder Fehler aufgetreten sind. (OK, WARN, ERROR und WARN/ERROR)

extendedCheck

public static int extendedCheck(File dir,
                                Debug logger)
Prüft alle Container (Header und Body) im angegebenen Verzeichnis.

Dabei wird geprüft

Parameters:
dir - Das Verzeichnis, in dem die Container geprüft werden.
logger - Logger, auf dem Meldungen ausgegeben werden sollen oder null falls keine Meldungen ausgegeben werden sollen.
Returns:
Binärwert, der angibt, ob alles OK war, ob Warnungen oder Fehler aufgetreten sind. (OK, WARN, ERROR und WARN/ERROR)

extendedCheckRecursive

public static int extendedCheckRecursive(File baseDir,
                                         Debug logger)

check

private static int check(File dir,
                         Debug logger,
                         boolean doExtendedCheck)

checkHdrConsistency

private static int checkHdrConsistency(ContainerDataIterator iter,
                                       File file,
                                       Debug logger)

loadMonotoneIndex

private static HashMap<Long,long[]> loadMonotoneIndex(File indexFile)
                                               throws IOException
Throws:
IOException

loadDataTimeIdx

private static HashMap<Long,long[]> loadDataTimeIdx(File indexFile)
                                             throws IOException
Throws:
IOException

loadDataIndexeIdx

private static HashMap<Long,long[]> loadDataIndexeIdx(File indexFile)
                                               throws IOException
Throws:
IOException

hashMapToString

private static String hashMapToString(HashMap<Long,long[]> hashMap)

extractId

private static long extractId(String id,
                              File path)

logError

private static void logError(Debug logger,
                             String msg)

logFine

private static void logFine(Debug logger,
                            String msg)

logFiner

private static void logFiner(Debug logger,
                             String msg)

logFinest

private static void logFinest(Debug logger,
                              String msg)