org.rhq.core.domain.resource
Class Resource

java.lang.Object
  extended by org.rhq.core.domain.resource.Resource
All Implemented Interfaces:
Serializable, Comparable<Resource>
Direct Known Subclasses:
ResourceIdFlyWeight

public class Resource
extends Object
implements Comparable<Resource>, Serializable

Represents an RHQ managed resource (i.e. a platform, server, or service).

See Also:
Serialized Form

Field Summary
static String ANCESTRY_DELIM
           
static String ANCESTRY_ENTRY_DELIM
           
static String QUERY_FIND_AVAILABILITY_BY_RESOURCE_ID
           
static String QUERY_FIND_AVAILABILITY_BY_RESOURCE_ID_ADMIN
           
static String QUERY_FIND_AVAILABILITY_BY_RESOURCE_IDS
           
static String QUERY_FIND_AVAILABILITY_BY_RESOURCE_IDS_ADMIN
           
static String QUERY_FIND_BY_CATEGORY_AND_INVENTORY_STATUS
           
static String QUERY_FIND_BY_CATEGORY_AND_INVENTORY_STATUS_ADMIN
           
static String QUERY_FIND_BY_EXPLICIT_RESOURCE_GROUP
           
static String QUERY_FIND_BY_EXPLICIT_RESOURCE_GROUP_ADMIN
           
static String QUERY_FIND_BY_ID
           
static String QUERY_FIND_BY_ID_WITH_INSTALLED_PACKAGE_HIST
           
static String QUERY_FIND_BY_ID_WITH_INSTALLED_PACKAGES
           
static String QUERY_FIND_BY_IDS
           
static String QUERY_FIND_BY_IDS_ADMIN
           
static String QUERY_FIND_BY_IMPLICIT_RESOURCE_GROUP
           
static String QUERY_FIND_BY_IMPLICIT_RESOURCE_GROUP_ADMIN
           
static String QUERY_FIND_BY_PARENT_AND_INVENTORY_STATUS
           
static String QUERY_FIND_BY_PARENT_AND_INVENTORY_STATUS_ADMIN
           
static String QUERY_FIND_BY_PARENT_AND_KEY
           
static String QUERY_FIND_BY_PARENT_AND_TYPE
           
static String QUERY_FIND_BY_PARENT_AND_TYPE_ADMIN
           
static String QUERY_FIND_BY_TYPE
           
static String QUERY_FIND_BY_TYPE_ADMIN
           
static String QUERY_FIND_BY_TYPE_AND_IDS
           
static String QUERY_FIND_BY_TYPE_AND_IDS_ADMIN
           
static String QUERY_FIND_CHILDREN
           
static String QUERY_FIND_CHILDREN_ADMIN
           
static String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES
           
static String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_ADMIN
           
static String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_BY_TYPE
           
static String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_BY_TYPE_ADMIN
           
static String QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS
           
static String QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS_ADMIN
           
static String QUERY_FIND_CHILDREN_IDS_ADMIN
           
static String QUERY_FIND_CHILDREN_IDS_BY_PARENT_IDS
           
static String QUERY_FIND_COMPOSITE
           
static String QUERY_FIND_COMPOSITE_ADMIN
           
static String QUERY_FIND_COMPOSITE_COUNT
           
static String QUERY_FIND_COMPOSITE_COUNT_ADMIN
           
static String QUERY_FIND_COMPOSITE_WITH_PARENT
           
static String QUERY_FIND_COMPOSITE_WITH_PARENT_ADMIN
           
static String QUERY_FIND_COUNT_BY_TYPES
           
static String QUERY_FIND_DESCENDANTS
           
static String QUERY_FIND_DESCENDANTS_BY_TYPE_AND_NAME
           
static String QUERY_FIND_EXPLICIT_IDS_BY_RESOURCE_GROUP_ADMIN
           
static String QUERY_FIND_EXPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT
           
static String QUERY_FIND_EXPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT_ADMIN
           
static String QUERY_FIND_EXPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP
           
static String QUERY_FIND_EXPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP_ADMIN
           
static String QUERY_FIND_FLY_WEIGHTS_BY_RESOURCE_IDS
           
static String QUERY_FIND_FOR_AUTOGROUP
           
static String QUERY_FIND_IDS_BY_TYPE_IDS
           
static String QUERY_FIND_IMPLICIT_IDS_BY_RESOURCE_GROUP_ADMIN
           
static String QUERY_FIND_IMPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT
           
static String QUERY_FIND_IMPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT_ADMIN
           
static String QUERY_FIND_IMPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP
           
static String QUERY_FIND_IMPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP_ADMIN
           
static String QUERY_FIND_PARENT_ID
           
static String QUERY_FIND_PLATFORM_BY_AGENT
           
static String QUERY_FIND_PROBLEM_RESOURCES_ALERT
           
static String QUERY_FIND_PROBLEM_RESOURCES_ALERT_ADMIN
           
static String QUERY_FIND_PROBLEM_RESOURCES_ALERT_COUNT
           
static String QUERY_FIND_PROBLEM_RESOURCES_ALERT_COUNT_ADMIN
           
static String QUERY_FIND_QUEUED_PLATFORMS_BY_INVENTORY_STATUS
           
static String QUERY_FIND_RESOURCE_AUTOGROUP_COMPOSITE
           
