static File baseDirFor(BundleResourceDeployment rd, Configuration referencedConfiguration) { File root = getMetadataRoot(referencedConfiguration); return baseDirFor(rd.getBundleDeployment().getDestination().getId(), root); }
private void completeDeployment(final BundleResourceDeployment resourceDeployment, BundleDeploymentStatus status, String message) { getBundleServerService().setBundleDeploymentStatus(resourceDeployment.getId(), status); BundleResourceDeploymentHistory.Status auditStatus = null; if(BundleDeploymentStatus.SUCCESS == status) { auditStatus = BundleResourceDeploymentHistory.Status.SUCCESS; Integer discoveryDelay = resourceDeployment.getBundleDeployment().getDiscoveryDelay(); if(discoveryDelay == null) { discoveryDelay = Integer.valueOf(0); // Fallback } if(!(discoveryDelay.intValue() < 0)) { inventoryManager.executeServiceScanDeferred(resourceDeployment.getResource().getId(), discoveryDelay * 1000); } } else { auditStatus = BundleResourceDeploymentHistory.Status.FAILURE; } auditDeployment(resourceDeployment, AUDIT_DEPLOYMENT_ENDED, resourceDeployment.getBundleDeployment().getName(), null, auditStatus, message, null); }
private Result<String[]> getPids(BundleResourceDeployment rd, String operation) { PropertySimple patchType = rd.getBundleDeployment().getConfiguration().getSimple("patchType"); boolean isBundle = patchType != null && "patch-bundle".equals(patchType.getStringValue()); PropertySimple patchIdProp = rd.getBundleDeployment().getConfiguration() .getSimple("patchId"); PropertySimple allPatchIdsProp = rd.getBundleDeployment().getConfiguration() .getSimple("allPatchIds"); String[] pids; if (isBundle) { if (allPatchIdsProp == null || allPatchIdsProp.getStringValue() == null) { return new Result<String[]>(null, "Could not determine the list of patch ids from the bundle configuration while performing " + operation); } pids = allPatchIdsProp.getStringValue().split("#"); //we need to return the pids in the same order as patch history - i.e. in the reversed deployment order Collections.reverse(Arrays.asList(pids)); } else { if (patchIdProp == null || patchIdProp.getStringValue() == null) { return new Result<String[]>(null, "Could not determine the list of patch ids from the bundle configuration while performing " + operation); } pids = new String[1]; pids[0] = patchIdProp.getStringValue(); } return new Result<String[]>(pids, null); }
Configuration deploymentConfiguration = rd.getBundleDeployment().getConfiguration();
BundleDestination dest = bundleResourceDeployment.getBundleDeployment().getDestination(); String destBaseDirName = dest.getDestinationBaseDirectoryName(); String relativeDeployDir = dest.getDeployDir();
throws Exception { BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment(); BundleVersion bundleVersion = bundleDeployment.getBundleVersion();
final BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment();
!isTakeOver(request.getResourceDeployment().getBundleDeployment().getConfiguration())); request.getResourceDeployment().getBundleDeployment().getConfiguration(), bmp, rd); if (stop.failed()) { result.setErrorMessage(stop.errorMessage); request.getPackageVersionFiles().values().iterator().next().getAbsolutePath()); Configuration bundleConfig = request.getResourceDeployment().getBundleDeployment().getConfiguration(); String override = bundleConfig.getSimpleValue("override"); String overrideAll = bundleConfig.getSimpleValue("override-all");
private String getConnectionString(BundleResourceDeployment resourceDeployment) { ResourceContainer rc = inventoryManager.getResourceContainer(resourceDeployment.getResource()); BundleDestination dest = resourceDeployment.getBundleDeployment().getDestination(); ResourceType type = rc.getResource().getResourceType(); String specName = dest.getDestinationSpecificationName(); String relativeDeployDir = dest.getDeployDir(); Configuration config = new Configuration(); config.put(new PropertySimple("deployDir", relativeDeployDir)); ConnectionStringAvailableProperties props = new ConnectionStringAvailableProperties(rc, measurementManager, config); for (ResourceTypeBundleConfiguration.BundleDestinationSpecification spec : type .getResourceTypeBundleConfiguration().getBundleDestinationSpecifications()) { if (specName.equals(spec.getName())) { ResourceTypeBundleConfiguration.BundleDestinationDefinition def = (ResourceTypeBundleConfiguration.BundleDestinationDefinition) spec; String rawConnectionString = def.getConnectionString(); if (rawConnectionString == null) { return null; } TokenReplacingReader trr = new TokenReplacingReader(new StringReader(rawConnectionString), props); try { return StreamUtil.slurp(trr); } finally { StreamUtil.safeClose(trr); } } } return null; }
final BundleDeployment bundleDeployment = resourceDeployment.getBundleDeployment();
result.setErrorMessage("The patch to revert to (" + stopPid + ") was not previously deployed by RHQ. This means that this server joined the resource group '" + request.getResourceDeployment().getBundleDeployment().getDestination().getGroup().getName() + "' after this patch was already deployed. To prevent accidental damage no changes will be made to the server.");
rd.getBundleDeployment().getDestination().getName()); if (saveDestinationName.failed()) { return saveDestinationName.errorMessage;
int destinationId = resourceDeployment.getBundleDeployment().getDestination().getId(); int activeDestinationId = metadata.result.getDestinationId();
bdc.addFilterId(resourceDeployment.getBundleDeployment().getId()); bdc.fetchBundleVersion(true); bdc.fetchConfiguration(true);
.getResourceTypeBundleConfiguration().getBundleDestinationSpecifications(); String specName = resourceDeployment.getBundleDeployment().getDestination() .getDestinationSpecificationName();