public class NotificationConfigurator extends Object
NotificationConfigurator reads and stores properties from a configuration file.
It provides simple properties querying for timer interval properties types, e.g. #getTimerInterval(String)
Constructor and Description |
---|
NotificationConfigurator(String confFile)
Creates a
NotificationConfigurator by evaluating properties values from a given file. |
Modifier and Type | Method and Description |
---|---|
static int |
extractNumericProperty(String intervalProp)
Extract a positive numeric property out of a property value
|
Map<String,String> |
getProperties()
Returns properties which read from file.
|
long |
getTimerInterval(String intervalPropertyName,
long defaultInterval)
Gets a value for timer interval by a given property name
|
public NotificationConfigurator(String confFile) throws NotificationServiceException
NotificationConfigurator
by evaluating properties values from a given file.confFile
- a path to the configuration fileNotificationServiceException
public Map<String,String> getProperties()
public long getTimerInterval(String intervalPropertyName, long defaultInterval) throws NotificationServiceException
intervalPropertyName
- an interval property keydefaultInterval
- a default interval valueNotificationServiceException
public static int extractNumericProperty(String intervalProp) throws NumberFormatException
intervalProp
- property valueNotificationServiceException
NumberFormatException
Copyright © 2012. All Rights Reserved.