static String QUERY_FIND_RESOURCE_AUTOGROUP_COMPOSITE_ADMIN
           
static String QUERY_FIND_RESOURCE_AUTOGROUPS_COMPOSITE
           
static String QUERY_FIND_RESOURCE_AUTOGROUPS_COMPOSITE_ADMIN
           
static String QUERY_FIND_RESOURCE_SUMMARY_BY_INVENTORY_STATUS
           
static String QUERY_FIND_RESOURCE_SUMMARY_BY_INVENTORY_STATUS_ADMIN
           
static String QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION
           
static String QUERY_FIND_ROOT_PLATFORM_OF_RESOURCE
           
static String QUERY_FIND_VALID_COMMITTED_RESOURCE_IDS_ADMIN
           
static String QUERY_FIND_WITH_PARENT_BY_IDS
           
static String QUERY_FIND_WITH_PARENT_BY_IDS_ADMIN
           
static String QUERY_GET_AVAILABLE_RESOURCES_FOR_DASHBOARD_PORTLET
           
static String QUERY_GET_AVAILABLE_RESOURCES_FOR_DASHBOARD_PORTLET_WITH_EXCLUDES
           
static String QUERY_GET_AVAILABLE_RESOURCES_FOR_REPO
           
static String QUERY_GET_AVAILABLE_RESOURCES_FOR_RESOURCE_GROUP
           
static String QUERY_GET_AVAILABLE_RESOURCES_FOR_RESOURCE_GROUP_WITH_EXCLUDES
           
static String QUERY_GET_AVAILABLE_RESOURCES_WITH_PARENT_FOR_RESOURCE_GROUP
           
static String QUERY_GET_AVAILABLE_RESOURCES_WITH_PARENT_FOR_RESOURCE_GROUP_WITH_EXCLUDES
           
static String QUERY_GET_RESOURCE_HEALTH_BY_IDS
           
static String QUERY_GET_STATUSES_BY_PARENT
           
static String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK
           
static String QUERY_RECENTLY_ADDED_PLATFORMS
           
static String QUERY_RECENTLY_ADDED_PLATFORMS_ADMIN
           
static String QUERY_RECENTLY_ADDED_SERVERS
           
static String QUERY_RECENTLY_ADDED_SERVERS_ADMIN
           
static String QUERY_RESOURCE_REPORT
           
static String QUERY_RESOURCE_VERSION_AND_DRIFT_IN_COMPLIANCE
           
static String QUERY_RESOURCE_VERSION_AND_DRIFT_OUT_OF_COMPLIANCE
           
static String QUERY_RESOURCE_VERSION_REPORT
           
static Resource ROOT
           
static int ROOT_ID
           
static String TABLE_NAME
           
 
Constructor Summary
Resource()
           
Resource(int id)
          Primarily for deserialization and cases where the resource object is just a reference to the real one in the db.
Resource(String resourceKey, String name, ResourceType type)
           
 
Method Summary
 void addAlertDefinition(AlertDefinition alertDefinition)
           
 void addChildResource(Resource childResource)
           
 void addContentServiceRequest(ContentServiceRequest request)
           
 void addCreateChildResourceHistory(CreateResourceHistory request)
           
 void addDeleteResourceHistory(DeleteResourceHistory history)
           
 void addDriftDefinition(DriftDefinition driftDefinition)
           
 void addExplicitGroup(ResourceGroup explicitGroup)
           
 void addImplicitGroup(ResourceGroup implicitGroup)
           
 void addInstalledPackage(InstalledPackage installedPackage)
           
 void addInstalledPackageHistory(InstalledPackageHistory history)
           
 void addPluginConfigurationUpdates(PluginConfigurationUpdate update)
           
 ResourceRepo addRepo(Repo repo)
          Directly subscribe the resource to a repo.
 void addResourceConfigurationUpdates(ResourceConfigurationUpdate update)
           
 void addResourceError(ResourceError resourceError)
           
 void addSchedule(MeasurementSchedule schedule)
           
 void addTag(Tag tag)
           
 int compareTo(Resource that)
           
 boolean equals(Object o)
           
 Agent getAgent()
           
 Set<AlertDefinition> getAlertDefinitions()
           
 String getAncestry()
           
 List<ResourceGroup> getAutoGroupBackingGroups()
           
 List<Availability> getAvailability()
           
 Set<Resource> getChildResources()
           
 List<ContentServiceRequest> getContentServiceRequests()
           
 List<CreateResourceHistory> getCreateChildResourceRequests()
           
 long getCtime()
          The time that this resource's entity was inserted into the database.
 ResourceAvailability getCurrentAvailability()
           
