org.rhq.enterprise.server.webservices
Class WebservicesManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.webservices.WebservicesManagerBean
All Implemented Interfaces:
AlertDefinitionManagerRemote, AlertManagerRemote, SubjectManagerRemote, RoleManagerRemote, ConfigurationManagerRemote, ContentManagerRemote, RepoManagerRemote, DiscoveryBossRemote, EventManagerRemote, AvailabilityManagerRemote, CallTimeDataManagerRemote, MeasurementBaselineManagerRemote, MeasurementDataManagerRemote, MeasurementDefinitionManagerRemote, MeasurementProblemManagerRemote, MeasurementScheduleManagerRemote, OperationManagerRemote, ResourceGroupManagerRemote, ResourceFactoryManagerRemote, ResourceManagerRemote, ResourceTypeManagerRemote, SupportManagerRemote, SystemManagerRemote, WebservicesRemote

public class WebservicesManagerBean
extends java.lang.Object
implements WebservicesRemote

The purpose of this class is to aggregate all the EJB remote implementation into one class that can be annotated by JBossWS. Each annotated SLSB causes a full WSDL compile and publish by JBossWS which is very costly in terms of time. Deploy times went from 2 mins to 12 mins.

Author:
Simeon Pinder

Constructor Summary
WebservicesManagerBean()
           
 
Method Summary
 void addPackageVersionsToRepo(Subject subject, int repoId, int[] packageVersionIds)
          Associates the package versions (identified by their IDs) to the given repo (also identified by its ID).
 void addResourceGroupsToRole(Subject subject, int roleId, int[] pendingGroupIds)
          Adds the given resource groups to the given role.
 void addResourcesToGroup(Subject subject, int groupId, int[] resourceIds)
           
 void addRolesToResourceGroup(Subject subject, int groupId, int[] roleIds)
           
 void addRolesToSubject(Subject subject, int subjectId, int[] roleIds)
          Assigns a set of roles to a subject which authorizes the subject to do anything the roles permit.
 void addSubjectsToRole(Subject subject, int roleId, int[] subjectIds)
          Assigns a set of subjects to a role which authorizes the subjects to do anything the role permits.
 void cancelOperationHistory(Subject subject, int operationHistoryId, boolean ignoreAgentErrors)
          Cancels a currently in-progress operation.
 void changePassword(Subject subject, java.lang.String username, java.lang.String password)
          Change the password for a user.
 void createPackageBackedResource(Subject subject, int parentResourceId, int newResourceTypeId, java.lang.String newResourceName, Configuration pluginConfiguration, java.lang.String packageName, java.lang.String packageVersion, java.lang.Integer architectureId, Configuration deploymentTimeConfiguration, byte[] packageBits)
          Creates a new physical resource.
 PackageVersion createPackageVersion(Subject subject, java.lang.String packageName, int packageTypeId, java.lang.String version, java.lang.Integer architectureId, byte[] packageBytes)
          Creates a new package version in the system.
 void createPrincipal(Subject subject, java.lang.String username, java.lang.String password)
          Creates a new principal (username and password) in the internal database.
 Repo createRepo(Subject subject, Repo repo)
          Creates a new Repo.
 RepoGroup createRepoGroup(Subject subject, RepoGroup repoGroup)
          Creates a new RepoGroup in the server.
 void createResource(Subject subject, int parentResourceId, int resourceTypeId, java.lang.String resourceName, Configuration pluginConfiguration, Configuration resourceConfiguration)
          Creates a new physical resource.
 ResourceGroup createResourceGroup(Subject subject, ResourceGroup resourceGroup)
           
 Role createRole(Subject subject, Role newRole)
          Persists the new role to the database.
 Subject createSubject(Subject subject, Subject subjectToCreate)
          Create a a new subject.
 void deleteOperationHistory(Subject subject, int operationHistoryId, boolean purgeInProgress)
          Purges the history from the database.
 void deletePackages(Subject subject, int resourceId, int[] installedPackageIds, java.lang.String requestNotes)
          Deletes the specified package from the resource.
 void deleteRepo(Subject subject, int repoId)
          Deletes the indicated repo.
 void deleteRepoGroup(Subject subject, int repoGroupId)
          Deletes the indicated repo group.
 void deleteResource(Subject subject, int resourceId)
          Deletes a physical resource from the agent machine.
 void deleteResourceGroup(Subject subject, int groupId)
           
 void deleteRoles(Subject subject, java.lang.Integer[] roleIds)
          Removes a set of roles from the database.
 void deleteSubjects(Subject subject, int[] subjectIds)
          Deletes the given set of users, including both the Subject and Principal objects associated with those users.
 void deployPackages(Subject subject, int[] resourceIds, int[] packageVersionIds)
          Deploys packages on the specified resources.
 void disableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds)
           
 void disableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds)
           
 void disableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds)
           
 void enableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds)
           
 void enableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds)
           
 void enableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds)
           
 PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject subject, AlertDefinitionCriteria criteria)
           
 PageList<Alert> findAlertsByCriteria(Subject subject, AlertCriteria criteria)
           
 java.util.List<Architecture> findArchitectures(Subject subject)
          Returns all architectures known to the system.
 PageList<Distribution> findAssociatedDistributions(Subject subject, int repoId, PageControl pc)
          gets a list of all associated distributions
 PageList<Availability> findAvailabilityForResource(Subject subject, int resourceId, PageControl pc)
           
 java.util.List<MeasurementBaseline> findBaselinesForResource(Subject subject, int resourceId)
           
 PageList<CallTimeDataComposite> findCallTimeDataForResource(Subject subject, int scheduleId, long beginTime, long endTime, PageControl pc)
           
 PageList<Resource> findChildResources(Subject subject, int resourceId, PageControl pageControl)
           
 java.util.List<MeasurementDataTrait> findCurrentTraitsForResource(Subject subject, int resourceId, DisplayType displayType)
           
 java.util.List<java.util.List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(Subject subject, int groupId, int definitionId, long beginTime, long endTime, int numPoints, boolean groupAggregateOnly)
           
 java.util.List<java.util.List<MeasurementDataNumericHighLowComposite>> findDataForResource(Subject subject, int resourceId, int[] definitionIds, long beginTime, long endTime, int numPoints)
           
 PageList<Event> findEventsByCriteria(Subject subject, EventCriteria criteria)
           
 PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(Subject subject, GroupOperationHistoryCriteria criteria)
           
 PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject, InstalledPackageCriteria criteria)
           
 java.util.Set<MeasurementData> findLiveData(Subject subject, int resourceId, int[] definitionIds)
           
 PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(Subject subject, MeasurementDefinitionCriteria criteria)
           
 java.util.List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject, OperationDefinitionCriteria criteria)
           
 java.util.List<PackageType> findPackageTypes(Subject subject, java.lang.String resourceTypeName, java.lang.String pluginName)
          This gets the package types that can be deployed to the given resource.
 PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject, PackageVersionCriteria criteria)
          If a resourceId filter is not set via PackageVersionCriteria.addFilterResourceId() then this method requires InventoryManager permissions.
 PageList<PackageVersion> findPackageVersionsInRepo(Subject subject, int repoId, java.lang.String filter, PageControl pc)
          Returns the set of package versions that can currently be accessed via the given repo.
 PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject, PackageVersionCriteria criteria)
           
 PageList<ProblemResourceComposite> findProblemResources(Subject subject, long oldestDate, PageControl pc)
           
 PageList<Repo> findRepos(Subject subject, PageControl pc)
          Returns all imported repos in the server.
 PageList<Repo> findReposByCriteria(Subject subject, RepoCriteria criteria)
          Returns all repos that match the given criteria.
 PageList<ResourceComposite> findResourceComposites(Subject subject, ResourceCategory category, java.lang.String typeName, int parentResourceId, java.lang.String searchString, PageControl pageControl)
           
 PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria)
           
 PageList<ResourceGroup> findResourceGroupsForRole(Subject subject, int roleId, PageControl pc)
           
 java.util.List<Resource> findResourceLineage(Subject subject, int resourceId)
          Returns the lineage of the Resource with the specified id.
 PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject, ResourceOperationHistoryCriteria criteria)
           
 PageList<Resource> findResourcesByCriteria(Subject subject, ResourceCriteria criteria)
           
 PageList<ResourceType> findResourceTypesByCriteria(Subject subject, ResourceTypeCriteria criteria)
           
 PageList<Role> findRolesByCriteria(Subject subject, RoleCriteria criteria)
           
 java.util.List<GroupOperationSchedule> findScheduledGroupOperations(Subject subject, int groupId)
           
 java.util.List<ResourceOperationSchedule> findScheduledResourceOperations(Subject subject, int resourceId)
          Returns the list of scheduled operations for the given resource.
 PageList<MeasurementSchedule> findSchedulesByCriteria(Subject subject, MeasurementScheduleCriteria criteria)
           
 PageList<Role> findSubjectAssignedRoles(Subject subject, int subjectId, PageControl pc)
          Get all roles assigned for a certain subject
 PageList<Subject> findSubjectsByCriteria(Subject subject, SubjectCriteria criteria)
           
 PageList<Role> findSubjectUnassignedRoles(Subject subject, int subjectId, PageControl pc)
           
 PageList<Resource> findSubscribedResources(Subject subject, int repoId, PageControl pc)
          Gets all resources that are subscribed to the given repo.
 java.util.List<MeasurementDataTrait> findTraits(Subject subject, int resourceId, int definitionId)
           
 MeasurementAggregate getAggregate(Subject subject, int scheduleId, long startTime, long endTime)
           
 AlertDefinition getAlertDefinition(Subject subject, int alertDefinitionId)
           
 InstalledPackage getBackingPackageForResource(Subject subject, int resourceId)
          For a resource that is content-backed (aka package-backed), this call will return InstalledPackage information for the backing content (package).
 Configuration getConfiguration(Subject subject, int configurationId)
           
 Availability getCurrentAvailabilityForResource(Subject subject, int resourceId)
          Gets the last known Availability for the given resource - which includes whether it is currently up (i.e.
 GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(Subject subject, int configurationUpdateId)
           
 GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject subject, int configurationUpdateId)
           
 PluginConfigurationUpdate getLatestPluginConfigurationUpdate(Subject subject, int resourceId)
           
 ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(Subject subject, int resourceId)
           
 ResourceAvailability getLiveResourceAvailability(Subject subject, int resourceId)
          Returns the availability of the resource with the specified id.
 Configuration getLiveResourceConfiguration(Subject subject, int resourceId, boolean pingAgentFirst)
          Get the currently live resource configuration for the Resource with the given id.
 MeasurementDefinition getMeasurementDefinition(Subject subject, int definitionId)
           
 byte[] getPackageBytes(Subject user, int resourceId, int installedPackageId)
           
 ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject, int packageTypeId)
          Return the deploy configuration definition for the PackageType with the specified id.
 Resource getParentResource(Subject subject, int resourceId)
           
 Configuration getPluginConfiguration(Subject subject, int resourceId)
          Get the current plugin configuration for the Resource with the given id, or null if the resource's plugin configuration is not yet initialized.
 ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId)
          Return the plugin configuration definition for the ResourceType with the specified id.
 Repo getRepo(Subject subject, int repoId)
          Returns the repo with the given id; throws an error if one does not exist at that id.
 RepoGroup getRepoGroup(Subject subject, int repoGroupId)
          Returns the repo group with the given id; throws an error if one does not exist at that id.
 RepoGroupType getRepoGroupTypeByName(Subject subject, java.lang.String name)
          Returns the repo group type with the given name.
 Resource getResource(Subject subject, int resourceId)
          Returns the Resource with the specified id.
 Configuration getResourceConfiguration(Subject subject, int resourceId)
          Get the current Resource configuration.
 ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId)
          Return the resource configuration definition for the ResourceType with the specified id.
 ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType(Subject subject, int resourceTypeId)
          Return the resource configuration definition for the ResourceType with the specified id.
 ResourceGroup getResourceGroup(Subject subject, int groupId)
           
 ResourceGroupComposite getResourceGroupComposite(Subject subject, int groupId)
           
 ResourceType getResourceTypeById(Subject subject, int resourceTypeId)
           
 ResourceType getResourceTypeByNameAndPlugin(Subject subject, java.lang.String name, java.lang.String plugin)
           
 Role getRole(Subject subject, int roleId)
          Returns the role with the given ID
 ServerVersion getServerVersion(Subject subject)
          Provides version information of the server processing the request.
 EventSeverity[] getSeverityBuckets(Subject subject, int resourceId, long begin, long end, int numBuckets)
           
 EventSeverity[] getSeverityBucketsForAutoGroup(Subject subject, int parentResourceId, int resourceTypeId, long begin, long end, int numBuckets)
           
 EventSeverity[] getSeverityBucketsForCompGroup(Subject subject, int resourceGroupId, long begin, long end, int numBuckets)
           
 java.net.URL getSnapshotReport(Subject subject, int resourceId, java.lang.String name, java.lang.String description)
          Asks that a snapshot report be taken of the given resource.
 Subject getSubjectByName(java.lang.String username)
          Looks up the existing of a subject by the given username.
 void ignoreResources(Subject subject, java.lang.Integer[] resourceIds)
           
 void importResources(Subject subject, java.lang.Integer[] resourceIds)
           
 boolean isGroupResourceConfigurationUpdateInProgress(Subject subject, int resourceGroupId)
           
 boolean isResourceConfigurationUpdateInProgress(Subject subject, int resourceId)
          Get whether the the specified resource is in the process of updating its configuration.
 Subject login(java.lang.String username, java.lang.String password)
          Logs a user into the system.
 void logout(Subject subject)
          Logs out a user.
 void removeResourceGroupsFromRole(Subject subject, int roleId, int[] groupIds)
          Removes the given resource groups from the given role.
 void removeResourcesFromGroup(Subject subject, int groupId, int[] resourceIds)
           
 void removeRolesFromResourceGroup(Subject subject, int groupId, int[] roleIds)
           
 void removeRolesFromSubject(Subject subject, int subjectId, int[] roleIds)
          Disassociates particular roles from a subject.
 void removeSubjectsFromRole(Subject subject, int roleId, int[] subjectIds)
          Dissociate particular subjects from a role.
 GroupOperationSchedule scheduleGroupOperation(Subject subject, int groupId, int[] executionOrderResourceIds, boolean haltOnFailure, java.lang.String operationName, Configuration parameters, long delay, long repeatInterval, int repeatCount, int timeout, java.lang.String description)
           
 int scheduleGroupResourceConfigurationUpdate(Subject subject, int compatibleGroupId, java.util.Map<java.lang.Integer,Configuration> newResourceConfigurationMap)
           
 ResourceOperationSchedule scheduleResourceOperation(Subject subject, int resourceId, java.lang.String operationName, long delay, long repeatInterval, int repeatCount, int timeout, Configuration parameters, java.lang.String description)
          Schedules an operation for execution on the given resource.
 void setRecursive(Subject subject, int groupId, boolean isRecursive)
           
 void subscribeResourceToRepos(Subject subject, int resourceId, int[] repoIds)
          Subscribes the identified resource to the set of identified repos.
 int synchronizeRepos(Subject subject, java.lang.Integer[] repoIds)
           
 void unignoreResources(Subject subject, java.lang.Integer[] resourceIds)
           
 void uninventoryResources(Subject subject, int[] resourceIds)
          Removes these resources from inventory.
 void unscheduleGroupOperation(Subject subject, java.lang.String jobId, int resourceGroupId)
          Unschedules the group operation identified with the given job ID.
 void unscheduleResourceOperation(Subject subject, java.lang.String jobId, int resourceId)
          Unschedules the resource operation identified with the given job ID.
 void unsubscribeResourceFromRepos(Subject subject, int resourceId, int[] repoIds)
          Unsubscribes the identified resource from the set of identified repos.
 void updateMeasurementTemplates(Subject subject, int[] measurementDefinitionIds, long collectionInterval)
           
 PluginConfigurationUpdate updatePluginConfiguration(Subject subject, int resourceId, Configuration newConfiguration)
          Updates the plugin configuration used to connect and communicate with the resource.
 Repo updateRepo(Subject subject, Repo repo)
          Update an existing Repo object's basic fields, like name, description, etc.
 ResourceConfigurationUpdate updateResourceConfiguration(Subject subject, int resourceId, Configuration newConfiguration)
          This method is called when a user has requested to change the resource configuration for an existing resource.
 ResourceGroup updateResourceGroup(Subject subject, ResourceGroup newResourceGroup)
           
 Role updateRole(Subject subject, Role role)
          Updates the given role, excluding the subjects and groups.
 void updateSchedule(Subject subject, MeasurementSchedule schedule)
           
 void updateSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds, long collectionInterval)
           
 void updateSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds, long collectionInterval)
           
 Subject updateSubject(Subject subject, Subject subjectToModify)
          Updates an existing subject with new data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebservicesManagerBean

