com.escenic.changelog.agent.JdomAgent
This implementation supplies change log entries as JDOM element objects, so you don't have to parse the XML yourself. To extend it, implement the following four methods:
startService()
-
This method is called when the agent is started. Use it to validate the agent configuration, log into third-party services (if required) and carry out any other necessary start-up operations.
The following exceptions are handled by the framework:
IllegalStateException
-
Throw this exception if the agent is in the wrong state for start-up.
IllegalArgumentException
-
Throw this exception if the agent configuration is invalid.
Exception
-
Throw this exception if anything else goes wrong during startup.
consumeEntry(final Element pEntry)
-
This method is called once for each entry in the change log. It is called by
handleEntry(final InputStream pInputStream)
, but only ifisServiceRunning()
returnstrue
.pEntry
contains a JDOMElement
representing the change log entry.The following exceptions are handled by the framework:
PermanentException
-
Throw this exception if an error occurs that will not be corrected without external intervention (from the system administrator, for example). The Change Log Daemon will not resubmit this entry for processing.
TemporaryException
-
Throw this exception if an error occurs that is likely to be temporary. The Change Log Daemon will resubmit this entry later.
Any other exception thrown will be logged, and the Change Log Daemon stopped.
consumeDeletedEntry(final Element pEntry)
-
This method is called once for each deleted entry in the change log. It is called by
handleEntry(final InputStream pInputStream)
, but only ifisServiceRunning()
returnstrue
.pEntry
contains a JDOMElement
representing an Atom tombstone deleted-entry element.The following exceptions are handled by the framework:
PermanentException
-
Throw this exception if an error occurs that will not be corrected without external intervention (from the system administrator, for example). The Change Log Daemon will not resubmit this entry for processing.
TemporaryException
-
Throw this exception if an error occurs that is likely to be temporary. The Change Log Daemon will resubmit this entry later.
Any other exception thrown will be logged, and the Change Log Daemon stopped.
stopService()
-
This method is called when the agent is stopped. Use it to log out of third-party services (if necessary) and carry out any other necessary clean-up operations.
The following exceptions are handled by the framework:
IllegalStateException
-
Throw this exception if the agent is in the wrong state for shut-down.
IllegalArgumentException
-
Throw this exception if the agent configuration is invalid.
Exception
-
Throw this exception if anything else goes wrong during startup.