protected  Set<Dashboard> getDashboards()
           
 List<DeleteResourceHistory> getDeleteResourceRequests()
           
 String getDescription()
           
 Set<DriftDefinition> getDriftDefinitions()
           
 Set<EventSource> getEventSources()
           
 Set<ResourceGroup> getExplicitGroups()
           
 int getId()
           
 Set<ResourceGroup> getImplicitGroups()
           
 List<InstalledPackageHistory> getInstalledPackageHistory()
           
 Set<InstalledPackage> getInstalledPackages()
           
 InventoryStatus getInventoryStatus()
           
 long getItime()
          Returns the time when this resource's getInventoryStatus() changed.
 String getLocation()
           
 String getModifiedBy()
           
 long getMtime()
          The time that any part of this resource entity was updated in the database.
 String getName()
           
 List<ResourceOperationHistory> getOperationHistories()
           
 Resource getParentResource()
           
 Configuration getPluginConfiguration()
           
 List<PluginConfigurationUpdate> getPluginConfigurationUpdates()
           
 ProductVersion getProductVersion()
           
 Set<Repo> getRepos()
          The repos this resource is subscribed to.
 Configuration getResourceConfiguration()
           
 List<ResourceConfigurationUpdate> getResourceConfigurationUpdates()
           
 List<ResourceError> getResourceErrors()
          Returns the list of all errors of all types encountered by this resource.
 List<ResourceError> getResourceErrors(ResourceErrorType type)
          Returns only those errors of the given type.
 String getResourceKey()
           
 Set<ResourceRepo> getResourceRepos()
          Returns the explicit mapping entities.
 ResourceType getResourceType()
           
 Set<MeasurementSchedule> getSchedules()
           
 Set<Tag> getTags()
           
 String getUuid()
          The UUID is used to synchronized newly discovered resources between server and agent.
 String getVersion()
           
 int hashCode()
           
 void initCurrentAvailability()
           
 boolean isConnected()
          When true, it can be assumed the plugin can successfully connect to and manage the actual resource.
 boolean removeChildResource(Resource childResource)
           
 void removeExplicitGroup(ResourceGroup explicitGroup)
           
 void removeImplicitGroup(ResourceGroup implicitGroup)
           
 ResourceRepo removeRepo(Repo repo)
          Unsubscribes the resource from a repo, if it exists.
 boolean removeTag(Tag tag)
           
 void setAgent(Agent agent)
           
 void setAgentSynchronizationNeeded()
          This method should be called whenever we want the agent to recognize that something about this resource has changed on the server-side that requires synchronization to take place.
 void setAlertDefinitions(Set<AlertDefinition> alertDefinitions)
           
 void setAncestry(String ancestry)
          In general this method should not be called by application code, at least not for any Resource that will be persisted or merged.
 void setAutoGroupBackingGroups(List<ResourceGroup> autoGroupBackingGroups)
           
 void setChildResources(Set<Resource> children)
           
 void setConnected(boolean connected)
           
 void setContentServiceRequests(List<ContentServiceRequest> contentServiceRequests)
           
 void setCreateChildResourceRequests(List<CreateResourceHistory> createChildResourceRequests)
           
 void setCurrentAvailability(ResourceAvailability currentAvailability)
           
protected  void setDashboards(Set<Dashboard> dashboards)
           
 void setDeleteResourceRequests(List<DeleteResourceHistory> deleteResourceRequests)
           
 void setDescription(String description)
           
 void setDriftDefinitions(Set<DriftDefinition> driftDefinitions)
           
 void setExplicitGroups(Set<ResourceGroup> explicitGroups)
           
 void setId(int id)
           
 void setImplicitGroups(Set<ResourceGroup> implicitGroups)
           
 void setInstalledPackageHistory(List<InstalledPackageHistory> installedPackageHistory)
           
 void setInstalledPackages(Set<InstalledPackage> installedPackages)
           
 void setInventoryStatus(InventoryStatus inventoryStatus)
           
 void setItime(long inventoryTime)
           
 void setLocation(String location)
           
 void setModifiedBy(String modifiedBy)
           
 void setMtime(long mtime)
           
 void setName(String name)
           
 void setOperationHistories(List<ResourceOperationHistory> operationHistories)
           
 void setParentResource(Resource parentResource)
           
 void setPluginConfiguration(Configuration pluginConfiguration)
           
 void setPluginConfigurationUpdates(List<PluginConfigurationUpdate> updates)
           
 void setProductVersion(ProductVersion productVersion)
           
 void setResourceConfiguration(Configuration resourceConfiguration)
           
 void setResourceConfigurationUpdates(List<ResourceConfigurationUpdate> updates)
           
 void setResourceErrors(List<ResourceError> resourceErrors)
           
 void setResourceKey(String resourceKey)
           
 void setResourceType(ResourceType resourceType)
           
 void setSchendules(Set<MeasurementSchedule> schedules)
           
 void setTags(Set<Tag> tags)
           
 void setUuid(String uuid)
           
 void setVersion(String version)
           
 String toString()
           
 String updateAncestryForResource()
          Using the current settings for resource field set the encoded ancestry string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_NAME

public static final String TABLE_NAME
See Also:
Constant Field Values

QUERY_FIND_PROBLEM_RESOURCES_ALERT

public static final String QUERY_FIND_PROBLEM_RESOURCES_ALERT
See Also:
Constant Field Values

QUERY_FIND_PROBLEM_RESOURCES_ALERT_ADMIN

public static final String QUERY_FIND_PROBLEM_RESOURCES_ALERT_ADMIN
See Also:
Constant Field Values

QUERY_FIND_PROBLEM_RESOURCES_ALERT_COUNT

public static final String QUERY_FIND_PROBLEM_RESOURCES_ALERT_COUNT
See Also:
Constant Field Values

QUERY_FIND_PROBLEM_RESOURCES_ALERT_COUNT_ADMIN

public static final String QUERY_FIND_PROBLEM_RESOURCES_ALERT_COUNT_ADMIN
See Also:
Constant Field Values

