public class DbRule extends AbstractDbDataDao<Rule>
Modifier and Type | Class and Description |
---|---|
static class |
DbRule.Columns |
AbstractDbData.UpdatedInfo
Modifier and Type | Field and Description |
---|---|
static int[] |
dbTypes |
protected static String |
insertAllValues |
static int |
NBPRKEY |
protected static String |
selectAllFields |
static String |
table |
static String |
TASK_COMMENT
Internal context XML fields
|
static String |
TASK_DELAY
Internal context XML fields
|
static String |
TASK_PATH
Internal context XML fields
|
static String |
TASK_TYPE
Internal context XML fields
|
protected static String |
updateAllFields |
JSON_MODEL, pojo
allFields, dbSession, isSaved, otherFields, primaryKey
Constructor and Description |
---|
DbRule(com.fasterxml.jackson.databind.node.ObjectNode source)
Constructor from Json
|
DbRule(Rule rule) |
DbRule(String idRule) |
DbRule(String idrule,
String[] idsArrayRef,
int mode,
String recvpath,
String sendpath,
String archivepath,
String workpath,
String[][] rpretasksArray,
String[][] rposttasksArray,
String[][] rerrortasksArray,
String[][] spretasksArray,
String[][] sposttasksArray,
String[][] serrortasksArray)
Constructor used from XML file
|
DbRule(String idRule,
String ids,
int mode,
String recvPath,
String sendPath,
String archivePath,
String workPath,
String rpreTasks,
String rpostTasks,
String rerrorTasks,
String spreTasks,
String spostTasks,
String serrorTasks) |
Modifier and Type | Method and Description |
---|---|
void |
changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
Change UpdatedInfo status
|
boolean |
checkHostAllow(String hostId)
Check if the given hostTo is in the allowed list
|
protected void |
checkPath() |
void |
delete()
Delete object from table DbRule only if no DbTaskRunner is using it.
|
static DbRule[] |
deleteAll()
Delete all Rules but returns original one, therefore not checking if
any TaskRunner are using it (used by reloading rules)
|
static DbRule[] |
getAllRules()
Get All DbRule from database or from internal hashMap in case of no
database support
|
String |
getArchivePath() |
protected AbstractDAO<Rule> |
getDao() |
static DbPreparedStatement |
getFilterPrepareStament(DbSession session,
String rule,
int mode) |
static DbRule |
getFromStatement(DbPreparedStatement preparedStatement)
For instance from Commander when getting updated information
|
String |
getIdRule() |
String[] |
getIdsArray() |
static String |
getJson(DbPreparedStatement preparedStatement,
int limit)
Write selected DbRule to a Json String
|
String |
getJsonAsString() |
int |
getMode() |
protected String |
getPrimaryField() |
protected String |
getPrimaryKey() |
String |
getRecvPath() |
String[][] |
getRerrorTasksArray() |
String[][] |
getRpostTasksArray() |
String[][] |
getRpreTasksArray() |
String |
getRuleArchivePath() |
String |
getRuleRecvPath() |
String |
getRuleSendPath() |
String |
getRuleWorkPath() |
String |
getSendPath() |
String[][] |
getSerrorTasksArray() |
String[][] |
getSpostTasksArray() |
String[][] |
getSpreTasksArray() |
protected String |
getTable() |
static DbRule[] |
getUpdatedPrepareStament() |
String |
getWorkPath() |
protected void |
initObject()
To setup primaryKey, otherFields, allFields.
|
boolean |
isRecvMode() |
boolean |
isSendMode() |
String |
printTasks(boolean isSender,
DbTaskRunner.TASKSTEP step) |
String |
setArchivePath(String filename)
Get the full path from archivePath
|
void |
setFromJson(com.fasterxml.jackson.databind.node.ObjectNode node,
boolean ignorePrimaryKey)
Set the values from the Json node to the current object (no database
access)
|
protected void |
setFromJson(String field,
com.fasterxml.jackson.databind.JsonNode value) |
String |
setRecvPath(String filename)
Get the full path from RecvPath (used only in copy MODETRANS)
|
String |
setSendPath(String filename)
Get the full path from sendPath
|
String |
setWorkingPath(String filename)
Get the full path from workPath
|
String |
toShortString()
Object to String
|
String |
toSpecializedHtml(R66Session session,
String body) |
String |
toString()
Object to String
|
asJson, exist, getInsertAllValues, getJson, getSelectAllFields, getUpdateAllFields, getValues, getWherePrimaryKey, insert, select, setFromArray, 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 TASK_TYPE
public static final String TASK_PATH
public static final String TASK_DELAY
public static final String TASK_COMMENT
public static final int NBPRKEY
protected static final String selectAllFields
protected static final String updateAllFields
protected static final String insertAllValues
public DbRule(String idRule, String ids, int mode, String recvPath, String sendPath, String archivePath, String workPath, String rpreTasks, String rpostTasks, String rerrorTasks, String spreTasks, String spostTasks, String serrorTasks)
idRule
- ids
- mode
- recvPath
- sendPath
- archivePath
- workPath
- rpreTasks
- rpostTasks
- rerrorTasks
- spreTasks
- spostTasks
- serrorTasks
- public DbRule(String idRule) throws WaarpDatabaseException
idRule
- WaarpDatabaseException
public DbRule(Rule rule)
public DbRule(String idrule, String[] idsArrayRef, int mode, String recvpath, String sendpath, String archivepath, String workpath, String[][] rpretasksArray, String[][] rposttasksArray, String[][] rerrortasksArray, String[][] spretasksArray, String[][] sposttasksArray, String[][] serrortasksArray)
idrule
- idsArrayRef
- recvpath
- sendpath
- archivepath
- workpath
- rpretasksArray
- rposttasksArray
- rerrortasksArray
- spretasksArray
- sposttasksArray
- serrortasksArray
- public DbRule(com.fasterxml.jackson.databind.node.ObjectNode source) throws WaarpDatabaseSqlException
source
- WaarpDatabaseSqlException
protected void initObject()
AbstractDbData
initObject
in class AbstractDbDataDao<Rule>
protected String getTable()
getTable
in class AbstractDbDataDao<Rule>
protected AbstractDAO<Rule> getDao() throws DAOConnectionException
getDao
in class AbstractDbDataDao<Rule>
DAOConnectionException
protected String getPrimaryKey()
getPrimaryKey
in class AbstractDbDataDao<Rule>
protected String getPrimaryField()
getPrimaryField
in class AbstractDbDataDao<Rule>
protected final void checkPath()
public void setFromJson(com.fasterxml.jackson.databind.node.ObjectNode node, boolean ignorePrimaryKey) throws WaarpDatabaseSqlException
AbstractDbDataDao
setFromJson
in class AbstractDbDataDao<Rule>
ignorePrimaryKey
- True will ignore primaryKey from JsonWaarpDatabaseSqlException
protected void setFromJson(String field, com.fasterxml.jackson.databind.JsonNode value)
setFromJson
in class AbstractDbDataDao<Rule>
public void delete() throws WaarpDatabaseException
delete
in class AbstractDbDataDao<Rule>
WaarpDatabaseException
public static DbRule[] deleteAll() throws WaarpDatabaseException
WaarpDatabaseException
public static DbRule[] getAllRules() throws WaarpDatabaseNoConnectionException
WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbRule getFromStatement(DbPreparedStatement preparedStatement) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static DbRule[] getUpdatedPrepareStament() throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
AbstractDbDataDao
changeUpdatedInfo
in class AbstractDbDataDao<Rule>
public String setRecvPath(String filename) throws OpenR66ProtocolSystemException
filename
- OpenR66ProtocolSystemException
public String setSendPath(String filename) throws OpenR66ProtocolSystemException
filename
- OpenR66ProtocolSystemException
public String setArchivePath(String filename) throws OpenR66ProtocolSystemException
filename
- OpenR66ProtocolSystemException
public String setWorkingPath(String filename) throws OpenR66ProtocolSystemException
filename
- OpenR66ProtocolSystemException
public boolean checkHostAllow(String hostId)
hostId
- public boolean isSendMode()
public boolean isRecvMode()
public String toString()
toString
in class Object
Object.toString()
public String printTasks(boolean isSender, DbTaskRunner.TASKSTEP step)
isSender
- step
- public String toShortString()
Object.toString()
public static DbPreparedStatement getFilterPrepareStament(DbSession session, String rule, int mode) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException
session
- rule
- mode
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public static String getJson(DbPreparedStatement preparedStatement, int limit) throws WaarpDatabaseNoConnectionException, WaarpDatabaseSqlException, OpenR66ProtocolBusinessException
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
OpenR66ProtocolBusinessException
public String getJsonAsString()
public String toSpecializedHtml(R66Session session, String body)
session
- body
- public String getRecvPath()
public String getSendPath()
public String getArchivePath()
public String getWorkPath()
public String getRuleRecvPath()
public String getRuleSendPath()
public String getRuleArchivePath()
public String getRuleWorkPath()
public String getIdRule()
public int getMode()
public String[] getIdsArray()
public String[][] getRpreTasksArray()
public String[][] getRpostTasksArray()
public String[][] getRerrorTasksArray()
public String[][] getSpreTasksArray()
public String[][] getSpostTasksArray()
public String[][] getSerrorTasksArray()
Copyright © 2009–2020 Waarp. All rights reserved.