public String getDescription() { return resource.getDescription(); }
/** * @see ResourceContext#ResourceContext(org.rhq.core.domain.resource.Resource, org.rhq.core.pluginapi.inventory.ResourceComponent, org.rhq.core.pluginapi.inventory.ResourceContext, org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent, org.rhq.core.system.SystemInfo, java.io.File, java.io.File, String, org.rhq.core.pluginapi.event.EventContext, org.rhq.core.pluginapi.operation.OperationContext, org.rhq.core.pluginapi.content.ContentContext, org.rhq.core.pluginapi.availability.AvailabilityContext, org.rhq.core.pluginapi.inventory.InventoryContext, org.rhq.core.pluginapi.inventory.PluginContainerDeployment) * * @since 4.0 */ public ResourceUpgradeContext(Resource resource, ResourceContext<?> parentResourceContext, T parentResourceComponent, ResourceDiscoveryComponent<T> resourceDiscoveryComponent, SystemInfo systemInfo, File temporaryDirectory, File baseDataDirectory, String pluginContainerName, EventContext eventContext, OperationContext operationContext, ContentContext contentContext, AvailabilityContext availabilityContext, InventoryContext inventoryContext, PluginContainerDeployment pluginContainerDeployment) { super(resource, parentResourceComponent, parentResourceContext, resourceDiscoveryComponent, systemInfo, temporaryDirectory, baseDataDirectory, pluginContainerName, eventContext, operationContext, contentContext, availabilityContext, inventoryContext, pluginContainerDeployment); this.resourceConfiguration = resource.getResourceConfiguration(); this.name = resource.getName(); this.description = resource.getDescription(); this.version = resource.getVersion(); }
exportWriter.printf("%s <mtime>%s</mtime>\n", indent, resource.getMtime()); exportWriter.printf("%s <mtime-date>%s</mtime-date>\n", indent, new Date(resource.getMtime())); exportWriter.printf("%s <description>%s</description>\n", indent, resource.getDescription()); exportWriter.printf("%s <inventory-status>%s</inventory-status>\n", indent, resource .getInventoryStatus());
if (existingResource.getDescription() == null && updatedResource.getDescription() != null) { if (LOG.isDebugEnabled()) { LOG.debug("Setting description of existing resource with id " + existingResource.getId() + " to '" + updatedResource.getDescription() + "' (as reported by agent)..."); existingResource.setDescription(updatedResource.getDescription());
public void fillInFromResource(Resource resource) { setNewDescription(resource.getDescription()); setNewName(resource.getName()); setNewResourceKey(resource.getResourceKey()); setNewPluginConfiguration(resource.getPluginConfiguration()); setNewVersion(resource.getVersion()); }
@Override public Resource updateResource(Subject user, Resource resource) { Resource persistedResource = entityManager.find(Resource.class, resource.getId()); if (persistedResource == null) { throw new ResourceNotFoundException(resource.getId()); } if (!authorizationManager.hasResourcePermission(user, Permission.MODIFY_RESOURCE, resource.getId())) { throw new PermissionException("You do not have permission to modify Resource with id " + resource.getId() + "."); } /*if (getResourceByParentAndKey(user, resource.getParentResource(), resource.getResourceKey()) != null) * { throw new ResourceAlreadyExistsException("Resource with key '" + resource.getName() + "' already * exists");}*/ // On name change make sure we update the ancestry as the name is part of the ancestry string if (!persistedResource.getName().equals(resource.getName())) { persistedResource.setName(resource.getName()); updateAncestry(persistedResource); } persistedResource.setLocation(resource.getLocation()); persistedResource.setDescription(resource.getDescription()); persistedResource.setAgentSynchronizationNeeded(); persistedResource.setModifiedBy(user.getName()); return entityManager.merge(persistedResource); }
rwt.setStatus(res.getInventoryStatus().name()); rwt.setLocation(res.getLocation()); rwt.setDescription(res.getDescription()); rwt.setAvailability(res.getCurrentAvailability().getAvailabilityType().toString()); Resource parent = res.getParentResource();
if (isUpgradeAll && needsUpgrade(resource.getDescription(), description)) { resource.setDescription(description); logMessage.append("description, "); ret.setUpgradedResourceDescription(resource.getDescription());
resource.getName(), resource.getVersion(), resource.getDescription(), pluginConfigClone, null); // TODO: I have a feeling we'll need process info, how to get it??
private static Resource convertToPojoResource(Resource resource, boolean includeDescendants) { Resource pojoResource = new Resource(resource.getId()); pojoResource.setUuid(resource.getUuid()); pojoResource.setResourceKey(resource.getResourceKey()); pojoResource.setResourceType(resource.getResourceType()); pojoResource.setMtime(resource.getMtime()); pojoResource.setInventoryStatus(resource.getInventoryStatus()); Configuration pcCopy = resource.getPluginConfiguration(); if (pcCopy != null) { pcCopy = pcCopy.deepCopy(); } pojoResource.setPluginConfiguration(pcCopy); pojoResource.setName(resource.getName()); pojoResource.setDescription(resource.getDescription()); pojoResource.setLocation(resource.getLocation()); pojoResource.setVersion(resource.getVersion()); if (resource.getParentResource() != null) { pojoResource.setParentResource(convertToPojoResource(resource.getParentResource(), false)); } if (includeDescendants) { for (Resource childResource : resource.getChildResources()) { if (isVisibleInInventory(childResource)) { pojoResource.addChildResource(convertToPojoResource(childResource, true)); } } } return pojoResource; }