QUERY_FIND_BY_PARENT_AND_TYPE

public static final String QUERY_FIND_BY_PARENT_AND_TYPE
See Also:
Constant Field Values

QUERY_FIND_BY_PARENT_AND_TYPE_ADMIN

public static final String QUERY_FIND_BY_PARENT_AND_TYPE_ADMIN
See Also:
Constant Field Values

QUERY_FIND_FOR_AUTOGROUP

public static final String QUERY_FIND_FOR_AUTOGROUP
See Also:
Constant Field Values

QUERY_FIND_BY_PARENT_AND_INVENTORY_STATUS

public static final String QUERY_FIND_BY_PARENT_AND_INVENTORY_STATUS
See Also:
Constant Field Values

QUERY_FIND_BY_PARENT_AND_INVENTORY_STATUS_ADMIN

public static final String QUERY_FIND_BY_PARENT_AND_INVENTORY_STATUS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_VALID_COMMITTED_RESOURCE_IDS_ADMIN

public static final String QUERY_FIND_VALID_COMMITTED_RESOURCE_IDS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_IDS_ADMIN

public static final String QUERY_FIND_CHILDREN_IDS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_IDS_BY_PARENT_IDS

public static final String QUERY_FIND_CHILDREN_IDS_BY_PARENT_IDS
See Also:
Constant Field Values

QUERY_FIND_CHILDREN

public static final String QUERY_FIND_CHILDREN
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_ADMIN

public static final String QUERY_FIND_CHILDREN_ADMIN
See Also:
Constant Field Values

QUERY_RECENTLY_ADDED_PLATFORMS

public static final String QUERY_RECENTLY_ADDED_PLATFORMS
See Also:
Constant Field Values

QUERY_RECENTLY_ADDED_PLATFORMS_ADMIN

public static final String QUERY_RECENTLY_ADDED_PLATFORMS_ADMIN
See Also:
Constant Field Values

QUERY_RECENTLY_ADDED_SERVERS

public static final String QUERY_RECENTLY_ADDED_SERVERS
See Also:
Constant Field Values

QUERY_RECENTLY_ADDED_SERVERS_ADMIN

public static final String QUERY_RECENTLY_ADDED_SERVERS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_AVAILABILITY_BY_RESOURCE_ID

public static final String QUERY_FIND_AVAILABILITY_BY_RESOURCE_ID
See Also:
Constant Field Values

QUERY_FIND_AVAILABILITY_BY_RESOURCE_ID_ADMIN

public static final String QUERY_FIND_AVAILABILITY_BY_RESOURCE_ID_ADMIN
See Also:
Constant Field Values

QUERY_FIND_AVAILABILITY_BY_RESOURCE_IDS

public static final String QUERY_FIND_AVAILABILITY_BY_RESOURCE_IDS
See Also:
Constant Field Values

QUERY_FIND_AVAILABILITY_BY_RESOURCE_IDS_ADMIN

public static final String QUERY_FIND_AVAILABILITY_BY_RESOURCE_IDS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_AUTOGROUP_COMPOSITE

public static final String QUERY_FIND_RESOURCE_AUTOGROUP_COMPOSITE
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_AUTOGROUP_COMPOSITE_ADMIN

public static final String QUERY_FIND_RESOURCE_AUTOGROUP_COMPOSITE_ADMIN
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_AUTOGROUPS_COMPOSITE

public static final String QUERY_FIND_RESOURCE_AUTOGROUPS_COMPOSITE
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_AUTOGROUPS_COMPOSITE_ADMIN

public static final String QUERY_FIND_RESOURCE_AUTOGROUPS_COMPOSITE_ADMIN
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES

public static final String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_ADMIN

public static final String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_ADMIN
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_BY_TYPE

public static final String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_BY_TYPE
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_BY_TYPE_ADMIN

public static final String QUERY_FIND_CHILDREN_AUTOGROUP_COMPOSITES_BY_TYPE_ADMIN
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS

public static final String QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS
See Also:
Constant Field Values

QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS_ADMIN

public static final String QUERY_FIND_CHILDREN_BY_CATEGORY_AND_INVENTORY_STATUS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_BY_CATEGORY_AND_INVENTORY_STATUS

public static final String QUERY_FIND_BY_CATEGORY_AND_INVENTORY_STATUS
See Also:
Constant Field Values

QUERY_FIND_BY_CATEGORY_AND_INVENTORY_STATUS_ADMIN

public static final String QUERY_FIND_BY_CATEGORY_AND_INVENTORY_STATUS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_SUMMARY_BY_INVENTORY_STATUS

public static final String QUERY_FIND_RESOURCE_SUMMARY_BY_INVENTORY_STATUS
See Also:
Constant Field Values

QUERY_FIND_RESOURCE_SUMMARY_BY_INVENTORY_STATUS_ADMIN

public static final String QUERY_FIND_RESOURCE_SUMMARY_BY_INVENTORY_STATUS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_QUEUED_PLATFORMS_BY_INVENTORY_STATUS

public static final String QUERY_FIND_QUEUED_PLATFORMS_BY_INVENTORY_STATUS
See Also:
Constant Field Values

QUERY_FIND_BY_TYPE

public static final String QUERY_FIND_BY_TYPE
See Also:
Constant Field Values

QUERY_FIND_BY_TYPE_ADMIN

