openr66.database.data
Class DbHostAuth

java.lang.Object
  extended by goldengate.common.database.data.AbstractDbData
      extended by openr66.database.data.DbHostAuth

public class DbHostAuth
extends goldengate.common.database.data.AbstractDbData

Host Authentication Table object

Author:
Frederic Bregier

Nested Class Summary
static class DbHostAuth.Columns
           
 
Nested classes/interfaces inherited from class goldengate.common.database.data.AbstractDbData
goldengate.common.database.data.AbstractDbData.UpdatedInfo
 
Field Summary
static int[] dbTypes
           
protected static String insertAllValues
           
static int NBPRKEY
           
protected static String selectAllFields
           
static String table
           
protected static String updateAllFields
           
 
Fields inherited from class goldengate.common.database.data.AbstractDbData
allFields, dbSession, isSaved, otherFields, primaryKey
 
Constructor Summary
DbHostAuth(goldengate.common.database.DbSession dbSession, String hostid)
           
DbHostAuth(goldengate.common.database.DbSession dbSession, String hostid, String address, int port, boolean isSSL, byte[] hostkey, boolean adminrole, boolean isClient)
           
 
Method Summary
 void changeUpdatedInfo(goldengate.common.database.data.AbstractDbData.UpdatedInfo info)
           
 void delete()
           
static DbHostAuth[] deleteAll(goldengate.common.database.DbSession dbSession)
          Delete all entries (used when purge and reload)
 boolean exist()
           
 String getAddress()
           
static DbHostAuth[] getAllHosts(goldengate.common.database.DbSession dbSession)
          Get All DbHostAuth from database or from internal hashMap in case of no database support
static goldengate.common.database.DbPreparedStatement getFilterPrepareStament(goldengate.common.database.DbSession session, String host, String addr, boolean ssl)
           
static DbHostAuth getFromStatement(goldengate.common.database.DbPreparedStatement preparedStatement)
          For instance from Commander when getting updated information
 String getHostid()
           
 byte[] getHostkey()
           
protected  String getInsertAllValues()
           
 int getPort()
           
protected  String getSelectAllFields()
           
 SocketAddress getSocketAddress()
           
protected  String getTable()
           
protected  String getUpdateAllFields()
           
static goldengate.common.database.DbPreparedStatement getUpdatedPrepareStament(goldengate.common.database.DbSession session)
           
protected  String getWherePrimaryKey()
           
protected  void initObject()
           
 void insert()
           
 boolean isAdminrole()
           
 boolean isClient()
          Test if the address is 0.0.0.0 for a client or isClient
 boolean isKeyValid(byte[] newkey)
          Is the given key a valid one
 boolean isNoAddress()
          True if the address is a client address (0.0.0.0)
 boolean isSsl()
           
 void select()
           
protected  void setFromArray()
           
protected  void setPrimaryKey()
           
protected  void setToArray()
           
 String toSpecializedHtml(R66Session session, String body, boolean crypted)
           
 String toString()
           
 void update()
           
 
Methods inherited from class goldengate.common.database.data.AbstractDbData
get, getTrueValue, getValue, getValues, setTrueValue, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dbTypes

public static final int[] dbTypes

table

public static final String table
See Also:
Constant Field Values

NBPRKEY

public static final int NBPRKEY
See Also:
Constant Field Values

selectAllFields

protected static final String selectAllFields

updateAllFields

protected static final String updateAllFields

insertAllValues

protected static final String insertAllValues
See Also:
Constant Field Values
Constructor Detail

DbHostAuth

public DbHostAuth(goldengate.common.database.DbSession dbSession,
                  String hostid,
                  String address,
                  int port,
                  boolean isSSL,
                  byte[] hostkey,
                  boolean adminrole,
                  boolean isClient)
Parameters:
dbSession -
hostid -
address -
port -
isSSL -
hostkey -
adminrole -
isClient -

DbHostAuth

public DbHostAuth(goldengate.common.database.DbSession dbSession,
                  String hostid)
           throws goldengate.common.database.exception.GoldenGateDatabaseException
Parameters:
dbSession -
hostid -
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException
Method Detail

initObject

protected void initObject()
Specified by:
initObject in class goldengate.common.database.data.AbstractDbData

getSelectAllFields

protected String getSelectAllFields()
Specified by:
getSelectAllFields in class goldengate.common.database.data.AbstractDbData

getTable

protected String getTable()
Specified by:
getTable in class goldengate.common.database.data.AbstractDbData

getInsertAllValues

protected String getInsertAllValues()
Specified by:
getInsertAllValues in class goldengate.common.database.data.AbstractDbData

getUpdateAllFields

protected String getUpdateAllFields()
Specified by:
getUpdateAllFields in class goldengate.common.database.data.AbstractDbData

