You can automate many aspects of deployment monitoring and management by configuring event listeners on the asset management server and the target servers, to listen for deployment events that include a specific state code.
To create and configure a DeploymentEventListener
:
Define a listener service class that implements the interface
DeploymentEventListener
and the methoddeploymentEvent(DeploymentEvent pEvent)
.Configure an instance in Nucleus on the appropriate server and register it with the
DeploymentServer
orDeploymentAgent
as appropriate:Configure the listener on the asset management server and register it with the
/atg/epub/DeploymentServer
, so it listens for deployment events fired when the deployment changes its state.Configure the listener on the target server and register it with the local
/atg/epub/DeploymentAgent
, so it listens for deployment events fired when an agent changes its state.
For an example, examine the source code for the DeploymentEmailer Listener
class, which is located at:
<ATG11dir>/Publishing/samples/Java
DeploymentEmailer Listener
ATG Content Administration includes this DeploymentEventListener
class:
atg.deployment.common.event.DeploymentEmailer
You can use this listener to send e-mail notifications when a deployment succeeds, is interrupted, or fails.
By default, instances of the DeploymentEmailer
class listen for deployment events that are fired when a deployment enters one of the following states:
DEPLOYMENT_COMPLETE
EVENT_INTERRUPT
Any error state such as
ERROR
andERROR_PREPARE
On receiving such an event, the listener sends an e-mail message to a specified recipient.
To set up a DeploymentEmailer
listener, first configure an instance of the DeploymentEmailer
class on the asset management server. For example:
$class=atg.deployment.common.event.DeploymentEmailer SMTPEmailSender=/atg/dynamo/service/SMTPEmail fromAddress=personA@myCompany.com toAddress=personB@myCompany.com useShortMessage=true
The following table describes the properties to configure:
Property | Description |
---|---|
| The ATG provides a standard component of type
For more information on e-mail senders and listeners, see the Platform Programming Guide. |
| The sender’s e-mail address. |
| The destination e-mail address. |
| Specifies the level of message detail:
|
| Specifies whether to enable the listener:
|
After the DeploymentEmailer
listener is configured, register it with the /atg/epub/DeploymentServer
by adding it to the list of listeners in the deploymentEventListeners
property.
If you require different functionality for the event listener, create a subclass of DeploymentEmailer
, override its deploymentEvent()
method with your own implementation, and configure an instance of this subclass.