public WebservicesManagerBean()
Method Detail

findAlertsByCriteria

public PageList<Alert> findAlertsByCriteria(Subject subject,
                                            AlertCriteria criteria)
Specified by:
findAlertsByCriteria in interface AlertManagerRemote

getAlertDefinition

public AlertDefinition getAlertDefinition(Subject subject,
                                          int alertDefinitionId)
Specified by:
getAlertDefinition in interface AlertDefinitionManagerRemote

findAlertDefinitionsByCriteria

public PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject subject,
                                                                AlertDefinitionCriteria criteria)
Specified by:
findAlertDefinitionsByCriteria in interface AlertDefinitionManagerRemote

findAvailabilityForResource

public PageList<Availability> findAvailabilityForResource(Subject subject,
                                                          int resourceId,
                                                          PageControl pc)
Specified by:
findAvailabilityForResource in interface AvailabilityManagerRemote
Returns:

getCurrentAvailabilityForResource

public Availability getCurrentAvailabilityForResource(Subject subject,
                                                      int resourceId)
Description copied from interface: AvailabilityManagerRemote
Gets the last known Availability for the given resource - which includes whether it is currently up (i.e. available) or down and the last time it was known to have changed to that state. Note: only use this method if you really need to know the additional RLE information that comes with the Availabilty entity. If you really only need to know whether a resource is UP or DOWN, then use the more efficient method #getCurrentAvailabilityTypeForResource(Subject, int).

