com.miginfocom.calendar.activity.iofilter
Class AbstractActivityIOPlugin

java.lang.Object
  extended by com.miginfocom.calendar.activity.iofilter.AbstractActivityIOPlugin
All Implemented Interfaces:
ActivityIOPlugin
Direct Known Subclasses:
ICalendarImport

public abstract class AbstractActivityIOPlugin
extends java.lang.Object
implements ActivityIOPlugin

A small boiler plate implemetation to enable threaded update checks for ActivityIOPlugins. It has a simple repeating check that is run in a separate thread. The repetition delay is started when the last check was completed.
Subclass and implement your checking code in pollUpdates() and update the ActivityDepository with those changes.


Constructor Summary
AbstractActivityIOPlugin()
           
 
Method Summary
protected abstract  void pollUpdates()
          Called by this class when there is either a change in the subscriptions in the broker or the poll interval has passes.
 void startAutoPoll(long firstUpdateMillis, long repeatMillis)
          Sets the update milliseconds to wait after the next time a wait is issued.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.miginfocom.calendar.activity.iofilter.ActivityIOPlugin
getDefaultPollInterval, getID, getName, isReadSupported, isWriteSupported
 

Constructor Detail

AbstractActivityIOPlugin

public AbstractActivityIOPlugin()
Method Detail

startAutoPoll

public void startAutoPoll(long firstUpdateMillis,
                          long repeatMillis)
Sets the update milliseconds to wait after the next time a wait is issued. If this is the first time the method is called it starts a new thread. If updateMillis is -1 no auto update is done and if the thread is currently rinning it is interrupted.

Parameters:
firstUpdateMillis - How many millis to wait for the first update. Greater than or equal to 0.
repeatMillis - How many millis to wait before calling pollUpdates() periodically. If -1 no repetitive updates will be scheduled.z

pollUpdates

protected abstract void pollUpdates()
                             throws java.lang.Exception
Called by this class when there is either a change in the subscriptions in the broker or the poll interval has passes.

Override this method and go check for the activities. When they are found and retrieved post them to the ActivityDepository.

Throws:
java.lang.Exception


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.