public static final String QUERY_FIND_BY_TYPE_ADMIN
See Also:
Constant Field Values

QUERY_FIND_IDS_BY_TYPE_IDS

public static final String QUERY_FIND_IDS_BY_TYPE_IDS
See Also:
Constant Field Values

QUERY_FIND_COUNT_BY_TYPES

public static final String QUERY_FIND_COUNT_BY_TYPES
See Also:
Constant Field Values

QUERY_FIND_BY_TYPE_AND_IDS

public static final String QUERY_FIND_BY_TYPE_AND_IDS
See Also:
Constant Field Values

QUERY_FIND_BY_TYPE_AND_IDS_ADMIN

public static final String QUERY_FIND_BY_TYPE_AND_IDS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_BY_PARENT_AND_KEY

public static final String QUERY_FIND_BY_PARENT_AND_KEY
See Also:
Constant Field Values

QUERY_FIND_EXPLICIT_IDS_BY_RESOURCE_GROUP_ADMIN

public static final String QUERY_FIND_EXPLICIT_IDS_BY_RESOURCE_GROUP_ADMIN
See Also:
Constant Field Values

QUERY_FIND_IMPLICIT_IDS_BY_RESOURCE_GROUP_ADMIN

public static final String QUERY_FIND_IMPLICIT_IDS_BY_RESOURCE_GROUP_ADMIN
See Also:
Constant Field Values

QUERY_FIND_FLY_WEIGHTS_BY_RESOURCE_IDS

public static final String QUERY_FIND_FLY_WEIGHTS_BY_RESOURCE_IDS
See Also:
Constant Field Values

QUERY_FIND_BY_EXPLICIT_RESOURCE_GROUP

public static final String QUERY_FIND_BY_EXPLICIT_RESOURCE_GROUP
See Also:
Constant Field Values

QUERY_FIND_BY_EXPLICIT_RESOURCE_GROUP_ADMIN

public static final String QUERY_FIND_BY_EXPLICIT_RESOURCE_GROUP_ADMIN
See Also:
Constant Field Values

QUERY_FIND_BY_IMPLICIT_RESOURCE_GROUP

public static final String QUERY_FIND_BY_IMPLICIT_RESOURCE_GROUP
See Also:
Constant Field Values

QUERY_FIND_BY_IMPLICIT_RESOURCE_GROUP_ADMIN

public static final String QUERY_FIND_BY_IMPLICIT_RESOURCE_GROUP_ADMIN
See Also:
Constant Field Values

QUERY_FIND_EXPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP

public static final String QUERY_FIND_EXPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP
See Also:
Constant Field Values

QUERY_FIND_EXPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP_ADMIN

public static final String QUERY_FIND_EXPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP_ADMIN
See Also:
Constant Field Values

QUERY_FIND_IMPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP

public static final String QUERY_FIND_IMPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP
See Also:
Constant Field Values

QUERY_FIND_IMPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP_ADMIN

public static final String QUERY_FIND_IMPLICIT_RESOURCES_WITH_AVAILABILITY_FOR_RESOURCE_GROUP_ADMIN
See Also:
Constant Field Values

QUERY_FIND_IMPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT

public static final String QUERY_FIND_IMPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT
See Also:
Constant Field Values

QUERY_FIND_IMPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT_ADMIN

public static final String QUERY_FIND_IMPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT_ADMIN
See Also:
Constant Field Values

QUERY_FIND_EXPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT

public static final String QUERY_FIND_EXPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT
See Also:
Constant Field Values

QUERY_FIND_EXPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT_ADMIN

public static final String QUERY_FIND_EXPLICIT_RESOURCES_FOR_RESOURCE_GROUP_COUNT_ADMIN
See Also:
Constant Field Values

QUERY_GET_AVAILABLE_RESOURCES_FOR_REPO

public static final String QUERY_GET_AVAILABLE_RESOURCES_FOR_REPO
See Also:
Constant Field Values

QUERY_GET_AVAILABLE_RESOURCES_FOR_RESOURCE_GROUP

public static final String QUERY_GET_AVAILABLE_RESOURCES_FOR_RESOURCE_GROUP
See Also:
Constant Field Values

QUERY_GET_AVAILABLE_RESOURCES_FOR_RESOURCE_GROUP_WITH_EXCLUDES

public static final String QUERY_GET_AVAILABLE_RESOURCES_FOR_RESOURCE_GROUP_WITH_EXCLUDES
See Also:
Constant Field Values

QUERY_GET_AVAILABLE_RESOURCES_WITH_PARENT_FOR_RESOURCE_GROUP

public static final String QUERY_GET_AVAILABLE_RESOURCES_WITH_PARENT_FOR_RESOURCE_GROUP
See Also:
Constant Field Values

QUERY_GET_AVAILABLE_RESOURCES_WITH_PARENT_FOR_RESOURCE_GROUP_WITH_EXCLUDES

public static final String QUERY_GET_AVAILABLE_RESOURCES_WITH_PARENT_FOR_RESOURCE_GROUP_WITH_EXCLUDES
See Also:
Constant Field Values

QUERY_GET_AVAILABLE_RESOURCES_FOR_DASHBOARD_PORTLET

public static final String QUERY_GET_AVAILABLE_RESOURCES_FOR_DASHBOARD_PORTLET
See Also:
Constant Field Values

