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
6228c9f2
Commit
6228c9f2
authored
Apr 5, 2011
by
Gwenaelle ABEILLE
Browse files
Options
Downloads
Patches
Plain Diff
ignore case for attributes names
parent
d04fec4a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/Common/Archiver/Collector/ArchiverCollector.java
+15
-12
15 additions, 12 deletions
...ain/java/Common/Archiver/Collector/ArchiverCollector.java
with
15 additions
and
12 deletions
src/main/java/Common/Archiver/Collector/ArchiverCollector.java
+
15
−
12
View file @
6228c9f2
package
Common.Archiver.Collector
;
import
java.util.Hashtable
;
import
java.util.HashMap
;
import
java.util.Map
;
import
fr.esrf.tangoatk.core.ErrorEvent
;
import
fr.soleil.commonarchivingapi.ArchivingTools.Diary.ILogger
;
...
...
@@ -8,7 +9,7 @@ import fr.soleil.hdbtdbArchivingApi.ArchivingTools.Tools.ScalarEvent;
public
abstract
class
ArchiverCollector
{
// This hashtable contains the mode counters by attribute
private
final
Hashtable
<
String
,
ModesCounters
>
m_
attributeMode
HandlerHastable
;
private
final
Map
<
String
,
ModesCounters
>
attributeMode
CounterMap
=
new
HashMap
<
String
,
ModesCounters
>()
;
// Diary file
protected
ILogger
m_logger
;
...
...
@@ -19,7 +20,6 @@ public abstract class ArchiverCollector {
protected
ModeHandler
m_modeHandler
;
public
ArchiverCollector
(
ModeHandler
modeHandler
)
{
m_attributeModeHandlerHastable
=
new
Hashtable
<
String
,
ModesCounters
>();
m_modeHandler
=
modeHandler
;
}
...
...
@@ -28,27 +28,30 @@ public abstract class ArchiverCollector {
}
/* Allows to indicate to the collector that a new attribute must be managed */
protected
void
addAttribute
(
String
name
)
{
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
{
protected
synchronized
void
addAttribute
(
String
name
)
{
String
lower
=
name
.
toLowerCase
();
if
(
attributeModeCounterMap
.
containsKey
(
lower
))
{
m_logger
.
trace
(
ILogger
.
LEVEL_WARNING
,
"ArchiverCollector.addAttribute : The attribute "
+
name
+
"already exists in the map ==> Counter Re-init"
);
m_
attributeMode
HandlerHastable
.
get
(
name
).
init
();
attributeMode
CounterMap
.
get
(
lower
).
init
();
}
else
{
m_
attributeMode
HandlerHastable
.
put
(
name
,
new
ModesCounters
());
attributeMode
CounterMap
.
put
(
lower
,
new
ModesCounters
());
}
}
/* Allows to indicate to the collector that an attribute has been stopped */
protected
void
removeAttribute
(
String
name
)
{
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
{
m_attributeModeHandlerHastable
.
remove
(
name
);
protected
synchronized
void
removeAttribute
(
String
name
)
{
String
lower
=
name
.
toLowerCase
();
if
(
attributeModeCounterMap
.
containsKey
(
lower
))
{
attributeModeCounterMap
.
remove
(
lower
);
}
}
/* Allows to retrieve the ModesCounters object of one attribute */
protected
ModesCounters
getModeCounter
(
String
name
)
{
if
(
m_attributeModeHandlerHastable
.
containsKey
(
name
))
{
return
m_attributeModeHandlerHastable
.
get
(
name
);
String
lower
=
name
.
toLowerCase
();
if
(
attributeModeCounterMap
.
containsKey
(
lower
))
{
return
attributeModeCounterMap
.
get
(
lower
);
}
return
null
;
...
...
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