net.rim.pushsdk.push.stats
Class PushStatsBatchUpdaterServiceImpl

java.lang.Object
  extended by net.rim.pushsdk.push.stats.PushStatsBatchUpdaterServiceImpl
All Implemented Interfaces:
Runnable, PushStatsBatchUpdaterService

public class PushStatsBatchUpdaterServiceImpl
extends Object
implements PushStatsBatchUpdaterService

Implementation of the PushStatsBatchUpdaterService interface.

Author:
mdandrea

Nested Class Summary
protected static class PushStatsBatchUpdaterServiceImpl.KeyComparator
          A comparator used to sort keys of the form -.
 
Field Summary
protected static String KEY_SEPARATOR
          The key separator used to combine a push app id with a day of the year.
 
Constructor Summary
PushStatsBatchUpdaterServiceImpl()
           
 
Method Summary
 void addPushStatsUpdate(PushStats pushStats)
          Adds a push stats object to the list of updates to be batched.
 void destroy()
          Attempts to stop threads when the bean is destroyed.
 int getPushStatsQueueSize()
          Returns the size of the queue holding push stats waiting to be batched and processed.
 void resetRunningContentSum(String pushApplicationId)
          When a reset is called, find all push stats objects in the list of updates and set their contribution to the running content sum to 0.
 void resetRunningPushCount(String pushApplicationId)
          When a reset is called, find all push stats objects in the list of updates and set their contribution to the running push count to 0.
 void run()
          Performs a batch update of several push stats objects to storage.
 void setPushSDKProperties(PushSDKProperties pushSDKProperties)
          Support for dependency injection.
 void setPushStatsDAO(PushStatsDAO pushStatsDAO)
          Support for dependency injection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SEPARATOR

protected static final String KEY_SEPARATOR
The key separator used to combine a push app id with a day of the year.

See Also:
Constant Field Values
Constructor Detail

PushStatsBatchUpdaterServiceImpl

public PushStatsBatchUpdaterServiceImpl()
Method Detail

setPushStatsDAO

public void setPushStatsDAO(PushStatsDAO pushStatsDAO)
Description copied from interface: PushStatsBatchUpdaterService
Support for dependency injection. Sets the PushStatsDAO to use.

Specified by:
setPushStatsDAO in interface PushStatsBatchUpdaterService
Parameters:
pushStatsDAO - the Push Stats Data Access Object

setPushSDKProperties

public void setPushSDKProperties(PushSDKProperties pushSDKProperties)
Description copied from interface: PushStatsBatchUpdaterService
Support for dependency injection. This will override the default PushSDKProperties implementation.

Specified by:
setPushSDKProperties in interface PushStatsBatchUpdaterService
Parameters:
pushSDKProperties - the Push SDK Properties

destroy

public void destroy()
Description copied from interface: PushStatsBatchUpdaterService
Attempts to stop threads when the bean is destroyed.

Specified by:
destroy in interface PushStatsBatchUpdaterService

getPushStatsQueueSize

public int getPushStatsQueueSize()
Description copied from interface: PushStatsBatchUpdaterService
Returns the size of the queue holding push stats waiting to be batched and processed.

Specified by:
getPushStatsQueueSize in interface PushStatsBatchUpdaterService
Returns:
the size of the push stats queue

addPushStatsUpdate

public void addPushStatsUpdate(PushStats pushStats)
Description copied from interface: PushStatsBatchUpdaterService
Adds a push stats object to the list of updates to be batched.

Specified by:
addPushStatsUpdate in interface PushStatsBatchUpdaterService
Parameters:
pushStats - the push stats object

run

public void run()
Description copied from interface: PushStatsBatchUpdaterService
Performs a batch update of several push stats objects to storage.

Specified by:
run in interface Runnable
Specified by:
run in interface PushStatsBatchUpdaterService

resetRunningPushCount

public void resetRunningPushCount(String pushApplicationId)
Description copied from interface: PushStatsBatchUpdaterService
When a reset is called, find all push stats objects in the list of updates and set their contribution to the running push count to 0.

Specified by:
resetRunningPushCount in interface PushStatsBatchUpdaterService
Parameters:
pushApplicationId - the push application id

resetRunningContentSum

public void resetRunningContentSum(String pushApplicationId)
Description copied from interface: PushStatsBatchUpdaterService
When a reset is called, find all push stats objects in the list of updates and set their contribution to the running content sum to 0.

Specified by:
resetRunningContentSum in interface PushStatsBatchUpdaterService
Parameters:
pushApplicationId - the push application id


Copyright © 2011 Research In Motion. All Rights Reserved.