QUERY_GET_AVAILABLE_RESOURCES_FOR_DASHBOARD_PORTLET_WITH_EXCLUDES

public static final String QUERY_GET_AVAILABLE_RESOURCES_FOR_DASHBOARD_PORTLET_WITH_EXCLUDES
See Also:
Constant Field Values

QUERY_FIND_BY_ID

public static final String QUERY_FIND_BY_ID
See Also:
Constant Field Values

QUERY_FIND_BY_IDS

public static final String QUERY_FIND_BY_IDS
See Also:
Constant Field Values

QUERY_FIND_BY_IDS_ADMIN

public static final String QUERY_FIND_BY_IDS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_WITH_PARENT_BY_IDS

public static final String QUERY_FIND_WITH_PARENT_BY_IDS
See Also:
Constant Field Values

QUERY_FIND_WITH_PARENT_BY_IDS_ADMIN

public static final String QUERY_FIND_WITH_PARENT_BY_IDS_ADMIN
See Also:
Constant Field Values

QUERY_FIND_COMPOSITE

public static final String QUERY_FIND_COMPOSITE
See Also:
Constant Field Values

QUERY_FIND_COMPOSITE_WITH_PARENT

public static final String QUERY_FIND_COMPOSITE_WITH_PARENT
See Also:
Constant Field Values

QUERY_FIND_COMPOSITE_COUNT

public static final String QUERY_FIND_COMPOSITE_COUNT
See Also:
Constant Field Values

QUERY_FIND_COMPOSITE_ADMIN

public static final String QUERY_FIND_COMPOSITE_ADMIN
See Also:
Constant Field Values

QUERY_FIND_COMPOSITE_WITH_PARENT_ADMIN

public static final String QUERY_FIND_COMPOSITE_WITH_PARENT_ADMIN
See Also:
Constant Field Values

QUERY_FIND_COMPOSITE_COUNT_ADMIN

public static final String QUERY_FIND_COMPOSITE_COUNT_ADMIN
See Also:
Constant Field Values

QUERY_GET_STATUSES_BY_PARENT

public static final String QUERY_GET_STATUSES_BY_PARENT
See Also:
Constant Field Values

QUERY_GET_RESOURCE_HEALTH_BY_IDS

public static final String QUERY_GET_RESOURCE_HEALTH_BY_IDS
See Also:
Constant Field Values

QUERY_FIND_BY_ID_WITH_INSTALLED_PACKAGES

public static final String QUERY_FIND_BY_ID_WITH_INSTALLED_PACKAGES
See Also:
Constant Field Values

QUERY_FIND_BY_ID_WITH_INSTALLED_PACKAGE_HIST

public static final String QUERY_FIND_BY_ID_WITH_INSTALLED_PACKAGE_HIST
See Also:
Constant Field Values

QUERY_FIND_PLATFORM_BY_AGENT

public static final String QUERY_FIND_PLATFORM_BY_AGENT
See Also:
Constant Field Values

QUERY_FIND_PARENT_ID

public static final String QUERY_FIND_PARENT_ID
See Also:
Constant Field Values

QUERY_FIND_ROOT_PLATFORM_OF_RESOURCE

public static final String QUERY_FIND_ROOT_PLATFORM_OF_RESOURCE
See Also:
Constant Field Values

QUERY_FIND_DESCENDANTS_BY_TYPE_AND_NAME

public static final String QUERY_FIND_DESCENDANTS_BY_TYPE_AND_NAME
See Also:
Constant Field Values

QUERY_FIND_DESCENDANTS

public static final String QUERY_FIND_DESCENDANTS
See Also:
Constant Field Values

QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK

public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK
See Also:
Constant Field Values

QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION

public static final String QUERY_FIND_RESOURCES_MARKED_FOR_ASYNC_DELETION
See Also:
Constant Field Values

QUERY_RESOURCE_REPORT

public static final String QUERY_RESOURCE_REPORT
See Also:
Constant Field Values

QUERY_RESOURCE_VERSION_REPORT

public static final String QUERY_RESOURCE_VERSION_REPORT
See Also:
Constant Field Values

QUERY_RESOURCE_VERSION_AND_DRIFT_IN_COMPLIANCE

public static final String QUERY_RESOURCE_VERSION_AND_DRIFT_IN_COMPLIANCE
See Also:
Constant Field Values

QUERY_RESOURCE_VERSION_AND_DRIFT_OUT_OF_COMPLIANCE

public static final String QUERY_RESOURCE_VERSION_AND_DRIFT_OUT_OF_COMPLIANCE
See Also:
Constant Field Values

ANCESTRY_ENTRY_DELIM

public static final String ANCESTRY_ENTRY_DELIM
See Also:
Constant Field Values

ANCESTRY_DELIM

public static final String ANCESTRY_DELIM
See Also:
Constant Field Values

ROOT

public static final Resource ROOT

ROOT_ID

public static final int ROOT_ID
See Also:
Constant Field Values
Constructor Detail

Resource

public Resource()

Resource

