de.unikassel.android.sdcframework.preferences
Class ServiceConfigurationImpl

Package class diagram package ServiceConfigurationImpl
java.lang.Object
  extended by de.unikassel.android.sdcframework.preferences.ServiceConfigurationImpl
All Implemented Interfaces:
Configuration, ServiceConfiguration, UpdatableConfiguration<ServiceConfiguration>

public class ServiceConfigurationImpl
extends Object
implements ServiceConfiguration

Implementation of the service configuration.


Field Summary
private  long broadcastFrequency
          The broadcast interval in milliseconds.
private  boolean dbFullDeletionIsPriorityBased
          Flag if the database full strategy does work priority based.
private  int dbFullDeletionRecordCount
          The record count which is deleted every time the {link database full strategy is executed.
private  DBFullStrategyDescription dbFullStrategy
          The configured @link database full strategy .
private  long dbFullWaitTime
          The milliseconds the persistent storage manager is paused every time the {link database full strategy is executed.
private  boolean isAddingSampleLocation
          The flag for attachment of a location fix to each sample
private  boolean isBroadcastingSamples
          The flag for the service sample broadcast behavior
private  boolean isSamplingEnabled
          The sampling enabled state.
private  boolean isStoringSamples
          The flag for persistent storage of samples for transmission purpose
private  boolean isTransmittingSamples
          The transmission behavior flag
private  TransmissionProtocolConfiguration logTransferConfiguration
          The log transfer configuration
private  long maxDBSize
          The maximum database size in bytes
private  WeeklySchedule schedule
          The weekly schedule.
private  TransmissionConfiguration transmissionConfiguration
          The transmission configuration
 
Constructor Summary
ServiceConfigurationImpl()
          Constructor
 
Method Summary
 boolean equals(Object o)
           
 long getBroadcastFrequency()
          Getter for the broadcast frequency
 int getDBFullDeletionRecordCount()
          Getter for the record count to be deleted in case of a full database ( used by the sample deletion strategy )
 DBFullStrategyDescription getDBFullStrategy()
          Getter for the configured Database full strategy chain
 long getDBFullWaitTime()
          Getter for the wait time used by the wait strategy in case of a full database
 TransmissionProtocolConfiguration getLogTransferConfiguration()
          Getter for the log transfer configuration
 long getMaximumDatabaseSize()
          Getter for the maximum database size in bytes
 TransmissionConfiguration getTransmissionConfiguration()
          Getter for the transmission configuration
 WeeklySchedule getWeeklySchedule()
          Getter for the weekly runtime schedule.
 boolean isAddingSampleLocation()
          Getter for the flag for adding a location fix to each sample
 boolean isBroadcastingSamples()
          Getter for the flag for sample broadcasts behavior
 boolean isDBFullDeletionPriorityBased()
          Getter for the flag database deletion strategy priority flag
 boolean isSamplingEnabled()
          Getter for the sampling enabled state
 boolean isStoringSamples()
          Getter for the flag for persistent storage behavior
 boolean isTransmittingSamples()
          Getter for the transmission behavior flag
 void setBroadcastFrequency(Long frequency)
          Setter for the broadcast frequency
 void setBroadcastingSamples(Boolean isBroadcastingSamples)
          Setter for the flag for sample broadcasts behavior
 void setDBFullDeletionPriorityBased(Boolean dbFullDeletionIsPriorityBased)
          Setter for the flag database deletion strategy priority flag
 void setDBFullDeletionRecordCount(Integer dbFullDeletionRecordCount)
          Setter for the record count to be deleted in case of a full database ( used by the sample deletion strategy )
 void setDBFullStrategy(DBFullStrategyDescription dbFullStrategy)
          Setter for the configured database full strategy chain
 void setDBFullWaitTime(Long dbFullWaitTime)
          Setter for the wait time used by the wait strategy in case of a full database
 void setIsAddingSampleLocation(Boolean isAddingSampleLocation)
          Setter for the flag for adding a location fix to each sample
 void setLogTransferConfiguration(TransmissionProtocolConfiguration config)
          Setter for the log transfer configuration
 void setMaximumDatabaseSize(Long maxDBSize)
          Setter for the maximum database size in bytes
 void setSamplingEnabled(Boolean isSamplingEnabled)
          Setter for the sampling enabled state
 void setStoringSamples(Boolean isStoringSamples)
          Setter for flag for persistent storage behavior
 void setTransmissionConfiguration(TransmissionConfiguration config)
          Setter for the transmission configuration
 void setTransmittingSamples(Boolean isTransmittingSamples)
          Setter for the transmission behavior flag
 void setWeeklySchedule(WeeklySchedule schedule)
          Setter for the weekly runtime schedule.
 void update(SDCConfiguration config)
          Does update this configuration by a serializable configuration
 void update(ServiceConfiguration configuration)
          Does update this configuration by another configuration
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isBroadcastingSamples

private boolean isBroadcastingSamples
The flag for the service sample broadcast behavior


broadcastFrequency

private long broadcastFrequency
The broadcast interval in milliseconds.


isSamplingEnabled

private boolean isSamplingEnabled
The sampling enabled state.


isAddingSampleLocation

private boolean isAddingSampleLocation
The flag for attachment of a location fix to each sample


isStoringSamples

private boolean isStoringSamples
The flag for persistent storage of samples for transmission purpose


isTransmittingSamples

private boolean isTransmittingSamples
The transmission behavior flag


maxDBSize

private long maxDBSize
The maximum database size in bytes


dbFullDeletionIsPriorityBased

private boolean dbFullDeletionIsPriorityBased
Flag if the database full strategy does work priority based.
If this flag is true and the {link database full strategy is executed, it will first delete the oldest samples with lowest priority.


dbFullDeletionRecordCount

private int dbFullDeletionRecordCount
The record count which is deleted every time the {link database full strategy is executed.


dbFullWaitTime

private long dbFullWaitTime
The milliseconds the persistent storage manager is paused every time the {link database full strategy is executed.


dbFullStrategy

private DBFullStrategyDescription dbFullStrategy
The configured @link database full strategy .


transmissionConfiguration

private final TransmissionConfiguration transmissionConfiguration
The transmission configuration


logTransferConfiguration

private final TransmissionProtocolConfiguration logTransferConfiguration
The log transfer configuration


schedule

private WeeklySchedule schedule
The weekly schedule.

Constructor Detail

ServiceConfigurationImpl

public ServiceConfigurationImpl()
Constructor

Method Detail

update

public void update(ServiceConfiguration configuration)
Description copied from interface: UpdatableConfiguration
Does update this configuration by another configuration

Specified by:
update in interface UpdatableConfiguration<ServiceConfiguration>
Parameters:
configuration - the configuration to update from

update

public void update(SDCConfiguration config)
Description copied from interface: ServiceConfiguration
Does update this configuration by a serializable configuration

Specified by:
update in interface ServiceConfiguration
Parameters:
config - the serializable configuration to update from

equals

public boolean equals(Object o)
Overrides:
equals in class Object

isBroadcastingSamples

public boolean isBroadcastingSamples()
Description copied from interface: ServiceConfiguration
Getter for the flag for sample broadcasts behavior

Specified by:
isBroadcastingSamples in interface ServiceConfiguration
Returns:
true if samples shall be broadcasted, false otherwise

setBroadcastingSamples

public void setBroadcastingSamples(Boolean isBroadcastingSamples)
Description copied from interface: ServiceConfiguration
Setter for the flag for sample broadcasts behavior

Specified by:
setBroadcastingSamples in interface ServiceConfiguration
Parameters:
isBroadcastingSamples - the flag for sample broadcasts to set

isSamplingEnabled

public boolean isSamplingEnabled()
Description copied from interface: ServiceConfiguration
Getter for the sampling enabled state

Specified by:
isSamplingEnabled in interface ServiceConfiguration
Returns:
true if sampling is activated, false otherwise

setSamplingEnabled

public void setSamplingEnabled(Boolean isSamplingEnabled)
Description copied from interface: ServiceConfiguration
Setter for the sampling enabled state

Specified by:
setSamplingEnabled in interface ServiceConfiguration
Parameters:
isSamplingEnabled - the the sampling enabled state to set

isStoringSamples

public final boolean isStoringSamples()
Description copied from interface: ServiceConfiguration
Getter for the flag for persistent storage behavior

Specified by:
isStoringSamples in interface ServiceConfiguration
Returns:
true if samples will be stored persistent, false otherwise

setStoringSamples

public final void setStoringSamples(Boolean isStoringSamples)
Description copied from interface: ServiceConfiguration
Setter for flag for persistent storage behavior

Specified by:
setStoringSamples in interface ServiceConfiguration
Parameters:
isStoringSamples - the flag for persistent storage behavior to set

isTransmittingSamples

public boolean isTransmittingSamples()
Description copied from interface: ServiceConfiguration
Getter for the transmission behavior flag

Specified by:
isTransmittingSamples in interface ServiceConfiguration
Returns:
true if samples will be transferred to a remote host, false otherwise

setTransmittingSamples

public void setTransmittingSamples(Boolean isTransmittingSamples)
Description copied from interface: ServiceConfiguration
Setter for the transmission behavior flag

Specified by:
setTransmittingSamples in interface ServiceConfiguration
Parameters:
isTransmittingSamples - the transmission behavior flag to set

setMaximumDatabaseSize

public void setMaximumDatabaseSize(Long maxDBSize)
Description copied from interface: ServiceConfiguration
Setter for the maximum database size in bytes

Specified by:
setMaximumDatabaseSize in interface ServiceConfiguration
Parameters:
maxDBSize - the maximum database size in bytes

getMaximumDatabaseSize

public long getMaximumDatabaseSize()
Description copied from interface: ServiceConfiguration
Getter for the maximum database size in bytes

Specified by:
getMaximumDatabaseSize in interface ServiceConfiguration
Returns:
the maximum database size in bytes

setDBFullWaitTime

public void setDBFullWaitTime(Long dbFullWaitTime)
Description copied from interface: ServiceConfiguration
Setter for the wait time used by the wait strategy in case of a full database

Specified by:
setDBFullWaitTime in interface ServiceConfiguration
Parameters:
dbFullWaitTime - the wait time in milliseconds to set

getDBFullWaitTime

public long getDBFullWaitTime()
Description copied from interface: ServiceConfiguration
Getter for the wait time used by the wait strategy in case of a full database

Specified by:
getDBFullWaitTime in interface ServiceConfiguration
Returns:
the wait time in milliseconds

setDBFullDeletionRecordCount

public void setDBFullDeletionRecordCount(Integer dbFullDeletionRecordCount)
Description copied from interface: ServiceConfiguration
Setter for the record count to be deleted in case of a full database ( used by the sample deletion strategy )

Specified by:
setDBFullDeletionRecordCount in interface ServiceConfiguration
Parameters:
dbFullDeletionRecordCount - the deletion record count to set

getDBFullDeletionRecordCount

public int getDBFullDeletionRecordCount()
Description copied from interface: ServiceConfiguration
Getter for the record count to be deleted in case of a full database ( used by the sample deletion strategy )

Specified by:
getDBFullDeletionRecordCount in interface ServiceConfiguration
Returns:
the deletion record count

setDBFullDeletionPriorityBased

public void setDBFullDeletionPriorityBased(Boolean dbFullDeletionIsPriorityBased)
Description copied from interface: ServiceConfiguration
Setter for the flag database deletion strategy priority flag

Specified by:
setDBFullDeletionPriorityBased in interface ServiceConfiguration
Parameters:
dbFullDeletionIsPriorityBased - true if the database deletion strategy shall delete lower priorities first, false otherwise

isDBFullDeletionPriorityBased

public boolean isDBFullDeletionPriorityBased()
Description copied from interface: ServiceConfiguration
Getter for the flag database deletion strategy priority flag

Specified by:
isDBFullDeletionPriorityBased in interface ServiceConfiguration
Returns:
true if the database deletion strategy shall delete lower priorities first, false otherwise

setDBFullStrategy

public void setDBFullStrategy(DBFullStrategyDescription dbFullStrategy)
Description copied from interface: ServiceConfiguration
Setter for the configured database full strategy chain

Specified by:
setDBFullStrategy in interface ServiceConfiguration
Parameters:
dbFullStrategy - the configured database full strategy chain

getDBFullStrategy

public DBFullStrategyDescription getDBFullStrategy()
Description copied from interface: ServiceConfiguration
Getter for the configured Database full strategy chain

Specified by:
getDBFullStrategy in interface ServiceConfiguration
Returns:
the configured Database full strategy chain

setTransmissionConfiguration

public void setTransmissionConfiguration(TransmissionConfiguration config)
Description copied from interface: ServiceConfiguration
Setter for the transmission configuration

Specified by:
setTransmissionConfiguration in interface ServiceConfiguration
Parameters:
config - the transmission configuration to set

getTransmissionConfiguration

public TransmissionConfiguration getTransmissionConfiguration()
Description copied from interface: ServiceConfiguration
Getter for the transmission configuration

Specified by:
getTransmissionConfiguration in interface ServiceConfiguration
Returns:
the transmission configuration

setLogTransferConfiguration

public void setLogTransferConfiguration(TransmissionProtocolConfiguration config)
Description copied from interface: ServiceConfiguration
Setter for the log transfer configuration

Specified by:
setLogTransferConfiguration in interface ServiceConfiguration
Parameters:
config - the log transfer configuration to set

getLogTransferConfiguration

public TransmissionProtocolConfiguration getLogTransferConfiguration()
Description copied from interface: ServiceConfiguration
Getter for the log transfer configuration

Specified by:
getLogTransferConfiguration in interface ServiceConfiguration
Returns:
the log transfer configuration, or null if not configured

isAddingSampleLocation

public boolean isAddingSampleLocation()
Description copied from interface: ServiceConfiguration
Getter for the flag for adding a location fix to each sample

Specified by:
isAddingSampleLocation in interface ServiceConfiguration
Returns:
true if a location fix is added to each sample, false otherwise

setIsAddingSampleLocation

public void setIsAddingSampleLocation(Boolean isAddingSampleLocation)
Description copied from interface: ServiceConfiguration
Setter for the flag for adding a location fix to each sample

Specified by:
setIsAddingSampleLocation in interface ServiceConfiguration
Parameters:
isAddingSampleLocation - the flag for adding a location fix to each sample

getBroadcastFrequency

public long getBroadcastFrequency()
Description copied from interface: ServiceConfiguration
Getter for the broadcast frequency

Specified by:
getBroadcastFrequency in interface ServiceConfiguration
Returns:
the broadcast frequency

setBroadcastFrequency

public void setBroadcastFrequency(Long frequency)
Description copied from interface: ServiceConfiguration
Setter for the broadcast frequency

Specified by:
setBroadcastFrequency in interface ServiceConfiguration
Parameters:
frequency - the broadcast frequency to set

setWeeklySchedule

public void setWeeklySchedule(WeeklySchedule schedule)
Description copied from interface: ServiceConfiguration
Setter for the weekly runtime schedule.

Specified by:
setWeeklySchedule in interface ServiceConfiguration
Parameters:
schedule - the weekly schedule configuration to set.

getWeeklySchedule

public WeeklySchedule getWeeklySchedule()
Description copied from interface: ServiceConfiguration
Getter for the weekly runtime schedule.

Specified by:
getWeeklySchedule in interface ServiceConfiguration
Returns:
the weekly schedule configuration, or null if not configured