!--a11y-->
Deployment Hook InterfaceThe deployment hook interface:
public interface IDeploymentHook { /** * Creates a handler for the operation specified by the event. */ public IDeploymentHandler createHandler(IDeploymentEvent event) throws DeploymentHookException; } |
The event passed as a parameter indicates the current operation in order for the hook to return the corresponding handler.

public IDeploymentHandler createHandler(IDeploymentEvent event) throws DeploymentHookException { if (event.getType() == DeploymentEventType.BEGIN_DEPLOYMENT) { System.out.println( "BEGIN deployment of: " + event.getApplicationName()); return new TestDeploymentHandler(event); } else if (event.getType() == DeploymentEventType.BEGIN_UPLOAD) { System.out.println("BEGIN upload of: " + event.getApplicationName()); return new TestUploadHandler(event); } else { return null; } } |

We recommend, that you return a new handler instance for each createHandler() call.
These events corresponding to a sequence are necessary when the hook needs to handle the upload of several (inter-dependent) PAR files. A typical use-case is the import of business packages (EPA files):
Event |
Description |
BEGIN_UPLOAD_SEQUENCE |
An entity containing (Business Package, EPA) a set of PARs will be loaded in the portal repository. |
BEGIN_DEPLOYMENT_SEQUENCE |
An entity containing (Business Package, EPA) a set of PARs will be deployed in the portal environment. |
BEGIN_UPLOAD |
The PAR has been loaded in the portal repository. |
BEGIN_DEPLOYMENT |
The PAR is about to be deployed in the portal environment. |
END_UPLOAD_SEQUENCE |
The upload in the portal repository is finished. |
END_DEPLOYMENT_SEQUENCE |
The deployment in the portal environment is finished. |
