com.escenic.changelog.AbstractAgent

This is the base implementation. It supplies change log entries as unprocessed Atom XML entries. 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 InputStream pInputStream)

This method is called once for each entry in the change log. It is called by handleEntry(final InputStream pInputStream), but only if isServiceRunning() returns true. The InputStream contains an XML representation of this content item.

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 InputStream pInputStream)

This method is called once for each deleted entry in the change log. It is called by handleEntry(final InputStream pInputStream), but only if isServiceRunning() returns true. The InputStream contains 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.