setToArray

protected void setToArray()
Specified by:
setToArray in class goldengate.common.database.data.AbstractDbData

setFromArray

protected void setFromArray()
                     throws goldengate.common.database.exception.GoldenGateDatabaseSqlException
Specified by:
setFromArray in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getWherePrimaryKey

protected String getWherePrimaryKey()
Specified by:
getWherePrimaryKey in class goldengate.common.database.data.AbstractDbData

setPrimaryKey

protected void setPrimaryKey()
Specified by:
setPrimaryKey in class goldengate.common.database.data.AbstractDbData

deleteAll

public static DbHostAuth[] deleteAll(goldengate.common.database.DbSession dbSession)
                              throws goldengate.common.database.exception.GoldenGateDatabaseException
Delete all entries (used when purge and reload)

Parameters:
dbSession -
Returns:
the previous existing array of DbRule
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

delete

public void delete()
            throws goldengate.common.database.exception.GoldenGateDatabaseException
Overrides:
delete in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

insert

public void insert()
            throws goldengate.common.database.exception.GoldenGateDatabaseException
Overrides:
insert in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

exist

public boolean exist()
              throws goldengate.common.database.exception.GoldenGateDatabaseException
Overrides:
exist in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

select

public void select()
            throws goldengate.common.database.exception.GoldenGateDatabaseException
Overrides:
select in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

update

public void update()
            throws goldengate.common.database.exception.GoldenGateDatabaseException
Overrides:
update in class goldengate.common.database.data.AbstractDbData
Throws:
goldengate.common.database.exception.GoldenGateDatabaseException

getAllHosts

public static DbHostAuth[] getAllHosts(goldengate.common.database.DbSession dbSession)
                                throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                       goldengate.common.database.exception.GoldenGateDatabaseSqlException
Get All DbHostAuth from database or from internal hashMap in case of no database support

Parameters:
dbSession - may be null
Returns:
the array of DbHostAuth
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getFromStatement

public static DbHostAuth getFromStatement(goldengate.common.database.DbPreparedStatement preparedStatement)
                                   throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                          goldengate.common.database.exception.GoldenGateDatabaseSqlException
For instance from Commander when getting updated information

Parameters:
preparedStatement -
Returns:
the next updated DbHostAuth
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getUpdatedPrepareStament

public static goldengate.common.database.DbPreparedStatement getUpdatedPrepareStament(goldengate.common.database.DbSession session)
                                                                               throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                      goldengate.common.database.exception.GoldenGateDatabaseSqlException
Returns:
the DbPreparedStatement for getting Updated Object
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

getFilterPrepareStament

public static goldengate.common.database.DbPreparedStatement getFilterPrepareStament(goldengate.common.database.DbSession session,
                                                                                     String host,
                                                                                     String addr,
                                                                                     boolean ssl)
                                                                              throws goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException,
                                                                                     goldengate.common.database.exception.GoldenGateDatabaseSqlException
Parameters:
session -
host -
addr -
ssl -
Returns:
the DbPreparedStatement according to the filter
Throws:
goldengate.common.database.exception.GoldenGateDatabaseNoConnectionException
goldengate.common.database.exception.GoldenGateDatabaseSqlException

changeUpdatedInfo

public void changeUpdatedInfo(goldengate.common.database.data.AbstractDbData.UpdatedInfo info)
Specified by:
changeUpdatedInfo in class goldengate.common.database.data.AbstractDbData

isKeyValid

public boolean isKeyValid(byte[] newkey)
Is the given key a valid one

Parameters:
newkey -
Returns:
True if the key is valid (or any key is valid)

getHostkey

public byte[] getHostkey()
Returns:
the hostkey

isAdminrole

public boolean isAdminrole()
Returns:
the adminrole

isClient

public boolean isClient()
Test if the address is 0.0.0.0 for a client or isClient

Returns:
True if the address is a client address (0.0.0.0) or isClient

isNoAddress

public boolean isNoAddress()
True if the address is a client address (0.0.0.0)

Returns:
True if the address is a client address (0.0.0.0)

getSocketAddress

public SocketAddress getSocketAddress()
Returns:
the SocketAddress from the address and port

isSsl

public boolean isSsl()
Returns:
True if this Host ref is with SSL support

getHostid

public String getHostid()
Returns:
the hostid

getAddress

public String getAddress()
Returns:
the address

getPort

public int getPort()
Returns:
the port

toString

public String toString()
Overrides:
toString in class Object

toSpecializedHtml

public String toSpecializedHtml(R66Session session,
                                String body,
                                boolean crypted)
Parameters:
session -
body -
crypted - True if the Key is kept crypted, False it will be in clear form
Returns:
the runner in Html format specified by body by replacing all instance of fields


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