Specified by:
getCurrentAvailabilityForResource in interface AvailabilityManagerRemote
Returns:
the full and current status of the resource

findCallTimeDataForResource

public PageList<CallTimeDataComposite> findCallTimeDataForResource(Subject subject,
                                                                   int scheduleId,
                                                                   long beginTime,
                                                                   long endTime,
                                                                   PageControl pc)
Specified by:
findCallTimeDataForResource in interface CallTimeDataManagerRemote

addPackageVersionsToRepo

public void addPackageVersionsToRepo(Subject subject,
                                     int repoId,
                                     int[] packageVersionIds)
Description copied from interface: RepoManagerRemote
Associates the package versions (identified by their IDs) to the given repo (also identified by its ID).

Specified by:
addPackageVersionsToRepo in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
repoId - the ID of the repo
packageVersionIds - the list of package version IDs to add to the repo

createRepo

public Repo createRepo(Subject subject,
                       Repo repo)
                throws RepoException
Description copied from interface: RepoManagerRemote
Creates a new Repo. Note that the created repo will not have any content sources assigned and no resources will be subscribed. It is a virgin repo.

Specified by:
createRepo in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
repo - a new repo object.
Returns:
the newly created repo
Throws:
RepoException - if a repo already exists with the same name

deleteRepo

public void deleteRepo(Subject subject,
                       int repoId)
Description copied from interface: RepoManagerRemote
Deletes the indicated repo. If this deletion orphans package versions (that is, its originating resource or content source has been deleted), this will also purge those orphaned package versions.

Specified by:
deleteRepo in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
repoId - identifies the repo to delete

findRepos

public PageList<Repo> findRepos(Subject subject,
                                PageControl pc)
Description copied from interface: RepoManagerRemote
Returns all imported repos in the server.

Specified by:
findRepos in interface RepoManagerRemote
Parameters:
subject - user making the request
pc - used for pagination
Returns:
paged list

findReposByCriteria

public PageList<Repo> findReposByCriteria(Subject subject,
                                          RepoCriteria criteria)
Description copied from interface: RepoManagerRemote
Returns all repos that match the given criteria.

Specified by:
findReposByCriteria in interface RepoManagerRemote
Parameters:
subject - user making the query
criteria - describes how the query should function; may not be null
Returns:
any repos that match the given criteria; empty list if none match

findPackageVersionsInRepo

public PageList<PackageVersion> findPackageVersionsInRepo(Subject subject,
                                                          int repoId,
                                                          java.lang.String filter,
                                                          PageControl pc)
Description copied from interface: RepoManagerRemote
Returns the set of package versions that can currently be accessed via the given repo.

Specified by:
findPackageVersionsInRepo in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
repoId - identifies the repo
filter - A repo filter.
pc - pagination controls
Returns:
the package versions that are available in the repo

findPackageVersionsInRepoByCriteria

public PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject,
                                                                    PackageVersionCriteria criteria)
Specified by:
findPackageVersionsInRepoByCriteria in interface RepoManagerRemote
criteria - Caller must add a valid repoId via PackageVersionCriteria.addFilterRepoId(Integer)}
Returns:
PackageVersions for the repo

findSubscribedResources

public PageList<Resource> findSubscribedResources(Subject subject,
                                                  int repoId,
                                                  PageControl pc)
Description copied from interface: RepoManagerRemote
Gets all resources that are subscribed to the given repo.

Specified by:
findSubscribedResources in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
Returns:
the list of subscribers

getRepo

public Repo getRepo(Subject subject,
                    int repoId)
Description copied from interface: RepoManagerRemote
Returns the repo with the given id; throws an error if one does not exist at that id.

Specified by:
getRepo in interface RepoManagerRemote
Parameters:
subject - user whose permissions will be checked for access to the repo
repoId - identifies the repo to be retrieved
Returns:
details describing the repo

createRepoGroup

public RepoGroup createRepoGroup(Subject subject,
                                 RepoGroup repoGroup)
                          throws RepoException
Description copied from interface: RepoManagerRemote
Creates a new RepoGroup in the server.

Specified by:
createRepoGroup in interface RepoManagerRemote
Parameters:
subject - represents the user creating the group
repoGroup - group data to create
Returns:
group instance populated after persisting
Throws:
RepoException - if a repo group already exists with this name

deleteRepoGroup

public void deleteRepoGroup(Subject subject,
                            int repoGroupId)
Description copied from interface: RepoManagerRemote
Deletes the indicated repo group.

Specified by:
deleteRepoGroup in interface RepoManagerRemote
Parameters:
subject - user deleting the group
repoGroupId - identifies the group being deleted

getRepoGroup

public RepoGroup getRepoGroup(Subject subject,
                              int repoGroupId)
Description copied from interface: RepoManagerRemote
Returns the repo group with the given id; throws an error if one does not exist at that id.

Specified by:
getRepoGroup in interface RepoManagerRemote
Parameters:
subject - user whose permissions will be checked for access to the repo
repoGroupId - identifies the repo group to be retrieved
Returns:
details describing the repo group

getRepoGroupTypeByName

public RepoGroupType getRepoGroupTypeByName(Subject subject,
                                            java.lang.String name)
Description copied from interface: RepoManagerRemote
Returns the repo group type with the given name.

Specified by:
getRepoGroupTypeByName in interface RepoManagerRemote
Parameters:
subject - user whose permissions will be checked for access to the group type
name - identifies the repo group type
Returns:
details of the group type; null if no group is found with the name

subscribeResourceToRepos

public void subscribeResourceToRepos(Subject subject,
                                     int resourceId,
                                     int[] repoIds)
Description copied from interface: RepoManagerRemote
Subscribes the identified resource to the set of identified repos. Once complete, the resource will be able to access all package content from all content sources that are assigned to the given repos.

Specified by:
subscribeResourceToRepos in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - The id of the resource to be subscribed.
repoIds - A list of repos to which the resource is subscribed.

unsubscribeResourceFromRepos

public void unsubscribeResourceFromRepos(Subject subject,
                                         int resourceId,
                                         int[] repoIds)
Description copied from interface: RepoManagerRemote
Unsubscribes the identified resource from the set of identified repos.

Specified by:
unsubscribeResourceFromRepos in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - The id of the resource to be subscribed.
repoIds - A list of repos to which the resource is subscribed.

updateRepo

public Repo updateRepo(Subject subject,
                       Repo repo)
                throws RepoException
Description copied from interface: RepoManagerRemote
Update an existing Repo object's basic fields, like name, description, etc. Note that the given repo's relationships will be ignored and not merged with the existing repo (e.g. is subscribed resources will not be changed, regardless of what the given repo's subscribed resources set it).

Specified by:
updateRepo in interface RepoManagerRemote
Parameters:
subject - The logged in user's subject.
repo - to be updated
Returns:
Repo that was updated
Throws:
RepoException

findPackageVersionsByCriteria

public PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject,
                                                              PackageVersionCriteria criteria)
Description copied from interface: ContentManagerRemote
If a resourceId filter is not set via PackageVersionCriteria.addFilterResourceId() then this method requires InventoryManager permissions. When set the user must have permission to view the resource.

