public Set<Contribution> findContributions(List<URI> uris) { Set<Contribution> contributions = new LinkedHashSet<>(uris.size()); for (URI uri : uris) { Contribution contribution = metadataStore.find(uri); if (contribution == null) { throw new AssertionError("Contribution not found for: " + uri); } contributions.add(contribution); } return contributions; }
public Set<Contribution> findContributions(List<URI> uris) { Set<Contribution> contributions = new LinkedHashSet<Contribution>(uris.size()); for (URI uri : uris) { Contribution contribution = metadataStore.find(uri); if (contribution == null) { throw new AssertionError("Contribution not found for: " + uri); } contributions.add(contribution); } return contributions; }
public Set<Contribution> findContributions(List<URI> uris) { Set<Contribution> contributions = new LinkedHashSet<>(uris.size()); for (URI uri : uris) { Contribution contribution = metadataStore.find(uri); if (contribution == null) { throw new AssertionError("Contribution not found for: " + uri); } contributions.add(contribution); } return contributions; }
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String info = req.getPathInfo().substring(1); // path info always begins with '/' try { URI uri = new URI(info); Contribution contribution = store.find(uri); if (contribution == null) { throw new ServletException("Contribution not found: " + info + ". Request URL was: " + info); } URL url = contribution.getLocation(); copy(url.openStream(), resp.getOutputStream()); } catch (URISyntaxException e) { throw new ServletException("Invalid URI: " + info, e); } }
public DeploymentPlan findPlan(String plan) throws DeploymentException { QName planName = new QName(PLAN_NAMESPACE, plan); QNameSymbol symbol = new QNameSymbol(planName); ResourceElement<QNameSymbol, DeploymentPlan> element = metadataStore.find(DeploymentPlan.class, symbol); if (element == null) { return null; } return element.getValue(); }
public Composite findComposite(QName deployable) throws DeploymentException { QNameSymbol symbol = new QNameSymbol(deployable); ResourceElement<QNameSymbol, Composite> element = metadataStore.find(Composite.class, symbol); if (element == null) { String id = deployable.toString(); throw new DeployableNotFoundException("Deployable not found: " + id, id); } return element.getValue(); }
public DeploymentPlan findDefaultPlan(QName deployable) { // default to first found deployment plan in a contribution if one is not specifed for a distributed deployment QNameSymbol symbol = new QNameSymbol(deployable); Contribution contribution = metadataStore.find(Composite.class, symbol).getResource().getContribution(); return findDefaultPlan(contribution); }
public synchronized void deactivateDefinitions(URI uri) throws DeploymentException { Contribution contribution = metadataStore.find(uri); if (ContributionState.INSTALLED != contribution.getState()) { throw new ContributionNotInstalledException("Contribution is not installed: " + uri); } try { Set<PolicySet> policySets = policyRegistry.deactivateDefinitions(uri); if (!policySets.isEmpty()) { undeployPolicySets(policySets); } } catch (PolicyActivationException e) { throw new DeploymentException(e); } }
@SuppressWarnings({"unchecked"}) public Definition resolveWsdl(URI contributionUri, QName wsdlName) throws WsdlResolutionException { WsdlSymbol symbol = new WsdlSymbol(wsdlName); try { ResourceElement<WsdlSymbol, Definition> element = store.find(contributionUri, Definition.class, symbol); if (element == null) { throw new WsdlResolutionException("WSDL not found: " + wsdlName); } return element.getValue(); } catch (StoreException e) { throw new WsdlResolutionException(e); } }
public void undeploy(QName name) throws Fabric3Exception { QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metaDataStore.find(Composite.class, symbol); if (element == null) { throw new Fabric3Exception("Component not deployed: " + name); } Composite composite = element.getValue(); domain.undeploy(composite); Resource resource = element.getResource(); Contribution contribution = resource.getContribution(); contribution.getResources().remove(resource); }
public void undeploy(QName name) throws Fabric3Exception { QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metaDataStore.find(Composite.class, symbol); if (element == null) { throw new Fabric3Exception("Component not deployed: " + name); } Composite composite = element.getValue(); domain.undeploy(composite); Resource resource = element.getResource(); Contribution contribution = resource.getContribution(); contribution.getResources().remove(resource); }
public void undeploy(QName name) throws DeploymentException { try { QNameSymbol symbol = new QNameSymbol(name); ResourceElement<QNameSymbol, Composite> element = metaDataStore.find(Composite.class, symbol); if (element == null) { throw new DeploymentException("Component not deployed: " + name); } Composite composite = element.getValue(); domain.undeploy(composite, false); Resource resource = element.getResource(); Contribution contribution = resource.getContribution(); contribution.getResources().remove(resource); } catch (org.fabric3.api.host.domain.DeploymentException e) { throw new DeploymentException(e); } }
public synchronized void undeploy(URI uri) throws Fabric3Exception { Contribution contribution = metadataStore.find(uri); if (contribution == null) { throw new Fabric3Exception("Contribution not found: " + uri); } List<Deployable> deployables = contribution.getManifest().getDeployables(); if (deployables.isEmpty()) { return; } LogicalCompositeComponent domain = logicalComponentManager.getDomainComposite(); collector.markForCollection(uri, domain); Deployment deployment = generator.generate(domain); collector.collect(domain); deployer.deploy(deployment); contribution.undeploy(); }
public synchronized void undeploy(Composite composite) throws Fabric3Exception { LogicalCompositeComponent domain = logicalComponentManager.getDomainComposite(); URI contributionUri = composite.getContributionUri(); collector.markForCollection(contributionUri, domain); Deployment deployment = generator.generate(domain); collector.collect(domain); deployer.deploy(deployment); Contribution contribution = metadataStore.find(contributionUri); contribution.undeploy(); }
public synchronized void undeploy(Composite composite) throws Fabric3Exception { LogicalCompositeComponent domain = logicalComponentManager.getDomainComposite(); URI contributionUri = composite.getContributionUri(); collector.markForCollection(contributionUri, domain); Deployment deployment = generator.generate(domain); collector.collect(domain); deployer.deploy(deployment); Contribution contribution = metadataStore.find(contributionUri); contribution.undeploy(); }
public synchronized void undeploy(URI uri) throws Fabric3Exception { Contribution contribution = metadataStore.find(uri); if (contribution == null) { throw new Fabric3Exception("Contribution not found: " + uri); } List<Deployable> deployables = contribution.getManifest().getDeployables(); if (deployables.isEmpty()) { return; } LogicalCompositeComponent domain = logicalComponentManager.getDomainComposite(); collector.markForCollection(uri, domain); Deployment deployment = generator.generate(domain); collector.collect(domain); deployer.deploy(deployment); contribution.undeploy(); }
private void addCompositeToContribution(Composite wrapper) { QName compositeName = wrapper.getName(); URI uri = ContributionResolver.getContribution(); Contribution contribution = metaDataStore.find(uri); Resource resource = new Resource(contribution, null, Constants.COMPOSITE_CONTENT_TYPE); QNameSymbol symbol = new QNameSymbol(compositeName); ResourceElement<QNameSymbol, Composite> element = new ResourceElement<>(symbol, wrapper); resource.addResourceElement(element); resource.setState(ResourceState.PROCESSED); contribution.addResource(resource); }
private void addCompositeToContribution(Composite wrapper) { QName compositeName = wrapper.getName(); URI uri = ContributionResolver.getContribution(); Contribution contribution = metaDataStore.find(uri); Resource resource = new Resource(contribution, null, Constants.COMPOSITE_CONTENT_TYPE); QNameSymbol symbol = new QNameSymbol(compositeName); ResourceElement<QNameSymbol, Composite> element = new ResourceElement<>(symbol, wrapper); resource.addResourceElement(element); resource.setState(ResourceState.PROCESSED); contribution.addResource(resource); }
@ManagementOperation(description = "Undeploys deployables contained in a contribution") public void undeploy(URI uri, boolean force) throws DeploymentManagementException { Contribution contribution = store.find(uri); if (contribution == null) { throw new ContributionNotFoundException("Contribution not found: " + uri); } try { domain.undeploy(uri, force); } catch (DeploymentException e) { reportError(uri, e); } try { domain.deactivateDefinitions(uri); } catch (DeploymentException e) { throw new ContributionNotInstalledManagementException(e.getMessage()); } }
private void addCompositeToContribution(Composite wrapper) { QName compositeName = wrapper.getName(); URI uri = ContributionResolver.getContribution(); Contribution contribution = metaDataStore.find(uri); Resource resource = new Resource(contribution, null, Constants.COMPOSITE_CONTENT_TYPE); QNameSymbol symbol = new QNameSymbol(compositeName); ResourceElement<QNameSymbol, Composite> element = new ResourceElement<>(symbol, wrapper); resource.addResourceElement(element); resource.setState(ResourceState.PROCESSED); contribution.addResource(resource); }