openr66.configuration
Class RuleFileBasedConfiguration

java.lang.Object
  extended by openr66.configuration.RuleFileBasedConfiguration

public class RuleFileBasedConfiguration
extends Object

Rule File Based Configuration

Author:
Frederic Bregier

Field Summary
static String EXT_RULE
          Extension of rule files
static String EXT_RULES
          Extension of multiple rules in one file
static goldengate.common.xml.XmlDecl[] hostsDecls
           
static goldengate.common.xml.XmlDecl[] tasksDecl
           
static String XHOSTID
           
static String XHOSTIDS
           
static String XTASK
           
static String XTASKS
           
 
Constructor Summary
RuleFileBasedConfiguration()
           
 
Method Summary
static DbRule getFromFile(File file)
          Load and update a Rule from a file
static String[] getHostIds(goldengate.common.xml.XmlValue value)
           
static List<DbRule> getMultipleFromFile(File file)
          Load and update multiple Rules from one file
static String[][] getTasksRule(goldengate.common.xml.XmlValue value)
          Utility function
static void importRules(File configDirectory)
          Import all Rule files into the HashTable of Rules
static String writeOneXml(String directory, String hostname)
          Write to directory 1 file prefixed by hostname all Rules from database
static void writeXml(String directory, String hostname)
          Write to directory files prefixed by hostname all Rules from database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XHOSTIDS

public static final String XHOSTIDS
See Also:
Constant Field Values

XHOSTID

public static final String XHOSTID
See Also:
Constant Field Values

XTASKS

public static final String XTASKS
See Also:
Constant Field Values

XTASK

public static final String XTASK
See Also:
Constant Field Values

tasksDecl

public static final goldengate.common.xml.XmlDecl[] tasksDecl

hostsDecls

public static final goldengate.common.xml.XmlDecl[] hostsDecls

EXT_RULE

public static final String EXT_RULE
Extension of rule files

See Also:
Constant Field Values

EXT_RULES

public static final String EXT_RULES
Extension of multiple rules in one file

See Also:
Constant Field Values
Constructor Detail

RuleFileBasedConfiguration

public RuleFileBasedConfiguration()
Method Detail

importRules

public static void importRules(File configDirectory)
                        throws OpenR66ProtocolSystemException,
                               goldengate.common.database.exception.GoldenGateDatabaseException
Import all Rule files into the HashTable of Rules

Parameters:
configDirectory -
Throws:
OpenR66ProtocolSystemException
goldengate.common.database.exception.GoldenGateDatabaseException

getTasksRule

public static String[][] getTasksRule(goldengate.common.xml.XmlValue value)
Utility function

Parameters:
value -
Returns:
the array of tasks or empty array if in error.

getHostIds

public static String[] getHostIds(goldengate.common.xml.XmlValue value)
Parameters:
value - the XmlValue hosting hostids/hostid
Returns:
the array of HostIds allowed for the current rule

getFromFile

public static DbRule getFromFile(File file)
                          throws OpenR66ProtocolSystemException,
                                 goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                 goldengate.common.database.exception.GoldenGateDatabaseSqlException,
                                 goldengate.common.database.exception.GoldenGateDatabaseNoDataException,
                                 goldengate.common.database.exception.GoldenGateDatabaseException
Load and update a Rule from a file

Parameters:
file -
Returns:
the newly created R66Rule from XML File
Throws:
OpenR66ProtocolSystemException
goldengate.common.database.exception.GoldenGateDatabaseException
goldengate.common.database.exception.GoldenGateDatabaseNoDataException
goldengate.common.database.exception.GoldenGateDatabaseSqlException
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
OpenR66ProtocolNoDataException

getMultipleFromFile

public static List<DbRule> getMultipleFromFile(File file)
                                        throws OpenR66ProtocolSystemException,
                                               goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                               goldengate.common.database.exception.GoldenGateDatabaseSqlException,
                                               goldengate.common.database.exception.GoldenGateDatabaseNoDataException,
                                               goldengate.common.database.exception.GoldenGateDatabaseException
Load and update multiple Rules from one file

Parameters:
file -
Returns:
a list of newly created R66Rule from XML File
Throws:
OpenR66ProtocolSystemException
goldengate.common.database.exception.GoldenGateDatabaseException
goldengate.common.database.exception.GoldenGateDatabaseNoDataException
goldengate.common.database.exception.GoldenGateDatabaseSqlException
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
OpenR66ProtocolNoDataException

writeXml

public static final void writeXml(String directory,
                                  String hostname)
                           throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                  goldengate.common.database.exception.GoldenGateDatabaseSqlException,
                                  OpenR66ProtocolSystemException
Write to directory files prefixed by hostname all Rules from database

Parameters:
directory -
hostname -
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException
OpenR66ProtocolSystemException

writeOneXml

public static String writeOneXml(String directory,
                                 String hostname)
                          throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                 goldengate.common.database.exception.GoldenGateDatabaseSqlException,
                                 OpenR66ProtocolSystemException
Write to directory 1 file prefixed by hostname all Rules from database

Parameters:
directory -
hostname -
Returns:
the filename
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException
OpenR66ProtocolSystemException


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.