Specified by:
findPackageVersionsByCriteria in interface ContentManagerRemote
Returns:
Installed PackageVersions for the resource

synchronizeRepos

public int synchronizeRepos(Subject subject,
                            java.lang.Integer[] repoIds)
Specified by:
synchronizeRepos in interface RepoManagerRemote

getConfiguration

public Configuration getConfiguration(Subject subject,
                                      int configurationId)
Specified by:
getConfiguration in interface ConfigurationManagerRemote

getGroupPluginConfigurationUpdate

public GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(Subject subject,
                                                                        int configurationUpdateId)
Specified by:
getGroupPluginConfigurationUpdate in interface ConfigurationManagerRemote

getGroupResourceConfigurationUpdate

public GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject subject,
                                                                            int configurationUpdateId)
Specified by:
getGroupResourceConfigurationUpdate in interface ConfigurationManagerRemote

getLatestPluginConfigurationUpdate

public PluginConfigurationUpdate getLatestPluginConfigurationUpdate(Subject subject,
                                                                    int resourceId)
Specified by:
getLatestPluginConfigurationUpdate in interface ConfigurationManagerRemote

getLatestResourceConfigurationUpdate

public ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(Subject subject,
                                                                        int resourceId)
Specified by:
getLatestResourceConfigurationUpdate in interface ConfigurationManagerRemote

getLiveResourceConfiguration

public Configuration getLiveResourceConfiguration(Subject subject,
                                                  int resourceId,
                                                  boolean pingAgentFirst)
                                           throws java.lang.Exception
Description copied from interface: ConfigurationManagerRemote
Get the currently live resource configuration for the Resource with the given id. This actually asks for the up-to-date configuration directly from the agent. An exception will be thrown if communications with the agent cannot be made.

Specified by:
getLiveResourceConfiguration in interface ConfigurationManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - resourceId
Returns:
the live configuration
Throws:
java.lang.Exception - if failed to get the configuration from the agent

getPluginConfiguration

public Configuration getPluginConfiguration(Subject subject,
                                            int resourceId)
Description copied from interface: ConfigurationManagerRemote
Get the current plugin configuration for the Resource with the given id, or null if the resource's plugin configuration is not yet initialized.

Specified by:
getPluginConfiguration in interface ConfigurationManagerRemote
resourceId - Resource Id
Returns:
the current plugin configuration for the Resource with the given id, or null if the resource's configuration is not yet initialized

getPluginConfigurationDefinitionForResourceType

public ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(Subject subject,
                                                                               int resourceTypeId)
Description copied from interface: ConfigurationManagerRemote
Return the plugin configuration definition for the ResourceType with the specified id.

Specified by:
getPluginConfigurationDefinitionForResourceType in interface ConfigurationManagerRemote
Parameters:
subject - the user who is requesting the plugin configuration definition
resourceTypeId - identifies the resource type whose plugin configuration definition is being requested
Returns:
the plugin configuration definition for the ResourceType with the specified id, or null if the ResourceType does not define a plugin configuration

getResourceConfiguration

public Configuration getResourceConfiguration(Subject subject,
                                              int resourceId)
Description copied from interface: ConfigurationManagerRemote
Get the current Resource configuration.

Specified by:
getResourceConfiguration in interface ConfigurationManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - A resource id.
Returns:
The specified configuration.

getResourceConfigurationDefinitionForResourceType

public ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(Subject subject,
                                                                                 int resourceTypeId)
Description copied from interface: ConfigurationManagerRemote
Return the resource configuration definition for the ResourceType with the specified id.

Specified by:
getResourceConfigurationDefinitionForResourceType in interface ConfigurationManagerRemote
Parameters:
subject - the user who is requesting the resource configuration definition
resourceTypeId - identifies the resource type whose resource configuration definition is being requested
Returns:
the resource configuration definition for the ResourceType with the specified id, or null if the ResourceType does not define a resource configuration

getResourceConfigurationDefinitionWithTemplatesForResourceType

public ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType(Subject subject,
                                                                                              int resourceTypeId)
Description copied from interface: ConfigurationManagerRemote
Return the resource configuration definition for the ResourceType with the specified id. The templates will be loaded in the definition returned from this call.

Specified by:
getResourceConfigurationDefinitionWithTemplatesForResourceType in interface ConfigurationManagerRemote
Parameters:
subject - the user who is requesting the resource configuration definition
resourceTypeId - identifies the resource type whose resource configuration definition is being requested
Returns:
the resource configuration definition for the ResourceType with the specified id, or null if the ResourceType does not define a resource configuration

isGroupResourceConfigurationUpdateInProgress

public boolean isGroupResourceConfigurationUpdateInProgress(Subject subject,
                                                            int resourceGroupId)
Specified by:
isGroupResourceConfigurationUpdateInProgress in interface ConfigurationManagerRemote

isResourceConfigurationUpdateInProgress

public boolean isResourceConfigurationUpdateInProgress(Subject subject,
                                                       int resourceId)
Description copied from interface: ConfigurationManagerRemote
Get whether the the specified resource is in the process of updating its configuration.

Specified by:
isResourceConfigurationUpdateInProgress in interface ConfigurationManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - A resource id.
Returns:
True if in progress, else False.

scheduleGroupResourceConfigurationUpdate

public int scheduleGroupResourceConfigurationUpdate(Subject subject,
                                                    int compatibleGroupId,
                                                    java.util.Map<java.lang.Integer,Configuration> newResourceConfigurationMap)
Specified by:
scheduleGroupResourceConfigurationUpdate in interface ConfigurationManagerRemote

updatePluginConfiguration

public PluginConfigurationUpdate updatePluginConfiguration(Subject subject,
                                                           int resourceId,
                                                           Configuration newConfiguration)
                                                    throws ResourceNotFoundException
Description copied from interface: ConfigurationManagerRemote
Updates the plugin configuration used to connect and communicate with the resource. The given newConfiguration is usually a modified version of a configuration returned by ConfigurationManagerRemote.getPluginConfiguration(Subject, int).

Specified by:
updatePluginConfiguration in interface ConfigurationManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - a Resource id
newConfiguration - the new plugin configuration
Returns:
the plugin configuration update item corresponding to this request
Throws:
ResourceNotFoundException

updateResourceConfiguration

public ResourceConfigurationUpdate updateResourceConfiguration(Subject subject,
                                                               int resourceId,
                                                               Configuration newConfiguration)
                                                        throws ResourceNotFoundException,
                                                               ConfigurationUpdateStillInProgressException
Description copied from interface: ConfigurationManagerRemote
This method is called when a user has requested to change the resource configuration for an existing resource. If the user does not have the proper permissions to change the resource's configuration, an exception is thrown.

This will not wait for the agent to finish the configuration update. This will return after the request is sent. Once the agent finishes with the request, it will send the completed request information to #completedResourceConfigurationUpdate(AbstractResourceConfigurationUpdate).

Specified by:
updateResourceConfiguration in interface ConfigurationManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - identifies the resource to be updated
newConfiguration - the resource's desired new configuration
Returns:
the resource configuration update item corresponding to this request
Throws:
ResourceNotFoundException
ConfigurationUpdateStillInProgressException

getPackageTypeConfigurationDefinition

public ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject,
                                                                     int packageTypeId)
Description copied from interface: ConfigurationManagerRemote
Return the deploy configuration definition for the PackageType with the specified id.

Specified by:
getPackageTypeConfigurationDefinition in interface ConfigurationManagerRemote
Parameters:
subject - the user who is requesting the plugin configuration definition
packageTypeId - identifies the package type whose configuration definition is being requested
Returns:
the the deploy configuration definition for the PackageType with the specified id.

createPackageVersion

public PackageVersion createPackageVersion(Subject subject,
                                           java.lang.String packageName,
                                           int packageTypeId,
                                           java.lang.String version,
                                           java.lang.Integer architectureId,
                                           byte[] packageBytes)
Description copied from interface: ContentManagerRemote
Creates a new package version in the system. If the parent package (identified by the packageName parameter) does not exist, it will be created. If a package version exists with the specified version ID, a new one will not be created and the existing package version instance will be returned.

Specified by:
createPackageVersion in interface ContentManagerRemote
Parameters:
subject - The logged in subject
packageName - parent package name; uniquely identifies the package under which this version goes
packageTypeId - identifies the type of package in case the general package needs to be created
version - identifies the version to be create
architectureId - architecture of the newly created package version. If null then no architecture restriction.
Returns:
newly created package version if one did not exist; existing package version that matches these data if one was found

deletePackages

