/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentUIManagerLocal.java

https://github.com/ccrouch/rhq · Java · 268 lines · 56 code · 29 blank · 183 comment · 0 complexity · 36b1234bc39e46f1fa9f48f11af884e9 MD5 · raw file

  1. /*
  2. * RHQ Management Platform
  3. * Copyright (C) 2005-2008 Red Hat, Inc.
  4. * All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation version 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. package org.rhq.enterprise.server.content;
  20. import java.util.List;
  21. import javax.ejb.Local;
  22. import org.rhq.core.domain.auth.Subject;
  23. import org.rhq.core.domain.common.composite.IntegerOptionItem;
  24. import org.rhq.core.domain.content.ContentRequestStatus;
  25. import org.rhq.core.domain.content.ContentServiceRequest;
  26. import org.rhq.core.domain.content.InstalledPackage;
  27. import org.rhq.core.domain.content.InstalledPackageHistory;
  28. import org.rhq.core.domain.content.PackageInstallationStep;
  29. import org.rhq.core.domain.content.PackageType;
  30. import org.rhq.core.domain.content.PackageVersion;
  31. import org.rhq.core.domain.content.composite.AdvisoryDetailsComposite;
  32. import org.rhq.core.domain.content.composite.LoadedPackageBitsComposite;
  33. import org.rhq.core.domain.content.composite.PackageListItemComposite;
  34. import org.rhq.core.domain.content.composite.PackageVersionComposite;
  35. import org.rhq.core.domain.criteria.InstalledPackageHistoryCriteria;
  36. import org.rhq.core.domain.util.PageControl;
  37. import org.rhq.core.domain.util.PageList;
  38. /**
  39. * EJB interface for operations that support the UI for the content subsystem.
  40. *
  41. * @author Jason Dobies
  42. */
  43. @Local
  44. public interface ContentUIManagerLocal {
  45. /**
  46. * This will return a composite object that tells you if the actual content (the "bits") for a particular package
  47. * version is loaded into inventory or not, and, if the content is loaded, whether or not that content is stored in
  48. * the database.
  49. *
  50. * @param packageVersionId the {@link org.rhq.core.domain.content.PackageVersion} identifier
  51. * @return indicates if the package version content is loaded and available
  52. * @see org.rhq.core.domain.content.composite.LoadedPackageBitsComposite
  53. */
  54. LoadedPackageBitsComposite getLoadedPackageBitsComposite(int packageVersionId);
  55. /**
  56. * Loads the installed package identified by the ID from the database.
  57. *
  58. * @param id identifies the installed package
  59. * @return installed package if one exists; <code>null</code> otherwise
  60. */
  61. InstalledPackage getInstalledPackage(int id);
  62. List<IntegerOptionItem> getInstalledPackageTypes(Subject user, int resourceId);
  63. /**
  64. * Loads the package type identified by the ID from the database.
  65. *
  66. * @param id package type to load
  67. * @return package type if one exists for the ID; <code>null</code> otherwise
  68. */
  69. PackageType getPackageType(int id);
  70. /**
  71. * @return all package types
  72. */
  73. List<PackageType> getPackageTypes();
  74. /**
  75. * Returns all package types that are available to the specified resource type.
  76. *
  77. * @param resourceTypeId identifies the resource type
  78. * @return set of package types
  79. */
  80. List<PackageType> getPackageTypes(int resourceTypeId);
  81. /**
  82. * Returns all package types that are available to the specified resource type in a page control.
  83. *
  84. * @param resourceTypeId identifies the resource type
  85. * @param pageControl paging control
  86. * @return pagable list of package types
  87. */
  88. PageList<PackageType> getPackageTypes(int resourceTypeId, PageControl pageControl);
  89. /**
  90. * Returns a list of all content requests made against the specified resource that match the specified status.
  91. *
  92. * @param user the user who is requesting the retrieval
  93. * @param resourceId identifies the resource whose requests to retrieve
  94. * @param status request status being matched
  95. * @param pageControl pagination controller
  96. * @return list of artifact requests for the specified resource
  97. */
  98. PageList<ContentServiceRequest> getContentRequestsWithStatus(Subject user, int resourceId,
  99. ContentRequestStatus status, PageControl pageControl);
  100. /**
  101. * Returns a list of all content requests made against the specified resource that do not match the specified
  102. * status.
  103. *
  104. * @param user the user who is requesting the retrieval
  105. * @param resourceId identifies the resource whose requests to retrieve
  106. * @param status request status to not match
  107. * @param pageControl pagination controller
  108. * @return list of content requests for the specified resource
  109. */
  110. PageList<ContentServiceRequest> getContentRequestsWithNotStatus(Subject user, int resourceId,
  111. ContentRequestStatus status, PageControl pageControl);
  112. /**
  113. * Returns a list of all installed packages on the specified resource.
  114. *
  115. * @param user the user who is requesting the retrieval
  116. * @param resourceId identifies the resource whose requests to retrieve
  117. * @param search string to search against filtering by name or description
  118. * @param pageControl pagination controller
  119. * @return pagable list of packages installed on the resource
  120. */
  121. PageList<PackageListItemComposite> getInstalledPackages(Subject user, int resourceId, Integer packageTypeFilterId,
  122. String packageVersionFilter, String search, PageControl pageControl);
  123. PageList<InstalledPackageHistory> getInstalledPackageHistory(Subject subject, int resourceId, int generalPackageId,
  124. PageControl pc);
  125. PageList<PackageVersionComposite> getPackageVersionCompositesByFilter(Subject user, int resourceId, String filter,
  126. PageControl pc);
  127. PageList<PackageVersionComposite> getUpdatePackageVersionCompositesByFilter(Subject user, int resourceId,
  128. String filter, PageControl pc);
  129. /**
  130. * Used to retrieve information about a package version to display to a user.
  131. *
  132. * @param user user who wants to see the information
  133. * @param packageVersionId identifies what package version to return info on
  134. *
  135. * @return the information on the package version
  136. */
  137. PackageVersionComposite loadPackageVersionComposite(Subject user, int packageVersionId);
  138. /**
  139. * Used to retrieve information about a package version to display to a user. This call will also load the
  140. * extra properties configuration object on the package version.
  141. *
  142. * @param user user who wants to see the information
  143. * @param packageVersionId identifies what package version to return info on
  144. *
  145. * @return the information on the package version
  146. */
  147. PackageVersionComposite loadPackageVersionCompositeWithExtraProperties(Subject user, int packageVersionId);
  148. /**
  149. * Used to retrieve information about multiple packages to display to the user.
  150. *
  151. * @param user user who wants to see the information
  152. * @param packageVersionIds identifies what package versions to return info on
  153. *
  154. * @return package version information for each package identified
  155. */
  156. List<PackageVersionComposite> getPackageVersionComposites(Subject user, int[] packageVersionIds);
  157. /**
  158. * Used to retrieve information about multiple packages to display to the user.
  159. *
  160. * @param user user who wants to see the information
  161. * @param packageVersionIds identifies what package versions to return info on
  162. * @param pageControl pagination controller
  163. *
  164. * @return package version information for each package identified
  165. */
  166. PageList<PackageVersionComposite> getPackageVersionComposites(Subject user, int[] packageVersionIds,
  167. PageControl pageControl);
  168. /**
  169. * Retrieves a package version by its ID. One and only one package version must exist for the ID; an error
  170. * will be thrown if exactly one package version is not found.
  171. *
  172. * @param packageVersionId identifies the package version
  173. * @return package version entity
  174. */
  175. PackageVersion getPackageVersion(int packageVersionId);
  176. /**
  177. * Retrieves a content request by its ID. One and only one content request must exist for the ID; an error
  178. * will be thrown if exactly one content request is not found.
  179. *
  180. * @param requestId identifies the request
  181. * @return content request entity
  182. */
  183. ContentServiceRequest getContentServiceRequest(int requestId);
  184. /**
  185. * Returns a list of installed package history entries that were created as a result of executing the indicated
  186. * request.
  187. *
  188. * @param contentServiceRequestId identifies the request that caused the history entries
  189. * @param pc pagination controller
  190. * @return list of history entries
  191. */
  192. PageList<InstalledPackageHistory> getInstalledPackageHistory(int contentServiceRequestId, PageControl pc);
  193. /**
  194. * Retrieves a specific history entry by its ID. One and only one history entry must exist for the ID; an error
  195. * will be thrown if exactly one history entry is not found.
  196. *
  197. * @param historyId identifies the history entry
  198. * @return history entry
  199. */
  200. InstalledPackageHistory getInstalledPackageHistory(int historyId);
  201. /**
  202. * Retrieves the individual steps executed during the specified package installation history.
  203. *
  204. * @param installedPackageHistoryId identifies the history entry
  205. * @return list of steps; empty list if there were no steps reported
  206. */
  207. List<PackageInstallationStep> getPackageInstallationSteps(int installedPackageHistoryId);
  208. /**
  209. * Retrieves a specific step entry by its ID.
  210. *
  211. * @param stepId identifies the step to retrieve
  212. * @return step entry
  213. */
  214. PackageInstallationStep getPackageInstallationStep(int stepId);
  215. /**
  216. * Returns a pagable list of all package events that have taken place on the given resource.
  217. *
  218. * @param resourceId must refer to a valid resource in the database
  219. * @param pc pagination controller
  220. * @return pagable list of package change items; will not be <code>null</code>
  221. */
  222. PageList<InstalledPackageHistory> getInstalledPackageHistoryForResource(int resourceId, PageControl pc);
  223. /**
  224. * Returns a pagable list of all package events that have taken place on the given resource.
  225. *
  226. * @param resourceId must refer to a valid resource in the database
  227. * @param pc pagination controller
  228. * @return pagable list of package change items; will not be <code>null</code>
  229. */
  230. PageList<InstalledPackageHistory> findInstalledPackageHistoryByCriteria(Subject subject,
  231. InstalledPackageHistoryCriteria criteria);
  232. /**
  233. * Retrieves Advisory Details by its ID. One and only one must exist for the ID;
  234. * @param user user who wants to see the information
  235. * @param id identifier for advisory
  236. * @return AdvisoryDetailsComposite entity
  237. */
  238. AdvisoryDetailsComposite loadAdvisoryDetailsComposite(Subject user, Integer id);
  239. }