Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kieker-TeeTime-Stages
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeeTime
Kieker-TeeTime-Stages
Commits
e25d6469
Commit
e25d6469
authored
8 years ago
by
Sören Henning
Browse files
Options
Downloads
Patches
Plain Diff
removed unused PropertiesModel (from trace reconstruction tool)
parent
a409dbb6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/kieker/analysis/traceanalysismodel/PropertiesModel.java
+0
-178
0 additions, 178 deletions
...a/kieker/analysis/traceanalysismodel/PropertiesModel.java
with
0 additions
and
178 deletions
src/main/java/kieker/analysis/traceanalysismodel/PropertiesModel.java
deleted
100644 → 0
+
0
−
178
View file @
a409dbb6
/***************************************************************************
* Copyright 2015 Kieker Project (http://kieker-monitoring.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
***************************************************************************/
package
kieker.analysis.traceanalysismodel
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
import
java.util.concurrent.TimeUnit
;
import
java.util.prefs.BackingStoreException
;
import
java.util.prefs.Preferences
;
//import org.apache.logging.log4j.LogManager; //TODO
//import org.apache.logging.log4j.Logger; //TODO
/**
* @author Nils Christian Ehmke
*/
public
final
class
PropertiesModel
{
// private static final Logger LOGGER = LogManager.getLogger(PropertiesModel.class);//TODO
private
static
final
PropertiesModel
INSTANCE
=
new
PropertiesModel
();
private
static
final
String
KEY_TIMEUNIT
=
"timeunit"
;
private
static
final
String
KEY_OPERATIONS
=
"operations"
;
private
static
final
String
KEY_COMPONENTS
=
"components"
;
private
static
final
String
KEY_GRAPHVIZ_PATH
=
"graphvizpath"
;
private
static
final
String
KEY_ADDITIONAL_LOG_CHECKS
=
"additionalLogChecks"
;
private
static
final
String
KEY_REGULAR_EXPRESSIONS
=
"regularExpressions"
;
private
static
final
String
KEY_GITLAB_URL
=
"GitLabURL"
;
private
static
final
String
KEY_TRAC_URL
=
"TracURL"
;
private
String
graphvizPath
;
private
TimeUnit
timeUnit
;
private
ComponentNames
componentNames
;
private
OperationNames
operationNames
;
private
boolean
additionalLogChecks
;
private
boolean
activateRegularExpressions
;
private
String
gitLabURL
;
private
String
tracURL
;
public
PropertiesModel
()
{
this
.
loadSettings
();
}
private
void
loadSettings
()
{
final
Preferences
preferences
=
Preferences
.
userNodeForPackage
(
PropertiesModel
.
class
);
this
.
graphvizPath
=
preferences
.
get
(
PropertiesModel
.
KEY_GRAPHVIZ_PATH
,
"."
);
this
.
timeUnit
=
TimeUnit
.
valueOf
(
preferences
.
get
(
PropertiesModel
.
KEY_TIMEUNIT
,
TimeUnit
.
NANOSECONDS
.
name
()));
this
.
componentNames
=
ComponentNames
.
valueOf
(
preferences
.
get
(
PropertiesModel
.
KEY_COMPONENTS
,
ComponentNames
.
LONG
.
name
()));
this
.
operationNames
=
OperationNames
.
valueOf
(
preferences
.
get
(
PropertiesModel
.
KEY_OPERATIONS
,
OperationNames
.
SHORT
.
name
()));
this
.
additionalLogChecks
=
Boolean
.
valueOf
(
preferences
.
get
(
PropertiesModel
.
KEY_ADDITIONAL_LOG_CHECKS
,
Boolean
.
FALSE
.
toString
()));
this
.
activateRegularExpressions
=
Boolean
.
valueOf
(
preferences
.
get
(
PropertiesModel
.
KEY_REGULAR_EXPRESSIONS
,
Boolean
.
FALSE
.
toString
()));
final
Properties
properties
=
new
Properties
();
final
ClassLoader
classLoader
=
PropertiesModel
.
class
.
getClassLoader
();
try
(
InputStream
inputStream
=
classLoader
.
getResourceAsStream
(
"config.properties"
))
{
properties
.
load
(
inputStream
);
this
.
gitLabURL
=
properties
.
getProperty
(
PropertiesModel
.
KEY_GITLAB_URL
);
this
.
tracURL
=
properties
.
getProperty
(
PropertiesModel
.
KEY_TRAC_URL
);
}
catch
(
final
IOException
e
)
{
// NOPMD TODO
// PropertiesModel.LOGGER.error(e); //TODO
}
}
private
void
saveSettings
()
{
final
Preferences
preferences
=
Preferences
.
userNodeForPackage
(
PropertiesModel
.
class
);
preferences
.
put
(
PropertiesModel
.
KEY_GRAPHVIZ_PATH
,
this
.
graphvizPath
);
preferences
.
put
(
PropertiesModel
.
KEY_TIMEUNIT
,
this
.
timeUnit
.
name
());
preferences
.
put
(
PropertiesModel
.
KEY_COMPONENTS
,
this
.
componentNames
.
name
());
preferences
.
put
(
PropertiesModel
.
KEY_OPERATIONS
,
this
.
operationNames
.
name
());
preferences
.
put
(
PropertiesModel
.
KEY_ADDITIONAL_LOG_CHECKS
,
Boolean
.
toString
(
this
.
additionalLogChecks
));
preferences
.
put
(
PropertiesModel
.
KEY_REGULAR_EXPRESSIONS
,
Boolean
.
toString
(
this
.
activateRegularExpressions
));
try
{
preferences
.
flush
();
}
catch
(
final
BackingStoreException
e
)
{
// NOPMD TODO
// PropertiesModel.LOGGER.error(e);//TODO
}
}
public
String
getGraphvizPath
()
{
return
this
.
graphvizPath
;
}
public
void
setGraphvizPath
(
final
String
graphvizPath
)
{
this
.
graphvizPath
=
graphvizPath
;
this
.
saveSettings
();
}
public
TimeUnit
getTimeUnit
()
{
return
this
.
timeUnit
;
}
public
void
setTimeUnit
(
final
TimeUnit
timeUnit
)
{
this
.
timeUnit
=
timeUnit
;
this
.
saveSettings
();
}
public
ComponentNames
getComponentNames
()
{
return
this
.
componentNames
;
}
public
void
setComponentNames
(
final
ComponentNames
componentNames
)
{
this
.
componentNames
=
componentNames
;
this
.
saveSettings
();
}
public
OperationNames
getOperationNames
()
{
return
this
.
operationNames
;
}
public
void
setOperationNames
(
final
OperationNames
operationNames
)
{
this
.
operationNames
=
operationNames
;
this
.
saveSettings
();
}
public
static
PropertiesModel
getInstance
()
{
return
PropertiesModel
.
INSTANCE
;
}
public
boolean
isAdditionalLogChecks
()
{
return
this
.
additionalLogChecks
;
}
public
void
setAdditionalLogChecks
(
final
boolean
additionalLogChecks
)
{
this
.
additionalLogChecks
=
additionalLogChecks
;
this
.
saveSettings
();
}
public
boolean
isActivateRegularExpressions
()
{
return
this
.
activateRegularExpressions
;
}
public
void
setActivateRegularExpressions
(
final
boolean
activateRegularExpressions
)
{
this
.
activateRegularExpressions
=
activateRegularExpressions
;
this
.
saveSettings
();
}
public
String
getGitLabURL
()
{
return
this
.
gitLabURL
;
}
public
String
getTracURL
()
{
return
this
.
tracURL
;
}
/**
* @author Nils Christian Ehmke
*/
public
enum
ComponentNames
{
SHORT
,
LONG
}
/**
* @author Nils Christian Ehmke
*/
public
enum
OperationNames
{
SHORT
,
LONG
}
}
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