public void deletePackages(Subject subject,
                           int resourceId,
                           int[] installedPackageIds,
                           java.lang.String requestNotes)
Description copied from interface: ContentManagerRemote
Deletes the specified package from the resource.

Specified by:
deletePackages in interface ContentManagerRemote
Parameters:
subject - The logged in subject
resourceId - identifies the resource from which the packages should be deleted
installedPackageIds - identifies all of the packages to be deleted

deployPackages

public void deployPackages(Subject subject,
                           int[] resourceIds,
                           int[] packageVersionIds)
Description copied from interface: ContentManagerRemote
Deploys packages on the specified resources. Each installed package entry should be populated with the PackageVersion being installed, along with the deployment configuration values if any. This method will take care of populating the rest of the values in each installed package object.

Specified by:
deployPackages in interface ContentManagerRemote
Parameters:
subject - The logged in subject
resourceIds - identifies the resources against which the package will be deployed
packageVersionIds - packageVersions we want to install

findArchitectures

public java.util.List<Architecture> findArchitectures(Subject subject)
Description copied from interface: ContentManagerRemote
Returns all architectures known to the system.

Specified by:
findArchitectures in interface ContentManagerRemote
Parameters:
subject - The logged in subject
Returns:
list of all architectures in the database

findInstalledPackagesByCriteria

public PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject,
                                                                  InstalledPackageCriteria criteria)
Specified by:
findInstalledPackagesByCriteria in interface ContentManagerRemote
criteria - InstalledPackageCriteria
Returns:
InstalledPackages for the criteria

findPackageTypes

public java.util.List<PackageType> findPackageTypes(Subject subject,
                                                    java.lang.String resourceTypeName,
                                                    java.lang.String pluginName)
                                             throws ResourceTypeNotFoundException
Description copied from interface: ContentManagerRemote
This gets the package types that can be deployed to the given resource. It is a function of the resource type of the resource.

Specified by:
findPackageTypes in interface ContentManagerRemote
Parameters:
subject - The logged in subject
resourceTypeName - The resource type in question
Returns:
The requested list of package types. Can be empty.
Throws:
ResourceTypeNotFoundException

getBackingPackageForResource

public InstalledPackage getBackingPackageForResource(Subject subject,
                                                     int resourceId)
Description copied from interface: ContentManagerRemote
For a resource that is content-backed (aka package-backed), this call will return InstalledPackage information for the backing content (package).

Specified by:
getBackingPackageForResource in interface ContentManagerRemote
resourceId - a valid resource
Returns:
The InstalledPackage object for the content-packed resource. Or null for non-existent or non-package backed resource.

getPackageBytes

public byte[] getPackageBytes(Subject user,
                              int resourceId,
                              int installedPackageId)
Specified by:
getPackageBytes in interface ContentManagerRemote

ignoreResources

public void ignoreResources(Subject subject,
                            java.lang.Integer[] resourceIds)
Specified by:
ignoreResources in interface DiscoveryBossRemote

importResources

public void importResources(Subject subject,
                            java.lang.Integer[] resourceIds)
Specified by:
importResources in interface DiscoveryBossRemote

unignoreResources

public void unignoreResources(Subject subject,
                              java.lang.Integer[] resourceIds)
Specified by:
unignoreResources in interface DiscoveryBossRemote

findEventsByCriteria

public PageList<Event> findEventsByCriteria(Subject subject,
                                            EventCriteria criteria)
Specified by:
findEventsByCriteria in interface EventManagerRemote

getSeverityBuckets

public EventSeverity[] getSeverityBuckets(Subject subject,
                                          int resourceId,
                                          long begin,
                                          long end,
                                          int numBuckets)
Specified by:
getSeverityBuckets in interface EventManagerRemote

getSeverityBucketsForAutoGroup

public EventSeverity[] getSeverityBucketsForAutoGroup(Subject subject,
                                                      int parentResourceId,
                                                      int resourceTypeId,
                                                      long begin,
                                                      long end,
                                                      int numBuckets)
Specified by:
getSeverityBucketsForAutoGroup in interface EventManagerRemote

getSeverityBucketsForCompGroup

public EventSeverity[] getSeverityBucketsForCompGroup(Subject subject,
                                                      int resourceGroupId,
                                                      long begin,
                                                      long end,
                                                      int numBuckets)
Specified by:
getSeverityBucketsForCompGroup in interface EventManagerRemote

findBaselinesForResource

public java.util.List<MeasurementBaseline> findBaselinesForResource(Subject subject,
                                                                    int resourceId)
Specified by:
findBaselinesForResource in interface MeasurementBaselineManagerRemote

findCurrentTraitsForResource

public java.util.List<MeasurementDataTrait> findCurrentTraitsForResource(Subject subject,
                                                                         int resourceId,
                                                                         DisplayType displayType)
Specified by:
findCurrentTraitsForResource in interface MeasurementDataManagerRemote

findDataForCompatibleGroup

public java.util.List<java.util.List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(Subject subject,
                                                                                                         int groupId,
                                                                                                         int definitionId,
                                                                                                         long beginTime,
                                                                                                         long endTime,
                                                                                                         int numPoints,
                                                                                                         boolean groupAggregateOnly)
Specified by:
findDataForCompatibleGroup in interface MeasurementDataManagerRemote

findDataForResource

public java.util.List<java.util.List<MeasurementDataNumericHighLowComposite>> findDataForResource(Subject subject,
                                                                                                  int resourceId,
                                                                                                  int[] definitionIds,
                                                                                                  long beginTime,
                                                                                                  long endTime,
                                                                                                  int numPoints)
Specified by:
findDataForResource in interface MeasurementDataManagerRemote

findLiveData

public java.util.Set<MeasurementData> findLiveData(Subject subject,
                                                   int resourceId,
                                                   int[] definitionIds)
Specified by:
findLiveData in interface MeasurementDataManagerRemote

findTraits

public java.util.List<MeasurementDataTrait> findTraits(Subject subject,
                                                       int resourceId,
                                                       int definitionId)
Specified by:
findTraits in interface MeasurementDataManagerRemote

getAggregate

public MeasurementAggregate getAggregate(Subject subject,
                                         int scheduleId,
                                         long startTime,
                                         long endTime)
Specified by:
getAggregate in interface MeasurementDataManagerRemote

findMeasurementDefinitionsByCriteria

public PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(Subject subject,
                                                                            MeasurementDefinitionCriteria criteria)
Specified by:
findMeasurementDefinitionsByCriteria in interface MeasurementDefinitionManagerRemote

getMeasurementDefinition

public MeasurementDefinition getMeasurementDefinition(Subject subject,
                                                      int definitionId)
Specified by:
getMeasurementDefinition in interface MeasurementDefinitionManagerRemote

findProblemResources

public PageList<ProblemResourceComposite> findProblemResources(Subject subject,
                                                               long oldestDate,
                                                               PageControl pc)
Specified by:
findProblemResources in interface MeasurementProblemManagerRemote

disableSchedulesForResource

public void disableSchedulesForResource(Subject subject,
                                        int resourceId,
                                        int[] measurementDefinitionIds)
Specified by:
disableSchedulesForResource in interface MeasurementScheduleManagerRemote

disableSchedulesForCompatibleGroup

public void disableSchedulesForCompatibleGroup(Subject subject,
                                               int groupId,
                                               int[] measurementDefinitionIds)
Specified by:
disableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote

disableMeasurementTemplates

public void disableMeasurementTemplates(Subject subject,
                                        int[] measurementDefinitionIds)
Specified by:
disableMeasurementTemplates in interface MeasurementScheduleManagerRemote

enableSchedulesForResource

public void enableSchedulesForResource(Subject subject,
                                       int resourceId,
                                       int[] measurementDefinitionIds)
Specified by:
enableSchedulesForResource in interface MeasurementScheduleManagerRemote

enableSchedulesForCompatibleGroup

public void enableSchedulesForCompatibleGroup(Subject subject,
                                              int groupId,
                                              int[] measurementDefinitionIds)
Specified by:
enableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote

enableMeasurementTemplates

public void enableMeasurementTemplates(Subject subject,
                                       int[] measurementDefinitionIds)
Specified by:
enableMeasurementTemplates in interface MeasurementScheduleManagerRemote

updateSchedule

public void updateSchedule(Subject subject,
                           MeasurementSchedule schedule)
Specified by:
updateSchedule in interface MeasurementScheduleManagerRemote

updateSchedulesForResource

public void updateSchedulesForResource(Subject subject,
                                       int resourceId,
                                       int[] measurementDefinitionIds,
                                       long collectionInterval)
