Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
HdbTdbArchivingServers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango controls archiving
HdbTdbArchivingServers
Commits
b5552505
Commit
b5552505
authored
7 months ago
by
Alexandre TISON
Browse files
Options
Downloads
Patches
Plain Diff
Refactoring TDB/HDB (
https://jira.synchrotron-soleil.fr/jira/browse/TANGOARCH-875
)
parent
e2dda4d1
Branches
Branches containing commit
No related tags found
1 merge request
!1
Refactoring TDB/HDB (https://jira.synchrotron-soleil.fr/jira/browse/TANGOARCH-875)
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
archivingmanager/src/main/java/org/tango/archiving/server/manager/ArchivingManager.java
+169
-503
169 additions, 503 deletions
.../org/tango/archiving/server/manager/ArchivingManager.java
with
169 additions
and
503 deletions
archivingmanager/src/main/java/org/tango/archiving/server/manager/ArchivingManager.java
+
169
−
503
View file @
b5552505
...
...
@@ -7,14 +7,9 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.tango.DeviceState
;
import
org.tango.server.ServerManager
;
import
org.tango.server.annotation.Attribute
;
import
org.tango.server.annotation.Command
;
import
org.tango.server.annotation.Device
;
import
org.tango.server.annotation.DeviceProperty
;
import
org.tango.server.annotation.Init
;
import
org.tango.server.annotation.State
;
import
org.tango.server.annotation.Status
;
import
org.tango.server.annotation.*
;
import
javax.xml.crypto.Data
;
import
java.util.ResourceBundle
;
import
java.util.Set
;
...
...
@@ -79,58 +74,34 @@ import java.util.Set;
@Device
public
class
ArchivingManager
{
private
static
final
String
DEFAULT_ARCHIVER_CLASS
=
ConfigConst
.
HDB_CLASS_DEVICE
;
private
static
String
VERSION
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ArchivingManager
.
class
);
@DeviceProperty
protected
String
tdbPort
=
""
;
@DeviceProperty
protected
String
hdbPort
=
""
;
@DeviceProperty
(
name
=
"DbPort"
)
protected
String
dbPort
=
""
;
/**
* Computer identifier on wich is settled the database
DB
. The identifier
* Computer identifier on wich is settled the database. The identifier
* can be the computer name or its IP address. <br>
* <b>Default value : </b>
hdb
* <b>Default value : </b>
*/
@DeviceProperty
private
String
h
dbHost
=
""
;
@DeviceProperty
(
name
=
"DbHost"
)
private
String
dbHost
=
""
;
/**
* Database name.<br>
* <b>Default value : </b>
hdb
* <b>Default value : </b>
*/
@DeviceProperty
private
String
h
dbName
=
""
;
@DeviceProperty
(
name
=
"DbName"
)
private
String
dbName
=
""
;
/**
* Computer identifier on wich is settled the database TDB. The identifier
* can be the computer name or its IP address. <br>
* <b>Default value : </b> tdb
*/
@DeviceProperty
private
String
tdbHost
=
""
;
/**
* Database name.<br>
* <b>Default value : </b> tdb
*/
@DeviceProperty
private
String
tdbName
=
""
;
/**
* User identifier (name) used to connect the historical database.
* User identifier (name) used to connect the database.
*/
@DeviceProperty
private
String
h
dbUser
=
""
;
@DeviceProperty
(
name
=
"DbUser"
)
private
String
dbUser
=
""
;
/**
* Password used to connect the
historical
database.
* Password used to connect the database.
*/
@DeviceProperty
private
String
hdbPassword
=
""
;
/**
* User identifier (name) used to connect the temporary database.
*/
@DeviceProperty
private
String
tdbUser
=
""
;
/**
* Password used to connect the temporary database.
*/
@DeviceProperty
private
String
tdbPassword
=
""
;
@DeviceProperty
(
name
=
"DbPassword"
)
private
String
dbPassword
=
""
;
/**
* true if the ORACLE RAC connection is activated. This information is
* appended to all device's (or attributes) name. false otherwise.<br>
...
...
@@ -140,14 +111,12 @@ public class ArchivingManager {
//private boolean hdbRacConnection;
//@DeviceProperty
//private boolean tdbRacConnection;
@DeviceProperty
private
String
hdbSchema
=
""
;
@DeviceProperty
private
String
tdbSchema
=
""
;
@DeviceProperty
private
String
hdbDbType
=
""
;
@DeviceProperty
private
String
tdbDbType
=
""
;
@DeviceProperty
(
name
=
"DbSchema"
)
private
String
dbSchema
=
""
;
@DeviceProperty
(
name
=
"DbType"
)
private
String
dbType
=
""
;
@DeviceProperty
(
name
=
"ArchiverClass"
,
description
=
"archiving device class to monitor"
)
private
String
archiverClass
=
DEFAULT_ARCHIVER_CLASS
;
@State
private
DeviceState
state
;
@Status
...
...
@@ -160,20 +129,49 @@ public class ArchivingManager {
ServerManager
.
getInstance
().
start
(
args
,
ArchivingManager
.
class
);
}
public
void
setTdbPort
(
final
String
tdbPort
)
{
this
.
tdbPort
=
tdbPort
;
private
static
DatabaseConnectionConfig
getDatabaseConnectionConfig
(
String
archiverClassName
)
{
final
DatabaseConnectionConfig
params
=
new
DatabaseConnectionConfig
();
// get default value from class properties of HDBArchiver
DatabaseConnectionConfig
.
TangoDbProperties
tangoDbProperties
=
new
DatabaseConnectionConfig
.
TangoDbProperties
(
"dbType"
,
"dbHost"
,
"dbName"
,
"dbSchema"
,
"dbUser"
,
"dbPassword"
,
"dbMinPoolSize"
,
"dbMaxPoolSize"
,
"dbCnxInactivityTimeout"
,
"dbPort"
);
// retrieve archiver class properties
params
.
setParametersFromTango
(
archiverClassName
,
tangoDbProperties
);
return
params
;
}
public
void
setDbPort
(
String
dbPort
)
{
this
.
dbPort
=
dbPort
;
}
public
void
setDbHost
(
String
dbHost
)
{
this
.
dbHost
=
dbHost
;
}
public
void
setDbName
(
String
dbName
)
{
this
.
dbName
=
dbName
;
}
public
void
set
HdbPort
(
final
String
h
db
Port
)
{
this
.
h
db
Port
=
h
db
Port
;
public
void
set
DbUser
(
String
db
User
)
{
this
.
db
User
=
db
User
;
}
public
void
set
HdbDbType
(
final
String
h
db
DbType
)
{
this
.
h
db
DbType
=
h
db
DbType
;
public
void
set
DbPassword
(
String
db
Password
)
{
this
.
db
Password
=
db
Password
;
}
public
void
setTdbDbType
(
final
String
tdbDbType
)
{
this
.
tdbDbType
=
tdbDbType
;
public
void
setDbType
(
String
dbType
)
{
this
.
dbType
=
dbType
;
}
public
void
setDbSchema
(
String
dbSchema
)
{
this
.
dbSchema
=
dbSchema
;
}
public
void
setArchiverClass
(
String
archiverClass
)
{
this
.
archiverClass
=
archiverClass
;
}
@Attribute
...
...
@@ -196,8 +194,10 @@ public class ArchivingManager {
private
void
connect
()
{
StringBuilder
statusBuilder
=
new
StringBuilder
();
final
boolean
isHdb
=
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
);
if
(
isHdb
)
{
try
{
connect
Hd
b
();
connect
D
b
();
Set
<
String
>
archivers
=
databaseAccessHDB
.
getExportedArchiverList
();
statusBuilder
.
append
(
"- "
).
append
(
archivers
.
size
()).
append
(
" HDB Archivers: "
)
.
append
(
archivers
).
append
(
"\n"
);
...
...
@@ -205,8 +205,9 @@ public class ArchivingManager {
logger
.
warn
(
"cannot connect to hdb "
,
e
);
statusBuilder
.
append
(
"- HDB is not available"
).
append
(
"\n"
);
}
}
else
{
try
{
connect
Td
b
();
connect
D
b
();
Set
<
String
>
archivers
=
databaseAccessTDB
.
getExportedArchiverList
();
statusBuilder
.
append
(
"- "
).
append
(
archivers
.
size
()).
append
(
" TDB Archivers: "
)
.
append
(
archivers
).
append
(
"\n"
);
...
...
@@ -214,73 +215,44 @@ public class ArchivingManager {
logger
.
warn
(
"cannot connect to tdb "
,
e
);
statusBuilder
.
append
(
"- TDB is not available"
).
append
(
"\n"
);
}
}
state
=
DeviceState
.
ON
;
status
=
statusBuilder
.
toString
();
}
private
void
connectHdb
()
throws
DevFailed
{
final
DatabaseConnectionConfig
params
=
getDatabaseConnectionConfig
(
ConfigConst
.
HDB_CLASS_DEVICE
);
if
(!
hdbHost
.
isEmpty
())
params
.
setHost
(
hdbHost
);
if
(!
hdbUser
.
isEmpty
())
params
.
setUser
(
hdbUser
);
if
(!
hdbPassword
.
isEmpty
())
params
.
setPassword
(
hdbPassword
);
if
(!
hdbName
.
isEmpty
())
params
.
setName
(
hdbName
);
if
(!
hdbSchema
.
isEmpty
())
params
.
setSchema
(
hdbSchema
);
if
(!
hdbPort
.
isEmpty
())
params
.
setPort
(
hdbPort
);
if
(!
hdbDbType
.
isEmpty
())
params
.
setDbType
(
DatabaseConnectionConfig
.
DataBaseType
.
parseDataBaseType
(
hdbDbType
));
logger
.
debug
(
"connecting to HDB with parameters {}"
,
params
);
if
(
params
.
getDbType
().
equals
(
DatabaseConnectionConfig
.
DataBaseType
.
POSTGRESQL
))
{
private
void
connectDb
()
throws
DevFailed
{
final
boolean
isHdb
=
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
);
final
DatabaseConnectionConfig
params
=
getDatabaseConnectionConfig
(
isHdb
?
ConfigConst
.
HDB_CLASS_DEVICE
:
ConfigConst
.
TDB_CLASS_DEVICE
);
if
(!
dbHost
.
isEmpty
())
params
.
setHost
(
dbHost
);
if
(!
dbUser
.
isEmpty
())
params
.
setUser
(
dbUser
);
if
(!
dbPassword
.
isEmpty
())
params
.
setPassword
(
dbPassword
);
if
(!
dbName
.
isEmpty
())
params
.
setName
(
dbName
);
if
(!
dbSchema
.
isEmpty
())
params
.
setSchema
(
dbSchema
);
if
(!
dbHost
.
isEmpty
())
params
.
setPort
(
dbPort
);
if
(!
dbType
.
isEmpty
())
params
.
setDbType
(
DatabaseConnectionConfig
.
DataBaseType
.
parseDataBaseType
(
dbType
));
logger
.
debug
(
"connecting to {} with parameters {}"
,
isHdb
?
"HDB"
:
"TDB"
,
params
);
if
(
params
.
getDbType
().
equals
(
DatabaseConnectionConfig
.
DataBaseType
.
POSTGRESQL
)
&&
isHdb
)
{
databaseAccessHDB
=
new
TimeseriesAccess
();
}
else
if
(
params
.
getDbType
().
equals
(
DatabaseConnectionConfig
.
DataBaseType
.
POSTGRESQL
)
&&
!
isHdb
)
{
databaseAccessTDB
=
new
TimeseriesAccess
();
}
else
if
(!
isHdb
)
{
databaseAccessTDB
=
new
HDBTDBAccess
();
}
else
{
databaseAccessHDB
=
new
HDBTDBAccess
();
}
databaseAccessHDB
.
connect
(
params
,
true
);
}
protected
void
connectTdb
()
throws
DevFailed
{
final
DatabaseConnectionConfig
params
=
getDatabaseConnectionConfig
(
ConfigConst
.
TDB_CLASS_DEVICE
);
if
(!
tdbHost
.
isEmpty
())
params
.
setHost
(
tdbHost
);
if
(!
tdbUser
.
isEmpty
())
params
.
setUser
(
tdbUser
);
if
(!
tdbPassword
.
isEmpty
())
params
.
setPassword
(
tdbPassword
);
if
(!
tdbName
.
isEmpty
())
params
.
setName
(
tdbName
);
if
(!
tdbSchema
.
isEmpty
())
params
.
setSchema
(
tdbSchema
);
if
(!
tdbDbType
.
isEmpty
())
{
params
.
setDbType
(
DatabaseConnectionConfig
.
DataBaseType
.
valueOf
(
tdbDbType
));
}
if
(!
tdbPort
.
isEmpty
())
params
.
setPort
(
tdbPort
);
logger
.
debug
(
"connecting to TDB with parameters {}"
,
params
);
if
(
params
.
getDbType
().
equals
(
DatabaseConnectionConfig
.
DataBaseType
.
POSTGRESQL
))
{
databaseAccessTDB
=
new
TimeseriesAccess
();
if
(
isHdb
){
databaseAccessHDB
.
connect
(
params
,
isHdb
);
}
else
{
databaseAccessTDB
=
new
HDBTDBAccess
(
);
databaseAccessTDB
.
connect
(
params
,
isHdb
);
}
databaseAccessTDB
.
connect
(
params
,
false
);
}
private
static
DatabaseConnectionConfig
getDatabaseConnectionConfig
(
String
archiverClassName
)
{
final
DatabaseConnectionConfig
params
=
new
DatabaseConnectionConfig
();
// get default value from class properties of HDBArchiver
DatabaseConnectionConfig
.
TangoDbProperties
tangoDbProperties
=
new
DatabaseConnectionConfig
.
TangoDbProperties
(
"dbType"
,
"dbHost"
,
"dbName"
,
"dbSchema"
,
"dbUser"
,
"dbPassword"
,
"dbMinPoolSize"
,
"dbMaxPoolSize"
,
"dbCnxInactivityTimeout"
,
"dbPort"
);
// retrieve archiver class properties
params
.
setParametersFromTango
(
archiverClassName
,
tangoDbProperties
);
return
params
;
}
@Command
...
...
@@ -297,30 +269,23 @@ public class ArchivingManager {
}
/**
* Execute command "ArchivingStop
Hdb
" on device. Stops the
historical
* Execute command "ArchivingStop" on device. Stops the
* archiving for the given attributes.
*
* @param argin The attribute list.
*/
@Command
(
name
=
"ArchivingStopHdb"
,
inTypeDesc
=
"The attribute list"
)
public
String
archivingStopHdb
(
final
String
[]
argin
)
throws
DevFailed
{
@Command
(
name
=
"ArchivingStop"
,
inTypeDesc
=
"The attribute list"
)
public
String
archivingStop
(
final
String
[]
argin
)
throws
DevFailed
{
if
(
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
))
{
return
databaseAccessHDB
.
archivingStop
(
argin
);
}
/**
* Execute command "ArchivingStopTdb" on device. Stops the temporary
* archiving for the given attributes.
*
* @param argin The attribute list.
*/
@Command
(
name
=
"ArchivingStopTdb"
)
public
String
archivingStopTdb
(
final
String
[]
argin
)
throws
DevFailed
{
}
else
{
return
databaseAccessTDB
.
archivingStop
(
argin
);
}
}
/**
* Execute command "ArchivingModif
Hdb
" on device. Change the mode of an
*
historical
archiving.
* Execute command "ArchivingModif" on device. Change the mode of an
* archiving.
*
* @param argin The configuration to switch to... <br>
* <blockquote>
...
...
@@ -328,7 +293,7 @@ public class ArchivingManager {
* <li><strong>The first part :</strong>
* <ul>
* <li><var>argin</var>[0]<b> =</b> the load balancing type of the archiving<br>
* "1", if all the attribute are archived together in the same TdbArchiver device, <br>
* "1", if all the attribute are archived together in the same TdbArchiver
/HDBArchiver
device, <br>
* "0" otherwise.
* <li><var>argin</var>[1]<b> =</b> the number of attributes to archive<br>
* <li><var>argin</var>[2] to <var>argin</var> [2 + <var>argin</var>[1] - 1] = the name of each attribute
...
...
@@ -379,13 +344,17 @@ public class ArchivingManager {
* </blockquote>
* @see fr.soleil.archiving.hdbtdb.api.tools.ArchivingMessConfig
*/
@Command
(
name
=
"ArchivingModifHdb"
)
public
void
archivingModifHdb
(
final
String
[]
argin
)
throws
DevFailed
{
@Command
(
name
=
"ArchivingModif"
)
public
void
archivingModif
(
final
String
[]
argin
)
throws
DevFailed
{
if
(
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
))
{
databaseAccessHDB
.
archivingModif
(
argin
);
}
else
{
databaseAccessTDB
.
archivingModif
(
argin
);
}
}
/**
* Execute command "ArchivingStart
Hdb
" on device. Start an
historical
* Execute command "ArchivingStart" on device. Start an
* archiving for the specified attributes, and following the specified mode.
*
* @param argin Archiving arguments... <BR>
...
...
@@ -394,7 +363,7 @@ public class ArchivingManager {
* <li><strong>The first part :</strong>
* <ul>
* <li><var>argin</var>[0]<b> =</b> the load balancing type of the archiving<br>
* "1", if all the attribute are archived together in the same HdbArchiver device, <br>
* "1", if all the attribute are archived together in the same
TdbArchiver/
HdbArchiver device, <br>
* "0" otherwise.
* <li><var>argin</var>[1]<b> =</b> the number of attributes to archive<br>
* <li><var>argin</var>[2] to <var>argin</var> [2 + <var>argin</var>[1] - 1] = the name of each attribute
...
...
@@ -445,65 +414,16 @@ public class ArchivingManager {
* </blockquote>
* @see fr.soleil.archiving.hdbtdb.api.tools.ArchivingMessConfig
*/
@Command
(
name
=
"ArchivingStartHdb"
)
public
void
archivingStartHdb
(
final
String
[]
argin
)
throws
DevFailed
{
@Command
(
name
=
"ArchivingStart"
)
public
void
archivingStart
(
final
String
[]
argin
)
throws
DevFailed
{
if
(
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
)){
databaseAccessHDB
.
archivingStart
(
argin
);
}
else
{
databaseAccessTDB
.
archivingStart
(
argin
);
}
@Command
(
name
=
"ArchivingStartHdbJson"
,
inTypeDesc
=
"A JSON array. Example:\n [ {\n"
+
" \"attributeFullName\" : \"tango/tangotest/1/ampli\",\n"
+
" \"archiverName\" : \"tango://fokrred\",\n"
+
" \"modes\" : {\n"
+
" \"periodPeriodic\" : 20000,\n"
+
" \"periodAbsolute\" : 0,\n"
+
" \"decreaseDeltaAbsolute\" : 0.0,\n"
+
" \"increaseDeltaAbsolute\" : 0.0,\n"
+
" \"periodRelative\" : 1000,\n"
+
" \"decreasePercentRelative\" : 10.0,\n"
+
" \"increasePercentRelative\" : 10.0,\n"
+
" \"periodThreshold\" : 0,\n"
+
" \"minThresholdValue\" : 0.0,\n"
+
" \"maxThresholdValue\" : 0.0,\n"
+
" \"periodDifference\" : 0,\n"
+
" \"absolute\" : false,\n"
+
" \"threshold\" : false,\n"
+
" \"periodic\" : true,\n"
+
" \"relative\" : true,\n"
+
" \"slowDriftRelative\" : true,\n"
+
" \"difference\" : false,\n"
+
" \"slowDriftAbsolute\" : false,\n"
+
" \"event\" : false\n"
+
" }\n"
+
"}, {\n"
+
" \"attributeFullName\" : \"tango/tangotest/2/ampli\",\n"
+
" \"archiverName\" : \"\",\n"
+
" \"modes\" : {\n"
+
" \"periodPeriodic\" : 20000,\n"
+
" \"periodAbsolute\" : 3000,\n"
+
" \"decreaseDeltaAbsolute\" : 12.0,\n"
+
" \"increaseDeltaAbsolute\" : 13.0,\n"
+
" \"periodRelative\" : 1000,\n"
+
" \"decreasePercentRelative\" : 0.0,\n"
+
" \"increasePercentRelative\" : 0.0,\n"
+
" \"periodThreshold\" : 0,\n"
+
" \"minThresholdValue\" : 0.0,\n"
+
" \"maxThresholdValue\" : 0.0,\n"
+
" \"periodDifference\" : 0,\n"
+
" \"absolute\" : true,\n"
+
" \"threshold\" : false,\n"
+
" \"periodic\" : true,\n"
+
" \"relative\" : false,\n"
+
" \"slowDriftRelative\" : true,\n"
+
" \"difference\" : false,\n"
+
" \"slowDriftAbsolute\" : false,\n"
+
" \"event\" : false\n"
+
" }\n"
+
"} ]"
)
public
void
archivingStartHdbJson
(
final
String
jsonAsString
)
throws
DevFailed
{
databaseAccessHDB
.
archivingStartJson
(
jsonAsString
);
}
@Command
(
name
=
""
,
inTypeDesc
=
"A JSON array. Example:\n [ {\n"
+
@Command
(
name
=
"
ArchivingStartJson
"
,
inTypeDesc
=
"A JSON array. Example:\n [ {\n"
+
" \"attributeFullName\" : \"tango/tangotest/1/ampli\",\n"
+
" \"archiverName\" : \"tango://fokrred\",\n"
+
" \"modes\" : {\n"
+
...
...
@@ -552,241 +472,36 @@ public class ArchivingManager {
" \"event\" : false\n"
+
" }\n"
+
"} ]"
)
public
void
archivingStartTdbJson
(
final
String
jsonAsString
)
throws
DevFailed
{
public
void
archivingStartJson
(
final
String
jsonAsString
)
throws
DevFailed
{
if
(
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
))
{
databaseAccessHDB
.
archivingStartJson
(
jsonAsString
);
}
else
{
databaseAccessTDB
.
archivingStartJson
(
jsonAsString
);
}
/**
* Execute command "ArchivingModifTdb" on device. Change the mode of a
* temporary archiving.
*
* @param argin The configuration to switch to...... <br>
* <blockquote>
* <ul>
* <li><strong>The first part :</strong>
* <ul>
* <li><var>argin</var>[0]<b> =</b> the load balancing type of the archiving<br>
* "1", if all the attribute are archived together in the same TdbArchiver device, <br>
* "0" otherwise.
* <li><var>argin</var>[1]<b> =</b> the number of attributes to archive<br>
* <li><var>argin</var>[2] to <var>argin</var> [2 + <var>argin</var>[1] - 1] = the name of each attribute
* </ul>
* <li><strong>The second part (the <i>Mode </i>part) :</strong> <br>
* Let us note <i>"<var>index</var>" </i>the last <var>index</var> used (for example, at this
* point, <i><var>index</var></i> = 2]).
* <ul>
* <li><strong>If the Mode is composed of a <i>Periodical Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_P</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the period of the periodic mode in (ms)<br>
* <var>index</var> = <var>index</var> + 2<br>
* <li><strong>If the Mode is composed of an <i>Absolute Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_A</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the frequency of the <i>absolute mode </i>in (ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the delta value max when decreasing<br>
* <var>argin</var>[<var>index</var>+ 4] = the delta value max when increasing<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li><strong>If the Mode is composed of a <i>Relative Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_R</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>frequency </i>of the <i>relative mode </i>in (ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the <i>decreasing variation </i>associated to this mode<br>
* <var>argin</var>[<var>index</var>+ 4] = the <i>increasing variation </i>associated to this mode<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li><strong>If the Mode is composed of an <i>Threshold Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_T</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the frequency of the <i>threshold mode </i>in (ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the smallest value (min) when decreasing<br>
* <var>argin</var>[<var>index</var>+ 4] = the biggest value (max) when increasing<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li>If the Mode is composed of a <i>On Calculation Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_C</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>frequency </i>of the <i>on calculation mode </i>in (ms)
* <br>
* <var>argin</var>[<var>index</var>+ 3] = the <i>number of values</i> taken into account<br>
* <var>argin</var>[<var>index</var>+ 4] = the <i>type </i>associated to this mode<br>
* <var>argin</var>[<var>index</var>+ 5] = Not used at the moment <br>
* <var>index</var> = <var>index</var> + 5<br>
* <li><strong>If the Mode is composed of an <i>On Difference Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_D</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>frequency </i>of this<i> mode </i>(in ms)<br>
* <var>index</var> = <var>index</var> + 2<br>
* <li><strong>If the Mode is composed of an <i>External Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_E</code><br>
* <var>index</var> = <var>index</var> + 1<br>
* <li><strong>The Temporary (<i>Intermediate Archiving</i>) archiving specific informations </strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>TDB_SPEC</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>export frequency </i>(ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the <i>keeping window duration </i>in (ms)<br>
* <var>index</var> = <var>index</var> + 3<br>
* </ul>
* </ul>
* </blockquote>
* @see fr.soleil.archiving.hdbtdb.api.tools.ArchivingMessConfig
*/
@Command
(
name
=
"ArchivingModifTdb"
)
public
void
archivingModifTdb
(
final
String
[]
argin
)
throws
DevFailed
{
databaseAccessTDB
.
archivingModif
(
argin
);
}
/**
* Execute command "ArchivingStartTdb" on device. Start an temporary
* archiving for the specified attributes, and following the specified mode.
*
* @param argin Archiving arguments... <BR>
* <blockquote>
* <ul>
* <li><strong>The first part :</strong>
* <ul>
* <li><var>argin</var>[0]<b> =</b> the load balancing type of the archiving<br>
* "1", if all the attribute are archived together in the same HdbArchiver device, <br>
* "0" otherwise.
* <li><var>argin</var>[1]<b> =</b> the number of attributes to archive<br>
* <li><var>argin</var>[2] to <var>argin</var> [2 + <var>argin</var>[1] - 1] = the name of each attribute
* </ul>
* <li><strong>The second part (the <i>Mode </i>part) :</strong> <br>
* Let us note <i>"<var>index</var>" </i>the last <var>index</var> used (for example, at this
* point, <i><var>index</var></i> = 2]).
* <ul>
* <li><strong>If the Mode is composed of a <i>Periodical Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_P</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the period of the periodic mode in (ms)<br>
* <var>index</var> = <var>index</var> + 2<br>
* <li><strong>If the Mode is composed of an <i>Absolute Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_A</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the frequency of the <i>absolute mode </i>in (ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the delta value max when decreasing<br>
* <var>argin</var>[<var>index</var>+ 4] = the delta value max when increasing<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li><strong>If the Mode is composed of a <i>Relative Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_R</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>frequency </i>of the <i>relative mode </i>in (ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the <i>decreasing variation </i>associated to this mode<br>
* <var>argin</var>[<var>index</var>+ 4] = the <i>increasing variation </i>associated to this mode<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li><strong>If the Mode is composed of an <i>Threshold Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_T</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the frequency of the <i>threshold mode </i>in (ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the smallest value (min) when decreasing<br>
* <var>argin</var>[<var>index</var>+ 4] = the biggest value (max) when increasing<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li>If the Mode is composed of a <i>On Calculation Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_C</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>frequency </i>of the <i>on calculation mode </i>in (ms)
* <br>
* <var>argin</var>[<var>index</var>+ 3] = the <i>number of values</i> taken into account<br>
* <var>argin</var>[<var>index</var>+ 4] = the <i>type </i>associated to this mode<br>
* <var>argin</var>[<var>index</var>+ 5] = Not used at the moment <br>
* <var>index</var> = <var>index</var> + 5<br>
* <li><strong>If the Mode is composed of an <i>On Difference Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_D</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>frequency </i>of this<i> mode </i>(in ms)<br>
* <var>index</var> = <var>index</var> + 2<br>
* <li><strong>If the Mode is composed of an <i>External Mode</i></strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>MODE_E</code><br>
* <var>index</var> = <var>index</var> + 1<br>
* <li><strong>The Temporary (<i>Intermediate Archiving</i>) archiving specific informations </strong><br>
* <var>argin</var>[<var>index</var>+ 1] = <code>TDB_SPEC</code><br>
* <var>argin</var>[<var>index</var>+ 2] = the <i>export frequency </i>(ms)<br>
* <var>argin</var>[<var>index</var>+ 3] = the <i>keeping window duration </i>in (ms)<br>
* <var>index</var> = <var>index</var> + 3<br>
* </ul>
* </ul>
* </blockquote>
* @see fr.soleil.archiving.hdbtdb.api.tools.ArchivingMessConfig
*/
@Command
(
name
=
"ArchivingStartTdb"
)
public
void
archivingStartTdb
(
final
String
[]
argin
)
throws
DevFailed
{
databaseAccessTDB
.
archivingStart
(
argin
);
}
/**
* Execute command "IsArchived
Hdb
" on device. Check the archiving state
*
(historical archiving)
for each attribute of the given list.
* Execute command "IsArchived" on device. Check the archiving state
* for each attribute of the given list.
*
* @param argin The attribute list.
* @return For each attribute of the given list...<br>
* <ul>
* <li><code>1</code>, if the attribute is currently being archived
(historical archiving)
* <li><code>1</code>, if the attribute is currently being archived
* <li><code>0</code>, otherwise
* </ul>
*/
@Command
(
name
=
"IsArchivedHdb"
)
public
short
[]
isArchivedHdb
(
final
String
[]
argin
)
throws
DevFailed
{
@Command
(
name
=
"IsArchived"
)
public
short
[]
isArchived
(
final
String
[]
argin
)
throws
DevFailed
{
if
(
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
))
{
return
databaseAccessHDB
.
isArchived
(
argin
);
}
/**
* Execute command "IsArchivedTdb" on device. Check the archiving state
* (temporary archiving) for each attribute of the given list.
*
* @param argin The attribute list.
* @return For each attribute of the given list...<br>
* <ul>
* <li><code>1</code>, if the attribute is currently being archived (temporary archiving)
* <li><code>0</code>, otherwise
* </ul>
*/
@Command
(
name
=
"IsArchivedTdb"
)
public
short
[]
isArchivedTdb
(
final
String
[]
argin
)
throws
DevFailed
{
}
else
{
return
databaseAccessTDB
.
isArchived
(
argin
);
}
/**
* Execute command "GetArchivingModeHdb" on device. Return the historical
* archiving mode applied to an attribute.
*
* @param argin The attribute name.
* @return The applied mode... <br>
* <blockquote>
* <ul>
* Let us note <i>"<var>index</var>" </i>the last <var>index</var> used (for example, at this
* point, <i><var>index</var></i> = 0]).
* <li><strong>If the Mode is composed of a <i>Periodical Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_P</code><br>
* <var>argout</var>[<var>index</var> + 1] = the period of the periodic mode in (ms)<br>
* <var>index</var> = <var>index</var> + 2<br>
* <li><strong>If the Mode is composed of an <i>Absolute Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_A</code><br>
* <var>argout</var>[<var>index</var>+ 1] = the frequency of the <i>absolute mode </i>in (ms)<br>
* <var>argout</var>[<var>index</var>+ 2] = the delta value max when decreasing<br>
* <var>argout</var>[<var>index</var>+ 3] = the delta value max when increasing<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li><strong>If the Mode is composed of a <i>Relative Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_R</code><br>
* <var>argout</var>[<var>index</var>+ 1] = the <i>frequency </i>of the <i>relative mode </i>in (ms)<br>
* <var>argout</var>[<var>index</var>+ 2] = the <i>decreasing variation </i>associated to this mode<br>
* <var>argout</var>[<var>index</var>+ 3] = the <i>increasing variation </i>associated to this mode<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li><strong>If the Mode is composed of an <i>Threshold Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_T</code><br>
* <var>argout</var>[<var>index</var>+ 1] = the frequency of the <i>threshold mode </i>in (ms)<br>
* <var>argout</var>[<var>index</var>+ 2] = the smallest value (min) when decreasing<br>
* <var>argout</var>[<var>index</var>+ 3] = the biggest value (max) when increasing<br>
* <var>index</var> = <var>index</var> + 4<br>
* <li>If the Mode is composed of a <i>On Calculation Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_C</code><br>
* <var>argout</var>[<var>index</var>+ 1] = the <i>frequency </i>of the <i>on calculation mode </i>in (ms)<br>
* <var>argout</var>[<var>index</var>+ 2] = the <i>number of values</i> taken into account<br>
* <var>argout</var>[<var>index</var>+ 3] = the <i>type </i>associated to this mode<br>
* <var>argout</var>[<var>index</var>+ 4] = Not used at the moment <br>
* <var>index</var> = <var>index</var> + 5<br>
* <li><strong>If the Mode is composed of an <i>On Difference Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_D</code><br>
* <var>argout</var>[<var>index</var>+ 1] = the <i>frequency </i>of this<i> mode </i>(in ms)<br>
* <var>index</var> = <var>index</var> + 2<br>
* <li><strong>If the Mode is composed of an <i>External Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_E</code><br>
* <var>index</var> = <var>index</var> + 1<br>
* </ul>
* </blockquote>
*/
@Command
(
name
=
"GetArchivingModeHdb"
)
public
String
[]
getArchivingModeHdb
(
final
String
argin
)
throws
DevFailed
{
return
databaseAccessHDB
.
getArchivingMode
(
argin
);
}
/**
* Execute command "GetArchivingMode
Tdb
" on device. Return the
temporary
* Execute command "GetArchivingMode" on device. Return the
* archiving mode applied to an attribute.
*
* @param argin The attribute name.
...
...
@@ -831,81 +546,32 @@ public class ArchivingManager {
* <li><strong>If the Mode is composed of an <i>External Mode</i></strong><br>
* <var>argout</var>[<var>index</var>] = <code>MODE_E</code><br>
* <var>index</var> = <var>index</var> + 1<br>
* <li><strong>The Temporary (<i>Intermediate Archiving</i>) archiving specific informations </strong><br>
* <var>argout</var>[<var>index</var>] = <code>TDB_SPEC</code><br>
* <var>argout</var>[<var>index</var>+ 1] = the <i>export frequency </i>(ms)<br>
* <var>argout</var>[<var>index</var>+ 2] = the <i>keeping window duration </i>in (ms)<br>
* <var>index</var> = <var>index</var> + 3<br>
* </ul>
* </blockquote>
*/
@Command
(
name
=
"GetArchivingModeTdb"
)
public
String
[]
getArchivingModeTdb
(
final
String
argin
)
throws
DevFailed
{
@Command
(
name
=
"GetArchivingMode"
)
public
String
[]
getArchivingMode
(
final
String
argin
)
throws
DevFailed
{
if
(
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
))
{
return
databaseAccessHDB
.
getArchivingMode
(
argin
);
}
else
{
return
databaseAccessTDB
.
getArchivingMode
(
argin
);
}
/**
* Execute command "GetStatusHdb" on device. For each attribute of the given
* list, get the status of the device in charge of its historical archiving
*
* @param argin The attribute list.
* @return The list of status.
*/
@Command
(
name
=
"GetStatusHdb"
)
public
String
[]
getStatusHdb
(
final
String
[]
argin
)
throws
DevFailed
{
return
databaseAccessHDB
.
getStatus
(
argin
);
}
/**
* Execute command "GetStatus
Tdb
" on device. For each attribute of the given
* list, get the status of the device in charge of its
temporary
archiving
.
* Execute command "GetStatus" on device. For each attribute of the given
* list, get the status of the device in charge of its archiving
*
* @param argin The attribute list.
* @return The list of status.
*/
@Command
(
name
=
"GetStatusTdb"
)
public
String
[]
getStatusTdb
(
final
String
[]
argin
)
throws
DevFailed
{
@Command
(
name
=
"GetStatus"
)
public
String
[]
getStatus
(
final
String
[]
argin
)
throws
DevFailed
{
if
(
ConfigConst
.
HDB_CLASS_DEVICE
.
equals
(
archiverClass
))
{
return
databaseAccessHDB
.
getStatus
(
argin
);
}
else
{
return
databaseAccessTDB
.
getStatus
(
argin
);
}
public
void
setHdbHost
(
String
hdbHost
)
{
this
.
hdbHost
=
hdbHost
;
}
public
void
setHdbName
(
String
hdbName
)
{
this
.
hdbName
=
hdbName
;
}
public
void
setTdbHost
(
String
tdbHost
)
{
this
.
tdbHost
=
tdbHost
;
}
public
void
setTdbName
(
String
tdbName
)
{
this
.
tdbName
=
tdbName
;
}
public
void
setHdbUser
(
String
hdbUser
)
{
this
.
hdbUser
=
hdbUser
;
}
public
void
setHdbPassword
(
String
hdbPassword
)
{
this
.
hdbPassword
=
hdbPassword
;
}
public
void
setTdbUser
(
String
tdbUser
)
{
this
.
tdbUser
=
tdbUser
;
}
public
void
setTdbPassword
(
String
tdbPassword
)
{
this
.
tdbPassword
=
tdbPassword
;
}
public
void
setHdbSchema
(
String
hdbSchema
)
{
this
.
hdbSchema
=
hdbSchema
;
}
public
void
setTdbSchema
(
String
tdbSchema
)
{
this
.
tdbSchema
=
tdbSchema
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment