org.apache.jdo.impl.fostore
Class Dumper

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.Dumper

public class Dumper
extends java.lang.Object

Provides information such as metadata, extents, objects about the store.

 FOStore dumper program usage:
     -DdumpOption=OPTION -DclassNames=CLASSNAMES
 OPTION parameter can be one of the following:
     dbInfo: prints general information about the store.
     classMetadata: prints the metadata for the classes CLASSNAMES.
     classInstances: prints all instances of the classes CLASSNAMES.
     classSubclasses: prints all information about the subclasses 
     of the classes CLASSNAMES.
 
This class is public because it has a main entry point for running as a standalone program.

Author:
Markus Fuchs, Dave Bristor

Nested Class Summary
(package private) static class Dumper.ClassInstancesRequest
          DumpRequest that dumps information about the instances of a class.
(package private) static class Dumper.ClassMetadataRequest
          DumpRequest that dumps metadata about a class.
(package private) static class Dumper.ClassRequest
          Abstract DumpRequest that assists in dumping information about classes.
(package private) static class Dumper.ClassSubclassesRequest
          DumpRequest that dumps information about the subclasses of a class.
(package private) static class Dumper.DBInfoRequest
          DumpRequest that can dump DBInfo.
(package private) static class Dumper.DumpOptionSubRequest
          Abstract class for dumping database information.
 
Field Summary
private static java.lang.String classNames
          Class names to dump informations about.
private static org.apache.jdo.util.I18NHelper msg
          I18N support.
private static java.util.HashMap optionTable
          Maps DumpOptions to DumpOptionSubRequests.
private static FOStorePMF pmf
           
 
Constructor Summary
Dumper()
           
 
Method Summary
private static void exit(java.lang.String message)
          Print an error message and exit.
static void main(java.lang.String[] args)
          Given a command line argument that specifies what information to dump, gets that information from the database and prints it on standard output.
private static void println(java.lang.String s)
          Print a message on the standard output.
private static void setupPMF()
          Configures a PMF with some basic properties, and creates the corresponding database.
private static void usage()
          Print the usage message on standard output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

optionTable

private static final java.util.HashMap optionTable
Maps DumpOptions to DumpOptionSubRequests. The option table must match the optionTable in DumpHandler.

Because there is no non-static state to be shared between Dumper and the DumpOptionSubRequests, the optionTable can be initilialzed only once.

See Also:
DumpOption

pmf

private static FOStorePMF pmf

classNames

private static java.lang.String classNames
Class names to dump informations about.


msg

private static final org.apache.jdo.util.I18NHelper msg
I18N support.

Constructor Detail

Dumper

public Dumper()
Method Detail

main

public static void main(java.lang.String[] args)
Given a command line argument that specifies what information to dump, gets that information from the database and prints it on standard output.

Parameters:
args - the command line arguments

exit

private static void exit(java.lang.String message)
Print an error message and exit.


usage

private static void usage()
Print the usage message on standard output.


setupPMF

private static void setupPMF()
                      throws java.lang.Exception
Configures a PMF with some basic properties, and creates the corresponding database.

Throws:
java.lang.Exception

println

private static void println(java.lang.String s)
Print a message on the standard output.

Parameters:
s - the message to print.