Specified by:
updateSchedulesForResource in interface MeasurementScheduleManagerRemote

updateSchedulesForCompatibleGroup

public void updateSchedulesForCompatibleGroup(Subject subject,
                                              int groupId,
                                              int[] measurementDefinitionIds,
                                              long collectionInterval)
Specified by:
updateSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote

updateMeasurementTemplates

public void updateMeasurementTemplates(Subject subject,
                                       int[] measurementDefinitionIds,
                                       long collectionInterval)
Specified by:
updateMeasurementTemplates in interface MeasurementScheduleManagerRemote

findSchedulesByCriteria

public PageList<MeasurementSchedule> findSchedulesByCriteria(Subject subject,
                                                             MeasurementScheduleCriteria criteria)
Specified by:
findSchedulesByCriteria in interface MeasurementScheduleManagerRemote

cancelOperationHistory

public void cancelOperationHistory(Subject subject,
                                   int operationHistoryId,
                                   boolean ignoreAgentErrors)
Description copied from interface: OperationManagerRemote
Cancels a currently in-progress operation. Doing this will attempt to stop the invocation if it is currently running on the agent.

Note that this method will handle canceling a resource or group history - depending on what the given historyId refers to. If it refers to a group history, it will cancel all the resource invocations for that group invocation.

If the cancel request succeeds, the history element will be checked against the AlertConditionCacheManager.

Specified by:
cancelOperationHistory in interface OperationManagerRemote
Parameters:
subject - The logged in user's subject.
ignoreAgentErrors - if true this will still flag the history items in the database as canceled, even if the method failed to notify the agent(s) that the operation should be canceled. If false, this method will not update the history status unless it could successfully tell the agent(s) to cancel the operation.

deleteOperationHistory

public void deleteOperationHistory(Subject subject,
                                   int operationHistoryId,
                                   boolean purgeInProgress)
Description copied from interface: OperationManagerRemote
Purges the history from the database. Doing this loses all audit trails of the invoked operation. This can handle deleting a group or resource history.

Note that this method will handle deleting a resource or group history - depending on what the given historyId refers to.

Specified by:
deleteOperationHistory in interface OperationManagerRemote
Parameters:
subject - The logged in user's subject.
purgeInProgress - if true, even if the operation is in progress, the history entity will be deleted. You normally do not want to purge operation histories until they are completed, so you normally pass in false, but a user might want to force it to be purged, in which case the UI will want to pass in true

findGroupOperationHistoriesByCriteria

public PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(Subject subject,
                                                                             GroupOperationHistoryCriteria criteria)
Specified by:
findGroupOperationHistoriesByCriteria in interface OperationManagerRemote

findOperationDefinitionsByCriteria

public java.util.List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject,
                                                                              OperationDefinitionCriteria criteria)
Specified by:
findOperationDefinitionsByCriteria in interface OperationManagerRemote

findResourceOperationHistoriesByCriteria

public PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject,
                                                                                   ResourceOperationHistoryCriteria criteria)
Specified by:
findResourceOperationHistoriesByCriteria in interface OperationManagerRemote

findScheduledGroupOperations

public java.util.List<GroupOperationSchedule> findScheduledGroupOperations(Subject subject,
                                                                           int groupId)
                                                                    throws java.lang.Exception
Specified by:
findScheduledGroupOperations in interface OperationManagerRemote
Throws:
java.lang.Exception

findScheduledResourceOperations

public java.util.List<ResourceOperationSchedule> findScheduledResourceOperations(Subject subject,
                                                                                 int resourceId)
                                                                          throws java.lang.Exception
Description copied from interface: OperationManagerRemote
Returns the list of scheduled operations for the given resource. This only includes scheduled jobs on the individual resource - it will not include schedules from groups, even if the resource is a member of a group that has scheduled jobs.

Specified by:
findScheduledResourceOperations in interface OperationManagerRemote
Returns:
resource scheduled operations
Throws:
java.lang.Exception - TODO

scheduleGroupOperation

public GroupOperationSchedule scheduleGroupOperation(Subject subject,
                                                     int groupId,
                                                     int[] executionOrderResourceIds,
                                                     boolean haltOnFailure,
                                                     java.lang.String operationName,
                                                     Configuration parameters,
                                                     long delay,
                                                     long repeatInterval,
                                                     int repeatCount,
                                                     int timeout,
                                                     java.lang.String description)
                                              throws ScheduleException
Specified by:
scheduleGroupOperation in interface OperationManagerRemote
Returns:
Throws:
ScheduleException

scheduleResourceOperation

public ResourceOperationSchedule scheduleResourceOperation(Subject subject,
                                                           int resourceId,
                                                           java.lang.String operationName,
                                                           long delay,
                                                           long repeatInterval,
                                                           int repeatCount,
                                                           int timeout,
                                                           Configuration parameters,
                                                           java.lang.String description)
                                                    throws ScheduleException
Description copied from interface: OperationManagerRemote
Schedules an operation for execution on the given resource.

Specified by:
scheduleResourceOperation in interface OperationManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - the resource that is the target of the operation
operationName - the actual operation to invoke
delay - the number of milliseconds to delay this operation, 0 for immediate start.
repeatInterval - the number of milliseconds after completion to repeat this operation. 0 for no repeat.
repeatCount - the number of times to repeat this operation. -1 infinite, 0 for no repeat.
timeout - the number of seconds before this operation will fail due to timeout. 0 for no timeout.
parameters - the names parameters for the operation.
description - user-entered description of the job to be scheduled
Returns:
the information on the new schedule
Throws:
ScheduleException - TODO

unscheduleGroupOperation

public void unscheduleGroupOperation(Subject subject,
                                     java.lang.String jobId,
                                     int resourceGroupId)
                              throws UnscheduleException
Description copied from interface: OperationManagerRemote
Unschedules the group operation identified with the given job ID.

Specified by:
unscheduleGroupOperation in interface OperationManagerRemote
Parameters:
subject - the user who is asking to unschedule the operation
jobId - identifies the operation to unschedule
resourceGroupId - the ID of the group whose operation is getting unscheduled
Throws:
UnscheduleException - TODO

unscheduleResourceOperation

public void unscheduleResourceOperation(Subject subject,
                                        java.lang.String jobId,
                                        int resourceId)
                                 throws UnscheduleException
Description copied from interface: OperationManagerRemote
Unschedules the resource operation identified with the given job ID.

Specified by:
unscheduleResourceOperation in interface OperationManagerRemote
Parameters:
subject - The logged in user's subject.
jobId - identifies the operation to unschedule
resourceId - the ID of the resource whose operation is getting unscheduled
Throws:
UnscheduleException - TODO

createResource

public void createResource(Subject subject,
                           int parentResourceId,
                           int resourceTypeId,
                           java.lang.String resourceName,
                           Configuration pluginConfiguration,
                           Configuration resourceConfiguration)
Description copied from interface: ResourceFactoryManagerRemote
Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, the resource component of the indicated parent will be used to create the new resource. This call should only be made for resource types that are defined with a create/delete policy of CreateDeletePolicy.BOTH or CreateDeletePolicy.CREATE_ONLY. If this call is made for a resource type that cannot be created based on this policy, the plugin container will throw an exception. This call should only be made for resource types that are defined with a creation data type of ResourceCreationDataType.CONFIGURATION. If this call is made for a resource type that cannot be created via a configuration, the plugin container will throw an exception.

Specified by:
createResource in interface ResourceFactoryManagerRemote
Parameters:
subject - user requesting the creation
parentResourceId - parent resource under which the new resource should be created
resourceTypeId - type of resource to create
resourceName - name of the resource being created
pluginConfiguration - optional plugin configuration that may be needed in order to create the new resource
resourceConfiguration - resource configuration for the new resource

createPackageBackedResource

public void createPackageBackedResource(Subject subject,
                                        int parentResourceId,
                                        int newResourceTypeId,
                                        java.lang.String newResourceName,
                                        Configuration pluginConfiguration,
                                        java.lang.String packageName,
                                        java.lang.String packageVersion,
                                        java.lang.Integer architectureId,
                                        Configuration deploymentTimeConfiguration,
                                        byte[] packageBits)
Description copied from interface: ResourceFactoryManagerRemote
Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, the resource component of the indicated parent will be used to create the new resource. This call should only be made for resource types that are defined with a create/delete policy of CreateDeletePolicy.BOTH or CreateDeletePolicy.CREATE_ONLY. If this call is made for a resource type that cannot be created based on this policy, the plugin container will throw an exception. This call should only be made for resource types that are defined with a creation data type of ResourceCreationDataType.CONTENT. If this call is made for a resource type that cannot be created via an package, the plugin container will throw an exception.

