org.rhq.enterprise.server.perspective
Class PerspectiveManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.perspective.PerspectiveManagerBean
All Implemented Interfaces:
PerspectiveManagerLocal

public class PerspectiveManagerBean
extends Object
implements PerspectiveManagerLocal


Constructor Summary
PerspectiveManagerBean()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerspectiveManagerBean

public PerspectiveManagerBean()
Method Detail

getMenu

public List<MenuItem> getMenu(org.rhq.core.domain.auth.Subject subject)
                       throws PerspectiveException
Description copied from interface: PerspectiveManagerLocal
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.

Specified by:
getMenu in interface PerspectiveManagerLocal
Returns:
Throws:
PerspectiveException

getResourceTabs

@NotNull
public List<Tab> getResourceTabs(org.rhq.core.domain.auth.Subject subject,
                                         org.rhq.core.domain.resource.Resource resource)
Description copied from interface: PerspectiveManagerLocal
Returns the list of tabs that should be displayed for the specified user for the specified Resource.

Specified by:
getResourceTabs in interface PerspectiveManagerLocal
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

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

Specified by:
getPageLink in interface PerspectiveManagerLocal
Parameters:
subject - a user
Returns:
the page link extenstion's url. defaultValue if not found

getUrlViaKey

public 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.

Specified by:
getUrlViaKey in interface PerspectiveManagerLocal
Parameters:
key, - a valid key
Returns:
the target url
Throws:
PerspectiveException

getMenuItemUrl

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

Specified by:
getMenuItemUrl in interface PerspectiveManagerLocal
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

getResourceTabUrl

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

Specified by:
getResourceTabUrl in interface PerspectiveManagerLocal
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

getRootUrl

public String getRootUrl(org.rhq.core.domain.auth.Subject subject,
                         boolean makeExplicit,
                         boolean makeSecure)
Description copied from interface: PerspectiveManagerLocal
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.

Specified by:
getRootUrl in interface PerspectiveManagerLocal
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/"

getTargetUrl

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

Specified by:
getTargetUrl in interface PerspectiveManagerLocal
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

public Map<Integer,String> getTargetUrls(org.rhq.core.domain.auth.Subject subject,
                                         PerspectiveTarget target,
                                         int[] targetIds,
                                         boolean makeExplicit,
                                         boolean makeSecure)
Description copied from interface: PerspectiveManagerLocal
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.

Specified by:
getTargetUrls in interface PerspectiveManagerLocal
target - The target of the navigation link. for example, a role.
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

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

Specified by:
getResourceTargetUrl in interface PerspectiveManagerLocal
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

public Map<Integer,String> getResourceTargetUrls(org.rhq.core.domain.auth.Subject subject,
                                                 int resourceId,
                                                 PerspectiveTarget target,
                                                 int[] targetIds,
                                                 boolean makeExplicit,
                                                 boolean makeSecure)
Description copied from interface: PerspectiveManagerLocal
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.

Specified by:
getResourceTargetUrls in interface PerspectiveManagerLocal
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.
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

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

Specified by:
getTemplateTargetUrl in interface PerspectiveManagerLocal
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.