public class DbHostConfiguration extends AbstractDbDataDao<Business>
Modifier and Type | Class and Description |
---|---|
static class |
DbHostConfiguration.Columns |
static class |
DbHostConfiguration.OtherFields |
AbstractDbData.UpdatedInfo
Modifier and Type | Field and Description |
---|---|
static XmlDecl[] |
configAliasDecls
Structure of the Configuration file
|
static XmlDecl[] |
configRoleDecls
Structure of the Configuration file
|
static int[] |
dbTypes |
protected static String |
insertAllValues |
static int |
NBPRKEY |
protected static String |
selectAllFields |
static String |
table |
protected static String |
updateAllFields |
static String |
XML_ALIAS
Alias
|
static String |
XML_ALIASES |
static String |
XML_ALIASID
Alias Id
|
static String |
XML_BUSINESS |
static String |
XML_BUSINESSID
Check version in protocol
|
static String |
XML_REALID
Main ID in alias
|
static String |
XML_ROLE
Role Main entry
|
static String |
XML_ROLEID
ID in role
|
static String |
XML_ROLES |
static String |
XML_ROLESET
Role set
|
JSON_MODEL, pojo
allFields, dbSession, isSaved, otherFields, primaryKey
Constructor and Description |
---|
DbHostConfiguration(Business business) |
DbHostConfiguration(com.fasterxml.jackson.databind.node.ObjectNode source)
Constructor from Json
|
DbHostConfiguration(String hostid) |
DbHostConfiguration(String hostid,
String business,
String roles,
String aliases,
String others) |
Modifier and Type | Method and Description |
---|---|
void |
changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
Change UpdatedInfo status
|
String |
getAliases() |
String |
getBusiness() |
protected AbstractDAO<Business> |
getDao() |
static DbPreparedStatement |
getFilterPrepareStament(DbSession session,
String hostid,
String business,
String role,
String alias,
String other) |
static DbHostConfiguration |
getFromStatement(DbPreparedStatement preparedStatement)
For instance from Commander when getting updated information
|
String |
getHostid() |
org.dom4j.Element |
getOtherElement() |
String |
getOthers() |
protected String |
getPrimaryField() |
protected String |
getPrimaryKey() |
String |
getRoles() |
protected String |
getTable() |
static DbHostConfiguration[] |
getUpdatedPrepareStament() |
static String |
getVersionDb(String hostid) |
protected void |
initObject()
To setup primaryKey, otherFields, allFields.
|
boolean |
isOwnConfiguration() |
boolean |
isSeeAllId(String id) |
void |
setAliases(String aliases) |
void |
setBusiness(String business) |
protected void |
setFromJson(String field,
com.fasterxml.jackson.databind.JsonNode value) |
void |
setOtherElement(org.dom4j.Element element) |
void |
setOthers(String others) |
void |
setRoles(String roles) |
boolean |
updateAlias(Configuration config,
String newalias,
boolean purged)
update Alias with possible purge and new or added content, and updating
in
memory information
|
boolean |
updateBusiness(Configuration config,
String newbusiness,
boolean purged)
update Business with possible purge and new or added content, and
updating
in memory information
|
void |
updateConfiguration()
Update configuration according to new values
|
void |
updateFromConfiguration(Configuration configuration)
Update the DbHostConfiguration from Configuration
|
static void |
updateHostConfiguration(Configuration config,
DbHostConfiguration hostConfiguration) |
boolean |
updateRoles(Configuration config,
String newroles,
boolean purged)
update Roles with possible purge and new or added content, and updating
in
memory information
|
static void |
updateVersionDb(String hostid,
String version)
Update the version for this HostId
|
asJson, delete, exist, getInsertAllValues, getJson, getSelectAllFields, getUpdateAllFields, getValues, getWherePrimaryKey, insert, select, setFromArray, setFromJson, setPrimaryKey, setToArray, toJson, update
get, getAllFields, getTrueValue, getValue, setTrueValue, setValue, setValues
public static final int[] dbTypes
public static final String table
public static final String XML_ALIASES
public static final String XML_ROLES
public static final String XML_BUSINESS
public static final String XML_ALIASID
public static final String XML_REALID
public static final String XML_ALIAS
public static final String XML_ROLESET
public static final String XML_ROLEID
public static final String XML_ROLE
public static final String XML_BUSINESSID
public static final XmlDecl[] configRoleDecls
public static final XmlDecl[] configAliasDecls
public static final int NBPRKEY
protected static final String selectAllFields
protected static final String updateAllFields
protected static final String insertAllValues
public DbHostConfiguration(String hostid, String business, String roles, String aliases, String others)
hostid
- business
- Business configurationroles
- Roles configurationaliases
- Aliases configurationothers
- Other configurationpublic DbHostConfiguration(Business business)
public DbHostConfiguration(com.fasterxml.jackson.databind.node.ObjectNode source) throws WaarpDatabaseSqlException
source
- WaarpDatabaseSqlException
public DbHostConfiguration(String hostid) throws WaarpDatabaseException
hostid
- WaarpDatabaseException
protected void initObject()
AbstractDbData
initObject
in class AbstractDbDataDao<Business>
protected String getTable()
getTable
in class AbstractDbDataDao<Business>
protected AbstractDAO<Business> getDao() throws DAOConnectionException
getDao
in class AbstractDbDataDao<Business>
DAOConnectionException
protected String getPrimaryKey()
getPrimaryKey
in class AbstractDbDataDao<Business>
protected String getPrimaryField()
getPrimaryField
in class AbstractDbDataDao<Business>
public String getHostid()
public String getBusiness()
public void setBusiness(String business)
business
- the business to setpublic String getRoles()
public void setRoles(String roles)
roles
- the roles to setpublic String getAliases()
public void setAliases(String aliases)
aliases
- the aliases to setpublic String getOthers()
public void setOthers(String others)
others
- the others to setpublic org.dom4j.Element getOtherElement()
public void setOtherElement(org.dom4j.Element element)
element
- the element to set as XML string to other partprotected void setFromJson(String field, com.fasterxml.jackson.databind.JsonNode value)
setFromJson
in class AbstractDbDataDao<Business>
public static DbHostConfiguration getFromStatement(DbPreparedStatement preparedStatement) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbHostConfiguration[] getUpdatedPrepareStament() throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbPreparedStatement getFilterPrepareStament(DbSession session, String hostid, String business, String role, String alias, String other) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- hostid
- business
- role
- alias
- other
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
AbstractDbDataDao
changeUpdatedInfo
in class AbstractDbDataDao<Business>
public void updateConfiguration()
public boolean isOwnConfiguration()
public boolean updateBusiness(Configuration config, String newbusiness, boolean purged)
config
- newbusiness
- purged
- public void updateFromConfiguration(Configuration configuration)
configuration
- public boolean updateAlias(Configuration config, String newalias, boolean purged)
config
- newalias
- purged
- public boolean updateRoles(Configuration config, String newroles, boolean purged)
config
- newroles
- purged
- public static void updateHostConfiguration(Configuration config, DbHostConfiguration hostConfiguration)
public static String getVersionDb(String hostid)
hostid
- public boolean isSeeAllId(String id)
Copyright © 2009–2020 Waarp. All rights reserved.