org.rhq.enterprise.server.perspective
Interface PerspectiveManagerLocal

All Known Implementing Classes:
PerspectiveManagerBean

public interface PerspectiveManagerLocal


Method Summary
 List<MenuItem> getMenu(org.rhq.core.domain.auth.Subject subject)
          Return the core menu for the specified subject.
 String getMenuItemUrl(org.rhq.core.domain.auth.Subject subject, String menuItemName, boolean makeExplicit, boolean makeSecure)
          This method does not ensure the specified subject can actually access the requested url.
 String getPageLink(org.rhq.core.domain.auth.Subject subject, String pageName, String linkName, String defaultValue)
          Return the url for the given page and name, if one is defined.
 List<Tab> getResourceTabs(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.resource.Resource resource)
          Returns the list of tabs that should be displayed for the specified user for the specified Resource.
 String getResourceTabUrl(org.rhq.core.domain.auth.Subject subject, String tabName, int resourceId, boolean makeExplicit, boolean makeSecure)
          This method does not ensure the specified subject can actually access the requested url.
 String getResourceTargetUrl(org.rhq.core.domain.auth.Subject subject, int resourceId, PerspectiveTarget target, int targetId, boolean makeExplicit, boolean makeSecure)
          This method does not ensure the specified subject can actually access the requested url.
 Map<Integer,String> getResourceTargetUrls(org.rhq.core.domain.auth.Subject subject, int resourceId, PerspectiveTarget target, int[] targetIds, boolean makeExplicit, boolean makeSecure)
          When requesting the same target url for several resource targets this is a more efficient call than calling getResourceTargetUrl() repeatedly.
 String getRootUrl(org.rhq.core.domain.auth.Subject subject, boolean makeExplicit, boolean makeSecure)
          Get the CoreUI context root.
 String getTargetUrl(org.rhq.core.domain.auth.Subject subject, PerspectiveTarget target, int targetId, boolean makeExplicit, boolean makeSecure)
          This method does not ensure the specified subject can actually access the requested url.
 Map<Integer,String> getTargetUrls(org.rhq.core.domain.auth.Subject subject, PerspectiveTarget target, int[] targetIds, boolean makeExplicit, boolean makeSecure)
          When requesting the same target url for several targets this is a more efficient call than calling getTargetUrl() repeatedly.
 String getTemplateTargetUrl(org.rhq.core.domain.auth.Subject subject, int resourceId, PerspectiveTarget target, int targetId, boolean makeExplicit, boolean makeSecure)
          This method does not ensure the specified subject can actually access the requested url.
 String getUrlViaKey(int key)
          Given a targetUrlKey parameter value, as set in the extension, resolve that key into the targetUrl for the extension's content.
 

Method Detail

getMenu

List<MenuItem> getMenu(org.rhq.core.domain.auth.Subject subject)
                       throws PerspectiveException
Return the core menu for the specified subject. Depending on their inventory and roles the core menu for one subject1 could differ from that of subject2. Subsequent calls will return the same core menu for the same Subject. In other words, it does not change during a user session.

Parameters:
subject -
Returns:
Throws:
PerspectiveException

getResourceTabs

List<Tab> getResourceTabs(org.rhq.core.domain.auth.Subject subject,
                          org.rhq.core.domain.resource.Resource resource)
Returns the list of tabs that should be displayed for the specified user for the specified Resource.

Parameters:
subject - a user
resource - an inventoried Resource
Returns:
the list of tabs that should be displayed for the specified user for the specified Resource

getPageLink

String getPageLink(org.rhq.core.domain.auth.Subject subject,
                   String pageName,
                   String linkName,
                   String defaultValue)
Return the url for the given page and name, if one is defined.

Parameters:
subject - a user
pageName, - a valid page extension point
linkName, - the link that should be replaced
defaultValue, - if no perspective link is defined for the pageName+linkName, the value to return
Returns:
the page link extenstion's url. defaultValue if not found

getUrlViaKey

String getUrlViaKey(int key)
                    throws PerspectiveException
Given a targetUrlKey parameter value, as set in the extension, resolve that key into the targetUrl for the extension's content.

Parameters:
key, - a valid key
Returns:
the target url
Throws:
PerspectiveException

getRootUrl

String getRootUrl(org.rhq.core.domain.auth.Subject subject,
                  boolean makeExplicit,
                  boolean makeSecure)