public Resource(int id)
Primarily for deserialization and cases where the resource object is just a reference to the real one in the db. (Key is this avoids the irrelevant UUID generation that has contention problems.

Parameters:
id - the Resource's id

Resource

public Resource(@NotNull
                String resourceKey,
                String name,
                @NotNull
                ResourceType type)
Method Detail

getId

public int getId()

setId

public void setId(int id)

getUuid

public String getUuid()
The UUID is used to synchronized newly discovered resources between server and agent. The UUID is used to unique identify a new resource that an agent has found before the resource ID has been assigned.

Returns:
new resource's unique identifier

setUuid

public void setUuid(String uuid)

getName

public String getName()

setName

public void setName(String name)

getAncestry

public String getAncestry()

setAncestry

public void setAncestry(String ancestry)
In general this method should not be called by application code, at least not for any Resource that will be persisted or merged. The ancestry string is maintained internally (see updateAncestryForResource()).

Parameters:
ancestry -

updateAncestryForResource

public String updateAncestryForResource()
Using the current settings for resource field set the encoded ancestry string. This method is called automatically from setParentResource(Resource) because the parent defines the ancestry. The parent should be an attached entity to ensure access to all necessary information. If the parent is not a persisted entity, or if it lacks the required information, the update will be skipped.
It can also be called at any time the ancestry has changed, for example, if a resource name has been updated.

Returns:
the built ancestry string

getResourceKey

public String getResourceKey()

setResourceKey

public void setResourceKey(String resourceKey)

getResourceType

public ResourceType getResourceType()

setResourceType

public void setResourceType(ResourceType resourceType)

getInventoryStatus

public InventoryStatus getInventoryStatus()

setInventoryStatus

public void setInventoryStatus(InventoryStatus inventoryStatus)

isConnected

public boolean isConnected()
When true, it can be assumed the plugin can successfully connect to and manage the actual resource. This means the plugin configuration is successfully set and has the proper values that allow the plugin to connect to the managed resource.

Returns:
true if the plugin can actually connect to and manage the resource

setConnected

public void setConnected(boolean connected)

getVersion

public String getVersion()

setVersion

public void setVersion(String version)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getCtime

public long getCtime()
The time that this resource's entity was inserted into the database. This is not necessarily the time that the resource was actually committed (aka imported) into inventory - see getItime() for that.

Returns:
the time this resource entity was committed to the database

getMtime

public long getMtime()
The time that any part of this resource entity was updated in the database.

Returns:
resource entity modified time

setMtime

public void setMtime(long mtime)

getItime

public long getItime()
Returns the time when this resource's getInventoryStatus() changed. If the inventory status is InventoryStatus.COMMITTED, this is the time when the resource was committed (aka imported) into inventory.

Returns:
epoch millisecond of time when status changed

setItime

public void setItime(long inventoryTime)

setAgentSynchronizationNeeded

public void setAgentSynchronizationNeeded()
This method should be called whenever we want the agent to recognize that something about this resource has changed on the server-side that requires synchronization to take place. We don't want to modify the mtime every time this resource is updated/merged; this field has special meaning to the agent-side representation of this resource in the plugin container; if the server-side mtime is later than the agent-side, the agent thinks this resource has been modified in some way and will start a workflow that causes synchronization to happen; however, the agent only cares about specific types of updates to the resource: - plugin configuration changes - measurement schedule updates - basic fields modified such as name, description, inventory status, etc For a list of changes that the agent cares about, see InventoryManager.mergeResource(Resource, Resource)


getModifiedBy

public String getModifiedBy()

setModifiedBy

public void setModifiedBy(String modifiedBy)

getLocation

public String getLocation()

setLocation

public void setLocation(String location)

getChildResources

public Set<Resource> getChildResources()

addChildResource

public void addChildResource(Resource childResource)

removeChildResource

public boolean removeChildResource(Resource childResource)

setChildResources

public void setChildResources(Set<Resource> children)

getParentResource

@Nullable
public Resource getParentResource()

setParentResource

public void setParentResource(@Nullable
                              Resource parentResource)

getResourceConfiguration

public Configuration getResourceConfiguration()

setResourceConfiguration

public void setResourceConfiguration(Configuration resourceConfiguration)

getPluginConfiguration

public Configuration getPluginConfiguration()

setPluginConfiguration

public void setPluginConfiguration(Configuration pluginConfiguration)

getResourceConfigurationUpdates

public List<ResourceConfigurationUpdate> getResourceConfigurationUpdates()

setResourceConfigurationUpdates

public void setResourceConfigurationUpdates(List<ResourceConfigurationUpdate> updates)

addResourceConfigurationUpdates

public void addResourceConfigurationUpdates(ResourceConfigurationUpdate update)

getPluginConfigurationUpdates

public List<PluginConfigurationUpdate> getPluginConfigurationUpdates()

setPluginConfigurationUpdates

public void setPluginConfigurationUpdates(List<PluginConfigurationUpdate> updates)

addPluginConfigurationUpdates

public void addPluginConfigurationUpdates(PluginConfigurationUpdate update)

getSchedules

public Set<MeasurementSchedule> getSchedules()

setSchendules

public void setSchendules(Set<MeasurementSchedule> schedules)

addSchedule

public void addSchedule(MeasurementSchedule schedule)

getAlertDefinitions

public Set<AlertDefinition> getAlertDefinitions()

setAlertDefinitions

public void setAlertDefinitions(Set<AlertDefinition> alertDefinitions)

addAlertDefinition

public void addAlertDefinition(AlertDefinition alertDefinition)

getContentServiceRequests

public List<ContentServiceRequest> getContentServiceRequests()

setContentServiceRequests

public void setContentServiceRequests(List<ContentServiceRequest> contentServiceRequests)

addContentServiceRequest

public void addContentServiceRequest(ContentServiceRequest request)

getCreateChildResourceRequests

public List<CreateResourceHistory> getCreateChildResourceRequests()

setCreateChildResourceRequests

public void setCreateChildResourceRequests(List<CreateResourceHistory> createChildResourceRequests)

addCreateChildResourceHistory

public void addCreateChildResourceHistory(CreateResourceHistory request)

getDeleteResourceRequests

public List<DeleteResourceHistory> getDeleteResourceRequests()

setDeleteResourceRequests

public void setDeleteResourceRequests(List<DeleteResourceHistory> deleteResourceRequests)

addDeleteResourceHistory

public void addDeleteResourceHistory(DeleteResourceHistory history)

getAgent

public Agent getAgent()

setAgent

public void setAgent(Agent agent)

getImplicitGroups

public Set<ResourceGroup> getImplicitGroups()

setImplicitGroups

public void setImplicitGroups(Set<ResourceGroup> implicitGroups)

addImplicitGroup

public void addImplicitGroup(ResourceGroup implicitGroup)

removeImplicitGroup

public void removeImplicitGroup(ResourceGroup implicitGroup)

getExplicitGroups

public Set<ResourceGroup> getExplicitGroups()

setExplicitGroups

public void setExplicitGroups(Set<ResourceGroup> explicitGroups)

addExplicitGroup

public void addExplicitGroup(ResourceGroup explicitGroup)

removeExplicitGroup

public void removeExplicitGroup(ResourceGroup explicitGroup)

getOperationHistories

@NotNull
public List<ResourceOperationHistory> getOperationHistories()

setOperationHistories

public void setOperationHistories(List<ResourceOperationHistory> operationHistories)

getResourceErrors

public List<ResourceError> getResourceErrors()
Returns the list of all errors of all types encountered by this resource. If you only want the errors of a particular type, use getResourceErrors(ResourceErrorType).

Returns:
all errors (may be empty, but never null)

getResourceErrors

public List<ResourceError> getResourceErrors(ResourceErrorType type)
Returns only those errors of the given type.

Parameters:
type - the type of errors that are to be returned
Returns:
list of errors that occurred on this resource that are of the given type (may be empty, but never null)

setResourceErrors

public void setResourceErrors(List<ResourceError> resourceErrors)

addResourceError

public void addResourceError(ResourceError resourceError)

getAvailability

public List<Availability> getAvailability()

getCurrentAvailability

public ResourceAvailability getCurrentAvailability()

setCurrentAvailability

public void setCurrentAvailability(ResourceAvailability currentAvailability)

getResourceRepos

public Set<ResourceRepo> getResourceRepos()
Returns the explicit mapping entities.

Returns:
the mapping entities
See Also:
getResourceRepos()

getRepos

public Set<Repo> getRepos()
The repos this resource is subscribed to.

The returned set is not backed by this entity - if you want to alter the set of associated repos, use getResourceRepos() or addRepo(Repo), removeRepo(Repo).


addRepo

public ResourceRepo addRepo(Repo repo)
Directly subscribe the resource to a repo.

Parameters:
repo -
Returns:
the mapping that was added

removeRepo

public ResourceRepo removeRepo(Repo repo)
Unsubscribes the resource from a repo, if it exists. If it was already subscribed, the mapping that was removed is returned; if not, null is returned.

Parameters:
repo - the repo to unsubscribe from
Returns:
the mapping that was removed or null if the resource was not subscribed to the repo

getInstalledPackages

public Set<InstalledPackage> getInstalledPackages()

addInstalledPackage

public void addInstalledPackage(InstalledPackage installedPackage)

setInstalledPackages

public void setInstalledPackages(Set<InstalledPackage> installedPackages)

getInstalledPackageHistory

public List<InstalledPackageHistory> getInstalledPackageHistory()

addInstalledPackageHistory

public void addInstalledPackageHistory(InstalledPackageHistory history)

setInstalledPackageHistory

public void setInstalledPackageHistory(List<InstalledPackageHistory> installedPackageHistory)

getEventSources

public Set<EventSource> getEventSources()

getProductVersion

public ProductVersion getProductVersion()

setProductVersion

public void setProductVersion(ProductVersion productVersion)

getTags

public Set<Tag> getTags()

setTags

public void setTags(Set<Tag> tags)

addTag

public void addTag(Tag tag)

removeTag

public boolean removeTag(Tag tag)

getAutoGroupBackingGroups

public List<ResourceGroup> getAutoGroupBackingGroups()

setAutoGroupBackingGroups

public void setAutoGroupBackingGroups(List<ResourceGroup> autoGroupBackingGroups)

getDashboards

protected Set<Dashboard> getDashboards()

setDashboards

protected void setDashboards(Set<Dashboard> dashboards)

getDriftDefinitions

public Set<DriftDefinition> getDriftDefinitions()

setDriftDefinitions

public void setDriftDefinitions(Set<DriftDefinition> driftDefinitions)

addDriftDefinition

public void addDriftDefinition(DriftDefinition driftDefinition)

compareTo

public int compareTo(Resource that)
Specified by:
compareTo in interface Comparable<Resource>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

initCurrentAvailability

public void initCurrentAvailability()


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.