/** * {@inheritDoc} */ public ProfileDeployment getDeployment(String name) throws NoSuchDeploymentException { ProfileDeployment deployment = resolveDeployment(name); if(deployment == null) { throw new NoSuchDeploymentException(name); } return deployment; }
/** * {@inheritDoc} */ public DeploymentTemplateInfo getTemplate(String name) throws NoSuchDeploymentException { if(name == null) { throw new IllegalArgumentException("null template name"); } final DeploymentTemplate template = this.templates.get(name); if( template == null ) { formatter.applyPattern(i18n.getString("ManagementView.NoSuchTemplate")); //$NON-NLS-1$ Object[] args = {name}; String msg = formatter.format(args); throw new NoSuchDeploymentException(msg); } // Make sure to return a copy to avoid call by reference uses modifying the template values final DeploymentTemplateInfo info = template.getInfo(); return info.copy(); }
throw new NoSuchDeploymentException("Managed deployment: " + name + " not found.");
/** * Resolve a deployment name against all registered profiles. * * @param name the simple deployment name * @return the resolved deployment name * @throws NoSuchDeploymentException */ protected String resolveDeploymentName(String name) throws NoSuchDeploymentException { for(ProfileKey key : actionController.getActiveProfiles()) { ManagedProfile managed = actionController.getManagedProfile(key); if(managed == null) { continue; } Profile profile = managed.getProfile(); if(profile.hasDeployment(name)) { ProfileDeployment deployment = profile.getDeployment(name); return deployment.getName(); } } throw new NoSuchDeploymentException(name); }
throw new NoSuchDeploymentException(deploymentName);