Get the CoreUI context root. This can be used to assemble a url not otherwise obtainable via the API. This should be used with care as hardcoded paths may break in future releases of the core UI.

Parameters:
subject -
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
the Core GUI root url in the format "protocol://host:port/"

getMenuItemUrl

String getMenuItemUrl(org.rhq.core.domain.auth.Subject subject,
                      String menuItemName,
                      boolean makeExplicit,
                      boolean makeSecure)
This method does not ensure the specified subject can actually access the requested url.

Parameters:
subject -
menuItemName - The name of the menuItem extension point
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
The url for specified extension point. May return null if the extension does not specify a url
Throws:
IllegalArgumentException - if the extension point does not exist.

getResourceTabUrl

String getResourceTabUrl(org.rhq.core.domain.auth.Subject subject,
                         String tabName,
                         int resourceId,
                         boolean makeExplicit,
                         boolean makeSecure)
This method does not ensure the specified subject can actually access the requested url.

Parameters:
subject -
tabName - The name of the resource tab extension point
resourceId - The resource id to be incorporated into the url. This method does not check the validity of the resourceId.
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
The url for specified extension point. May return null if the extension does not specify a url
Throws:
IllegalArgumentException - if the extension point does not exist.

getTargetUrl

String getTargetUrl(org.rhq.core.domain.auth.Subject subject,
                    PerspectiveTarget target,
                    int targetId,
                    boolean makeExplicit,
                    boolean makeSecure)
This method does not ensure the specified subject can actually access the requested url.

Parameters:
subject -
target - The target of the navigation link. for example, a role.
targetId - The id of the specified target. for example, a roleId
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
The url for specified target.

getTargetUrls

Map<Integer,String> getTargetUrls(org.rhq.core.domain.auth.Subject subject,
                                  PerspectiveTarget target,
                                  int[] targetIds,
                                  boolean makeExplicit,
                                  boolean makeSecure)
When requesting the same target url for several targets this is a more efficient call than calling getTargetUrl() repeatedly. For example, if generating links to a list of resources. This method does not ensure the specified subject can actually access the requested urls.

Parameters:
subject -
target - The target of the navigation link. for example, a role.
targetId - The id of the specified target. for example, a roleId
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
A Map of targetId to url mappings.

getResourceTargetUrl

String getResourceTargetUrl(org.rhq.core.domain.auth.Subject subject,
                            int resourceId,
                            PerspectiveTarget target,
                            int targetId,
                            boolean makeExplicit,
                            boolean makeSecure)
This method does not ensure the specified subject can actually access the requested url.

Parameters:
subject -
resourceId - The resource id of the specified target. for example, the resource on which an alert is exists
target - The target of the navigation link. for example, an alert.
targetId - The id of the specified target. for example, an alertId
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
The url for specified target.

getResourceTargetUrls

Map<Integer,String> getResourceTargetUrls(org.rhq.core.domain.auth.Subject subject,
                                          int resourceId,
                                          PerspectiveTarget target,
                                          int[] targetIds,
                                          boolean makeExplicit,
                                          boolean makeSecure)
When requesting the same target url for several resource targets this is a more efficient call than calling getResourceTargetUrl() repeatedly. For example, if generating links to a list of a resource's alerts. Same This method does not ensure the specified subject can actually access the requested urls.

Parameters:
subject -
resourceId - The resource id of the specified target. for example, the resource on which an alert is exists
target - The target of the navigation link. for example, an alert.
targetId - The id of the specified target. for example, an alertId
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
A Map of targetId to url mappings.

getTemplateTargetUrl

String getTemplateTargetUrl(org.rhq.core.domain.auth.Subject subject,
                            int resourceId,
                            PerspectiveTarget target,
                            int targetId,
                            boolean makeExplicit,
                            boolean makeSecure)
This method does not ensure the specified subject can actually access the requested url.

Parameters:
subject -
resourceTypeId - The resourceType id of the specified target. for example, the type for an alert template
target - The target of the navigation link. for example, an alert template
targetId - The id of the specified target. for example, an alert template definition Id
makeExplicit - If true ensure "protocol://host:port" prefix. Set true for remotely deployed perspectives.
makeSecure - If true use the secure protocol and port. Ignored if makeExplicit=false or not supported.
Returns:
The url for specified target.


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