result = new ResourceUpgradeReport(); result.setForceGenericPropertyUpgrade(true); // It is critical the name and version get upgraded result.setNewName(MATCHER.group(1) + MATCHER.group(3)); result.setNewVersion(MATCHER.group(2)); result = new ResourceUpgradeReport(); result.setNewResourceKey(sb.toString());
public void fillInFromReport(ResourceUpgradeReport report) { setNewDescription(report.getNewDescription()); setNewName(report.getNewName()); setNewResourceKey(report.getNewResourceKey()); setNewPluginConfiguration(report.getNewPluginConfiguration()); setNewVersion(report.getNewVersion()); setForceGenericPropertyUpgrade(report.isForceGenericPropertyUpgrade()); }
@Override public boolean hasSomethingToUpgrade() { return super.hasSomethingToUpgrade() || upgradeErrorMessage != null || upgradeErrorStackTrace != null; }
@Override public ResourceUpgradeReport upgrade(ResourceUpgradeContext inventoriedResource) { ResourceUpgradeReport report = new ResourceUpgradeReport(); boolean upgraded = false; if (new File(currentResourceKey).isDirectory()) { report.setNewResourceKey(createKeyForLocalResource(serverPluginConfiguration)); } else if (currentResourceKey.contains(":")) { report.setNewResourceKey(createKeyForRemoteResource(currentResourceKey)); } else { upgraded = false; if (!configFileCanonicalPath.equals(configFilePath)) { upgraded = true; report.setNewResourceKey(LOCAL_RESOURCE_KEY_PREFIX + configFileCanonicalPath); pluginConfiguration.setSimpleValue("expectedRuntimeProductName", serverPluginConfiguration.getProductType().PRODUCT_NAME); report.setNewPluginConfiguration(pluginConfiguration); .setSimpleValue("supportsPatching", Boolean.toString(supportsPatching(productType, inventoriedResource.getVersion()))); report.setNewPluginConfiguration(pluginConfiguration);
ResourceUpgradeReport resourceUpgradeReport = new ResourceUpgradeReport(); resourceUpgradeReport.setNewResourceKey(newKey.toString()); return resourceUpgradeReport;
report = new ResourceUpgradeReport();
private Set<Resource> findDuplicitSiblingResources(Resource resource, ResourceUpgradeReport upgradeReport) { Resource parent = resource.getParentResource(); if (parent == null) { //there is only a single platform resource on an agent return Collections.emptySet(); } Set<Resource> ret = new HashSet<Resource>(); for (Resource sibling : parent.getChildResources()) { //we'd have a resource key conflict if there was a resource //of the same type under the same parent that would have the same //resource key. if (upgradeReport.getNewResourceKey() != null && sibling.getResourceType().equals(resource.getResourceType()) && !sibling.getUuid().equals(resource.getUuid())) { if (sibling.getResourceKey().equals(upgradeReport.getNewResourceKey())) { ret.add(sibling); } } } return ret; }
result = new ResourceUpgradeReport(); result.setForceGenericPropertyUpgrade(true); // It is critical the name and version get upgraded result.setNewName(MATCHER.group(1) + MATCHER.group(3)); String parentResourceVersion = inventoriedResource.getParentResourceContext().getVersion(); parentResourceVersion = (null == parentResourceVersion) ? "" : (parentResourceVersion + "/"); result.setNewVersion(parentResourceVersion + MATCHER.group(2)); } else { result.setNewVersion(MATCHER.group(2)); result = new ResourceUpgradeReport(); result.setNewResourceKey(sb.toString());
if (upgradeReport != null && upgradeReport.hasSomethingToUpgrade()) { request.fillInFromReport(upgradeReport);
result = new ResourceUpgradeReport(); result.setForceGenericPropertyUpgrade(true); // It is critical the name get upgraded result.setNewName(sb.toString()); && ((null == currentVersion && null != parentVersion) || !currentVersion.equals(parentVersion))) { if (null == result) { result = new ResourceUpgradeReport(); result.setForceGenericPropertyUpgrade(true); // It is critical the version get upgraded result.setNewVersion(parentVersion); result = new ResourceUpgradeReport(); result.setNewResourceKey(sb.toString());