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 |
static DbRule.Columns[] |
indexes |
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_RANK
Internal context XML fields
|
static String |
TASK_TYPE
Internal context XML fields
|
JSON_MODEL, pojo, SHOULD_NOT_BE_CALLED
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 |
checkPathes() |
protected void |
checkValues() |
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(boolean isCacheable) |
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, validateLength, validateLength
getAllFields, getTrueValue, setTrueValue, setValues
public static final int[] dbTypes
public static final String table
public static final DbRule.Columns[] indexes
public static final String TASK_TYPE
public static final String TASK_PATH
public static final String TASK_DELAY
public static final String TASK_RANK
public static final String TASK_COMMENT
protected static final String selectAllFields
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) throws WaarpDatabaseSqlException
idRule
- ids
- mode
- recvPath
- sendPath
- archivePath
- workPath
- rpreTasks
- rpostTasks
- rerrorTasks
- spreTasks
- spostTasks
- serrorTasks
- WaarpDatabaseSqlException
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) throws WaarpDatabaseSqlException
idrule
- idsArrayRef
- recvpath
- sendpath
- archivepath
- workpath
- rpretasksArray
- rposttasksArray
- rerrortasksArray
- spretasksArray
- sposttasksArray
- serrortasksArray
- WaarpDatabaseSqlException
public DbRule(com.fasterxml.jackson.databind.node.ObjectNode source) throws WaarpDatabaseSqlException
source
- WaarpDatabaseSqlException
protected final void initObject()
AbstractDbData
initObject
in class AbstractDbDataDao<Rule>
protected final String getTable()
getTable
in class AbstractDbDataDao<Rule>
protected final AbstractDAO<Rule> getDao(boolean isCacheable) throws DAOConnectionException
getDao
in class AbstractDbDataDao<Rule>
DAOConnectionException
protected final String getPrimaryKey()
getPrimaryKey
in class AbstractDbDataDao<Rule>
protected final String getPrimaryField()
getPrimaryField
in class AbstractDbDataDao<Rule>
protected final void checkPathes() throws WaarpDatabaseSqlException
WaarpDatabaseSqlException
protected final void checkValues() throws WaarpDatabaseSqlException
checkValues
in class AbstractDbDataDao<Rule>
WaarpDatabaseSqlException
public final 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 final void setFromJson(String field, com.fasterxml.jackson.databind.JsonNode value) throws WaarpDatabaseSqlException
setFromJson
in class AbstractDbDataDao<Rule>
WaarpDatabaseSqlException
public final 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
WaarpDatabaseNoConnectionException
public final void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
AbstractDbDataDao
changeUpdatedInfo
in class AbstractDbDataDao<Rule>
public final String setRecvPath(String filename)
filename
- public final String setSendPath(String filename)
filename
- public final String setArchivePath(String filename)
filename
- public final String setWorkingPath(String filename)
filename
- public final boolean checkHostAllow(String hostId)
hostId
- public final boolean isSendMode()
public final boolean isRecvMode()
public final String toString()
toString
in class Object
Object.toString()
public final String printTasks(boolean isSender, DbTaskRunner.TASKSTEP step)
isSender
- step
- public final 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
preparedStatement
- WaarpDatabaseNoConnectionException
WaarpDatabaseSqlException
public final String getJsonAsString()
public final String toSpecializedHtml(R66Session session, String body)
session
- body
- public final String getRecvPath()
public final String getSendPath()
public final String getArchivePath()
public final String getWorkPath()
public final String getRuleRecvPath()
public final String getRuleSendPath()
public final String getRuleArchivePath()
public final String getRuleWorkPath()
public final String getIdRule()
public final int getMode()
public final String[] getIdsArray()
public final String[][] getRpreTasksArray()
public final String[][] getRpostTasksArray()
public final String[][] getRerrorTasksArray()
public final String[][] getSpreTasksArray()
public final String[][] getSpostTasksArray()
public final String[][] getSerrorTasksArray()
Copyright © 2009–2022 Waarp. All rights reserved.