de.nava.informa.utils
Class UpdateChannelInfo

java.lang.Object
  extended by de.nava.informa.utils.UpdateChannelInfo

public class UpdateChannelInfo
extends Object

Metadata class containing properties about channel updates.

Author:
Niko Schmuck

Constructor Summary
UpdateChannelInfo(int deactivateAfterErrors)
          Constructor.
 
Method Summary
 int getDeactivateAfterErrors()
           
 boolean getFormatDetected()
          Has the feed been grabbed for the first time, and successfully parsed?
 Exception getLastException()
           
 long getLastUpdatedTimestamp()
           
 int getNrProblemsOccurred()
           
 void increaseProblemsOccurred(Exception e)
          Increases the number of times a channel could not be read.
 void reset()
          Resets the state, as if no problems ever occurred.
 void setFormatDetected(boolean formatDetected)
           
 void setLastUpdatedTimestamp(long lastUpdatedTimestamp)
           
 boolean shouldDeactivate()
          Should the channel be deactivated?
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UpdateChannelInfo

public UpdateChannelInfo(int deactivateAfterErrors)
Constructor.

Parameters:
deactivateAfterErrors - Number of errors after which a channel should not any longer be parsed periodically. Specify 0, if you do not want auto-deactivation.
Method Detail

getNrProblemsOccurred

public int getNrProblemsOccurred()
Returns:
Number of times a problem occurred while parsing a channel.

getDeactivateAfterErrors

public int getDeactivateAfterErrors()
Returns:
Number of errors after a channel should be automatically deactivated.

getLastException

public Exception getLastException()
Returns:
The last exception that was captured when a channel problem occurred. May return null in the case no problem was reported yet.

reset

public void reset()
Resets the state, as if no problems ever occurred.


increaseProblemsOccurred

public void increaseProblemsOccurred(Exception e)
Increases the number of times a channel could not be read.

Parameters:
e - The Exception causing the channel parse problem.

shouldDeactivate

public boolean shouldDeactivate()
Should the channel be deactivated?

Returns:
true in the case auto-deactivation is on and more errors have been reported than the given threshold.

getFormatDetected

public boolean getFormatDetected()
Has the feed been grabbed for the first time, and successfully parsed?

Returns:
true if format has been detected, and ChannelIF.getFormat would return a valid format.

setFormatDetected

public void setFormatDetected(boolean formatDetected)

toString

public String toString()
Overrides:
toString in class Object

getLastUpdatedTimestamp

public long getLastUpdatedTimestamp()

setLastUpdatedTimestamp

public void setLastUpdatedTimestamp(long lastUpdatedTimestamp)


Copyright © 2002-2007 Niko Schmuck. All Rights Reserved.