Specified by:
createPackageBackedResource in interface ResourceFactoryManagerRemote
Parameters:
subject - user requesting the creation
parentResourceId - parent resource under which the new resource should be created
newResourceTypeId - identifies the type of resource being created
newResourceName - Ignored, pass null. This is determined from the package.
pluginConfiguration - optional plugin configuration that may be needed in order to create the new resource
packageName - name of the package that will be created as a result of this resource create
packageVersion - The string version of the package. If null will be set to system timestamp (long)
architectureId - Id of the target architecture of the package, null indicates NoArch (any).
deploymentTimeConfiguration - dictates how the package will be deployed
packageBits - content of the package to create

deleteResource

public void deleteResource(Subject subject,
                           int resourceId)
Description copied from interface: ResourceFactoryManagerRemote
Deletes a physical resource from the agent machine. After this call, the resource will no longer be accessible not only to JON, but in general. It is up to the plugin to determine how to complete the delete, but a deleted resource will no longer be returned from resource discoveries.

Specified by:
deleteResource in interface ResourceFactoryManagerRemote
Parameters:
subject - user requesting the creation
resourceId - resource being deleted

findResourceComposites

public PageList<ResourceComposite> findResourceComposites(Subject subject,
                                                          ResourceCategory category,
                                                          java.lang.String typeName,
                                                          int parentResourceId,
                                                          java.lang.String searchString,
                                                          PageControl pageControl)
Specified by:
findResourceComposites in interface ResourceManagerRemote

findResourceLineage

public java.util.List<Resource> findResourceLineage(Subject subject,
                                                    int resourceId)
Description copied from interface: ResourceManagerRemote
Returns the lineage of the Resource with the specified id. The lineage is represented as a List of Resources, with the first item being the root of the Resource's ancestry (or the Resource itself if it is a root Resource (i.e. a platform)) and the last item being the Resource itself. Since the lineage includes the Resource itself, the returned List will always contain at least one item.

Specified by:
findResourceLineage in interface ResourceManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - the id of a Resource in inventory
Returns:
the lineage of the Resource with the specified id

findResourcesByCriteria

public PageList<Resource> findResourcesByCriteria(Subject subject,
                                                  ResourceCriteria criteria)
Specified by:
findResourcesByCriteria in interface ResourceManagerRemote

findChildResources

public PageList<Resource> findChildResources(Subject subject,
                                             int resourceId,
                                             PageControl pageControl)
Specified by:
findChildResources in interface ResourceManagerRemote

getParentResource

public Resource getParentResource(Subject subject,
                                  int resourceId)
Specified by:
getParentResource in interface ResourceManagerRemote

getLiveResourceAvailability

public ResourceAvailability getLiveResourceAvailability(Subject subject,
                                                        int resourceId)
Description copied from interface: ResourceManagerRemote
Returns the availability of the resource with the specified id. This performs a live check - a resource will be considered UNKNOWN if the agent cannot be contacted for any reason.

Specified by:
getLiveResourceAvailability in interface ResourceManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - the id of a Resource in inventory.
Returns:
the resource availability - note that if the encapsulated availability type is null, the resource availability is UNKNOWN.

getResource

public Resource getResource(Subject subject,
                            int resourceId)
Description copied from interface: ResourceManagerRemote
Returns the Resource with the specified id.

Specified by:
getResource in interface ResourceManagerRemote
Parameters:
subject - The logged in user's subject.
resourceId - the id of a Resource in inventory.
Returns:
the resource

uninventoryResources

public void uninventoryResources(Subject subject,
                                 int[] resourceIds)
Description copied from interface: ResourceManagerRemote
Removes these resources from inventory. The resources may subsequently be rediscovered. Note that for each specified resource all children will also be removed, it it not necessary or recommended to specify more than one resource in the same ancestry line.

Specified by:
uninventoryResources in interface ResourceManagerRemote
Parameters:
subject - The logged in user's subject.
resourceIds - The resources to uninventory.

addResourcesToGroup

public void addResourcesToGroup(Subject subject,
                                int groupId,
                                int[] resourceIds)
Specified by:
addResourcesToGroup in interface ResourceGroupManagerRemote

createResourceGroup

public ResourceGroup createResourceGroup(Subject subject,
                                         ResourceGroup resourceGroup)
Specified by:
createResourceGroup in interface ResourceGroupManagerRemote

deleteResourceGroup

public void deleteResourceGroup(Subject subject,
                                int groupId)
                         throws ResourceGroupNotFoundException,
                                ResourceGroupDeleteException
Specified by:
deleteResourceGroup in interface ResourceGroupManagerRemote
Throws:
ResourceGroupNotFoundException
ResourceGroupDeleteException

findResourceGroupsByCriteria

public PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject,
                                                            ResourceGroupCriteria criteria)
Specified by:
findResourceGroupsByCriteria in interface ResourceGroupManagerRemote

findResourceGroupsForRole

public PageList<ResourceGroup> findResourceGroupsForRole(Subject subject,
                                                         int roleId,
                                                         PageControl pc)
Specified by:
findResourceGroupsForRole in interface ResourceGroupManagerRemote

getResourceGroup

public ResourceGroup getResourceGroup(Subject subject,
                                      int groupId)
Specified by:
getResourceGroup in interface ResourceGroupManagerRemote

getResourceGroupComposite

public ResourceGroupComposite getResourceGroupComposite(Subject subject,
                                                        int groupId)
Specified by:
getResourceGroupComposite in interface ResourceGroupManagerRemote

removeResourcesFromGroup

public void removeResourcesFromGroup(Subject subject,
                                     int groupId,
                                     int[] resourceIds)
Specified by:
removeResourcesFromGroup in interface ResourceGroupManagerRemote

setRecursive

public void setRecursive(Subject subject,
                         int groupId,
                         boolean isRecursive)
Specified by:
setRecursive in interface ResourceGroupManagerRemote

updateResourceGroup

public ResourceGroup updateResourceGroup(Subject subject,
                                         ResourceGroup newResourceGroup)
Specified by:
updateResourceGroup in interface ResourceGroupManagerRemote

findResourceTypesByCriteria

public PageList<ResourceType> findResourceTypesByCriteria(Subject subject,
                                                          ResourceTypeCriteria criteria)
Specified by:
findResourceTypesByCriteria in interface ResourceTypeManagerRemote

getResourceTypeById

public ResourceType getResourceTypeById(Subject subject,
                                        int resourceTypeId)
                                 throws ResourceTypeNotFoundException
Specified by:
getResourceTypeById in interface ResourceTypeManagerRemote
Throws:
ResourceTypeNotFoundException

getResourceTypeByNameAndPlugin

public ResourceType getResourceTypeByNameAndPlugin(Subject subject,
                                                   java.lang.String name,
                                                   java.lang.String plugin)
Specified by:
getResourceTypeByNameAndPlugin in interface ResourceTypeManagerRemote
Returns:
the resource type by name and plugin or null if the type is not found

addResourceGroupsToRole

public void addResourceGroupsToRole(Subject subject,
                                    int roleId,
                                    int[] pendingGroupIds)
Description copied from interface: RoleManagerRemote
Adds the given resource groups to the given role.

Specified by:
addResourceGroupsToRole in interface RoleManagerRemote
Parameters:
subject - The logged in user's subject.

addRolesToResourceGroup

public void addRolesToResourceGroup(Subject subject,
                                    int groupId,
                                    int[] roleIds)
Specified by:
addRolesToResourceGroup in interface RoleManagerRemote

addRolesToSubject

public void addRolesToSubject(Subject subject,
                              int subjectId,
                              int[] roleIds)
Description copied from interface: RoleManagerRemote
Assigns a set of roles to a subject which authorizes the subject to do anything the roles permit.

Specified by:
addRolesToSubject in interface RoleManagerRemote
Parameters:
subject - The logged in user's subject.
subjectId - the subject who is to be authorized with the given roles
roleIds - the roles to assign

addSubjectsToRole

public void addSubjectsToRole(Subject subject,
                              int roleId,
                              int[] subjectIds)
Description copied from interface: RoleManagerRemote
Assigns a set of subjects to a role which authorizes the subjects to do anything the role permits.

Specified by:
addSubjectsToRole in interface RoleManagerRemote
Parameters:
subject - the user attempting to assign the roles to the subject
roleId - the role who will authorized with the given subjects
subjectIds - the subjects to assign the role

findRolesByCriteria

