returnValue = super.invoke(request);
}
else
{
Map<?, ?> payload = request.getRequestPayload();
DeploymentID dtID = (DeploymentID) payload.get("DeploymentTargetID");
if(dtID == null)
throw new IllegalStateException("Null deployment target ID.");
log.info("invoke, payload: "+payload+", parameter: "+parameter);
try
{
if( parameter.equals("getRepositoryNames"))
{
returnValue = delegate.resolveDeploymentNames(dtID.getNames());
}
else if( parameter.equals("distribute") )
{
final URL url = dtID.getContentURL();
final VirtualFile vf = VFS.getChild(url);
if(vf == null || vf.exists() == false) {
throw new IllegalStateException(String.format("file (%s) does not exist. Use 'copyContent = true' to copy the deployment", url));
}
returnValue = delegate.distribute(dtID, null);
}
else if( parameter.equals("prepare"))
{
// TODO
}
else if( parameter.equals("start") )
{
delegate.startDeployments(dtID.getNames());
}
else if( parameter.equals("stop") )
{
delegate.stopDeployments(dtID.getNames());
}
else if( parameter.equals("remove"))
{
delegate.removeDeployments(dtID.getNames());
}
// Keep for backward compatibility
else if( parameter.equals("undeploy") )
{
delegate.removeDeployments(dtID.getNames());
}
else if (parameter.equals("redeploy"))
{
String[] names = dtID.getNames();
delegate.stopDeployments(names);
delegate.startDeployments(names);
}
}
catch(Exception e)