org.rhq.core.domain.resource
Class Resource

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

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

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

See Also:
Serialized Form

Field Summary
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_DESCENDENTS
           
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_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_PAREBT_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_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_CHANNEL
           
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_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
           
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_REPORT
           
static Resource ROOT
           
static int ROOT_ID
           
 
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)
           
 ResourceChannel addChannel(Channel channel)
          Directly subscribe the resource to a channel.
 void addChildResource(Resource childResource)
           
 void addContentServiceRequest(ContentServiceRequest request)
           
 void addCreateChildResourceHistory(CreateResourceHistory request)
           
 void addDeleteResourceHistory(DeleteResourceHistory history)
           
 void addExplicitGroup(ResourceGroup explicitGroup)
           
 void addImplicitGroup(ResourceGroup implicitGroup)
           
 void addInstalledPackage(InstalledPackage installedPackage)
           
 void addInstalledPackageHistory(InstalledPackageHistory history)
           
 void addPluginConfigurationUpdates(PluginConfigurationUpdate update)
           
 void addResourceConfigurationUpdates(ResourceConfigurationUpdate update)
           
 void addResourceError(ResourceError resourceError)
           
 void addSchedule(MeasurementSchedule schedule)
           
 void afterUnmarshal(javax.xml.bind.Unmarshaller u, Object parent)
           
 int compareTo(Resource that)
           
 boolean equals(Object o)
           
 Agent getAgent()
           
 Set<AlertDefinition> getAlertDefinitions()
           
 List<Availability> getAvailability()
           
 Set<Channel> getChannels()
          The channels this resource is subscribed to.
 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()
           
 List<DeleteResourceHistory> getDeleteResourceRequests()
           
 String getDescription()
           
 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()
           
 Subject 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<ResourceChannel> getResourceChannels()
          Returns the explicit mapping entities.
 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()
           
 ResourceType getResourceType()
           
 Set<MeasurementSchedule> getSchedules()
           
 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.
 void readExternal(ObjectInput in)
           
 void readExternalAgent(ObjectInput in)
           
 void readExternalRemote(ObjectInput in)
           
 ResourceChannel removeChannel(Channel channel)
          Unsubscribes the resource from a channel, if it exists.
 boolean removeChildResource(Resource childResource)
           
 void removeExplicitGroup(ResourceGroup explicitGroup)
           
 void removeImplicitGroup(ResourceGroup implicitGroup)
           
 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 setChildResources(Set<Resource> children)
           
 void setConnected(boolean connected)
           
 void setContentServiceRequests(List<ContentServiceRequest> contentServiceRequests)
           
 void setCreateChildResourceRequests(List<CreateResourceHistory> createChildResourceRequests)
           
 void setCurrentAvailability(ResourceAvailability currentAvailability)
           
 void setDeleteResourceRequests(List<DeleteResourceHistory> deleteResourceRequests)
           
 void setDescription(String description)
           
 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(Subject 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 setUuid(String uuid)
           
 void setVersion(String version)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 void writeExternalAgent(ObjectOutput out)
           
 void writeExternalRemote(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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_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_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_CHANNEL

public static final String QUERY_GET_AVAILABLE_RESOURCES_FOR_CHANNEL
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_PAREBT_ID

public static final String QUERY_FIND_PAREBT_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_DESCENDENTS

public static final String QUERY_FIND_DESCENDENTS
See Also:
Constant Field Values

QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION

public static final String QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION
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

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 -

Resource

public Resource(@NotNull
                String resourceKey,
                @NotNull
                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

@NotNull
public String getName()

setName

public void setName(@NotNull
                    String name)

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 Subject getModifiedBy()

setModifiedBy

public void setModifiedBy(Subject 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)

getResourceChannels

public Set<ResourceChannel> getResourceChannels()
Returns the explicit mapping entities.

Returns:
the mapping entities
See Also:
#getResources()

getChannels

public Set<Channel> getChannels()
The channels this resource is subscribed to.

The returned set is not backed by this entity - if you want to alter the set of associated channels, use getResourceChannels() or addChannel(Channel), removeChannel(Channel).


addChannel

public ResourceChannel addChannel(Channel channel)
Directly subscribe the resource to a channel.

Parameters:
channel -
Returns:
the mapping that was added

removeChannel

public ResourceChannel removeChannel(Channel channel)
Unsubscribes the resource from a channel, if it exists. If it was already subscribed, the mapping that was removed is returned; if not, null is returned.

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

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)

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

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternalAgent

public void writeExternalAgent(ObjectOutput out)
                        throws IOException
Throws:
IOException

readExternalAgent

public void readExternalAgent(ObjectInput in)
                       throws IOException,
                              ClassNotFoundException
Throws:
IOException
ClassNotFoundException

writeExternalRemote

public void writeExternalRemote(ObjectOutput out)
                         throws IOException
Throws:
IOException

readExternalRemote

public void readExternalRemote(ObjectInput in)
                        throws IOException,
                               ClassNotFoundException
Throws:
IOException
ClassNotFoundException

afterUnmarshal

public void afterUnmarshal(javax.xml.bind.Unmarshaller u,
                           Object parent)

initCurrentAvailability

public void initCurrentAvailability()


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.