public PageList<Role> findRolesByCriteria(Subject subject,
                                          RoleCriteria criteria)
Specified by:
findRolesByCriteria in interface RoleManagerRemote

findSubjectAssignedRoles

public PageList<Role> findSubjectAssignedRoles(Subject subject,
                                               int subjectId,
                                               PageControl pc)
Description copied from interface: RoleManagerRemote
Get all roles assigned for a certain subject

Specified by:
findSubjectAssignedRoles in interface RoleManagerRemote
Parameters:
subject - The logged in user's subject
subjectId - The subject ID to find the associated roles for
pc - PageControl
Returns:
A page list of assigned

findSubjectUnassignedRoles

public PageList<Role> findSubjectUnassignedRoles(Subject subject,
                                                 int subjectId,
                                                 PageControl pc)
Specified by:
findSubjectUnassignedRoles in interface RoleManagerRemote

getRole

public Role getRole(Subject subject,
                    int roleId)
Description copied from interface: RoleManagerRemote
Returns the role with the given ID

Specified by:
getRole in interface RoleManagerRemote
Returns:
the role or null if it wasn't found

createRole

public Role createRole(Subject subject,
                       Role newRole)
Description copied from interface: RoleManagerRemote
Persists the new role to the database. The subjects assigned to the role are ignored - this only creates the role entity with 0 subjects initially assigned to it.

Specified by:
createRole in interface RoleManagerRemote
Parameters:
subject - The user attempting to create the role
newRole - The new role being created
Returns:
The persisted role with the primary key populated

deleteRoles

public void deleteRoles(Subject subject,
                        java.lang.Integer[] roleIds)
Description copied from interface: RoleManagerRemote
Removes a set of roles from the database. The subjects assigned to the roles are no longer authorized with the deleted roles. Groups attached to the deleted roles are left alone.

Specified by:
deleteRoles in interface RoleManagerRemote
Parameters:
subject - The user attempting to delete the role
roleIds - The IDs of the roles to delete

updateRole

public Role updateRole(Subject subject,
                       Role role)
Description copied from interface: RoleManagerRemote
Updates the given role, excluding the subjects and groups. This updates permissions, name, description, etc.

Specified by:
updateRole in interface RoleManagerRemote
Parameters:
subject - The user updating the role
role - The role being updated
Returns:
The updated role

removeResourceGroupsFromRole

public void removeResourceGroupsFromRole(Subject subject,
                                         int roleId,
                                         int[] groupIds)
Description copied from interface: RoleManagerRemote
Removes the given resource groups from the given role.

Specified by:
removeResourceGroupsFromRole in interface RoleManagerRemote
Parameters:
subject - user attempting to remove the groups from the role

removeRolesFromResourceGroup

public void removeRolesFromResourceGroup(Subject subject,
                                         int groupId,
                                         int[] roleIds)
Specified by:
removeRolesFromResourceGroup in interface RoleManagerRemote

removeRolesFromSubject

public void removeRolesFromSubject(Subject subject,
                                   int subjectId,
                                   int[] roleIds)
Description copied from interface: RoleManagerRemote
Disassociates particular roles from a subject. Once complete, the subject will no longer be authorized with the given roles.

Specified by:
removeRolesFromSubject in interface RoleManagerRemote
Parameters:
subject - The logged in user's subject.
subjectId - the user that is to have the roles unassigned from it
roleIds - list of role IDs that are to be removed from user

removeSubjectsFromRole

public void removeSubjectsFromRole(Subject subject,
                                   int roleId,
                                   int[] subjectIds)
Description copied from interface: RoleManagerRemote
Dissociate particular subjects from a role.

Specified by:
removeSubjectsFromRole in interface RoleManagerRemote
Parameters:
subject - The logged in user's subject.
roleId - The role ID to dissociate the roles from
subjectIds - The IDs of the subjects to remove from the specified Role

changePassword

public void changePassword(Subject subject,
                           java.lang.String username,
                           java.lang.String password)
Description copied from interface: SubjectManagerRemote
Change the password for a user.

Specified by:
changePassword in interface SubjectManagerRemote
Parameters:
subject - The logged in user's subject.
username - The user whose password will be changed
password - The new password for the user

createPrincipal

public void createPrincipal(Subject subject,
                            java.lang.String username,
                            java.lang.String password)
                     throws SubjectException
Description copied from interface: SubjectManagerRemote
Creates a new principal (username and password) in the internal database. The password will be encoded before being stored.

Specified by:
createPrincipal in interface SubjectManagerRemote
Parameters:
subject - The logged in user's subject.
username - The username part of the principal
password - The password part ofthe principal
Throws:
SubjectException

createSubject

public Subject createSubject(Subject subject,
                             Subject subjectToCreate)
                      throws SubjectException
Description copied from interface: SubjectManagerRemote
Create a a new subject. This ignores the roles in subject. The created subject will not be assigned to any roles; use the role manager to assign roles to a subject.

Specified by:
createSubject in interface SubjectManagerRemote
Parameters:
subject - The logged in user's subject.
subjectToCreate - The subject to be created.
Returns:
the newly persisted Subject
Throws:
SubjectException

deleteSubjects

public void deleteSubjects(Subject subject,
                           int[] subjectIds)
Description copied from interface: SubjectManagerRemote
Deletes the given set of users, including both the Subject and Principal objects associated with those users.

Specified by:
deleteSubjects in interface SubjectManagerRemote
Parameters:
subject - The logged in user's subject.
subjectIds - identifies the subject IDs for all the users that are to be deleted

findSubjectsByCriteria

public PageList<Subject> findSubjectsByCriteria(Subject subject,
                                                SubjectCriteria criteria)
Specified by:
findSubjectsByCriteria in interface SubjectManagerRemote

getSubjectByName

public Subject getSubjectByName(java.lang.String username)
Description copied from interface: SubjectManagerRemote
Looks up the existing of a subject by the given username.

Specified by:
getSubjectByName in interface SubjectManagerRemote
Parameters:
username - the name of the subject to look for
Returns:
the subject that was found or null if not found

login

public Subject login(java.lang.String username,
                     java.lang.String password)
              throws LoginException
Description copied from interface: SubjectManagerRemote
Logs a user into the system. This will authenticate the given user with the given password. If the user was already logged in, the current session will be used but the password will still need to be authenticated.

Specified by:
login in interface SubjectManagerRemote
Parameters:
username - The name of the user.
password - The password.
Returns:
The subject of the authenticated user.
Throws:
LoginException - if the login failed for some reason

logout

public void logout(Subject subject)
Description copied from interface: SubjectManagerRemote
Logs out a user.

Specified by:
logout in interface SubjectManagerRemote

updateSubject

public Subject updateSubject(Subject subject,
                             Subject subjectToModify)
Description copied from interface: SubjectManagerRemote
Updates an existing subject with new data. This does not cascade any changes to the roles but it will save the subject's configuration.

Specified by:
updateSubject in interface SubjectManagerRemote
Parameters:
subject - The logged in user's subject.
subjectToModify - the subject whose data is to be updated (which may or may not be the same as user)
Returns:
the merged subject, which may or may not be the same instance of subjectToModify

getSnapshotReport

public java.net.URL getSnapshotReport(Subject subject,
                                      int resourceId,
                                      java.lang.String name,
                                      java.lang.String description)
                               throws java.lang.Exception
Description copied from interface: SupportManagerRemote
Asks that a snapshot report be taken of the given resource. Snapshot reports consist of things like log files, data files and configuration files. What is included in snapshot reports is controlled by the resource's plugin configuration. A snapshot report is compressed as a zip file.

Specified by:
getSnapshotReport in interface SupportManagerRemote
Parameters:
subject - the user requesting the snapshot
resourceId - the resource whose snapshot report is to be taken
name - the name of the snapshot report
description - a description for the caller to use to describe the purpose for taking the snapshot report
Returns:
a URL that the caller can use to obtain the snapshot report
Throws:
java.lang.Exception

getServerVersion

public ServerVersion getServerVersion(Subject subject)
                               throws java.lang.Exception
Description copied from interface: SystemManagerRemote
Provides version information of the server processing the request.

Specified by:
getServerVersion in interface SystemManagerRemote
Returns:
server version information
Throws:
java.lang.Exception

findAssociatedDistributions

public PageList<Distribution> findAssociatedDistributions(Subject subject,
                                                          int repoId,
                                                          PageControl pc)
Description copied from interface: RepoManagerRemote
gets a list of all associated distributions

Specified by:
findAssociatedDistributions in interface RepoManagerRemote
Returns:


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