org.rhq.enterprise.server.perspective
Enum PerspectiveTarget

java.lang.Object
  extended by java.lang.Enum<PerspectiveTarget>
      extended by org.rhq.enterprise.server.perspective.PerspectiveTarget
All Implemented Interfaces:
Serializable, Comparable<PerspectiveTarget>

public enum PerspectiveTarget
extends Enum<PerspectiveTarget>

Author:
jshaughnessy

Enum Constant Summary
AGENT
           
ALERT
           
ALERT_DEFINITION
           
ALERT_TEMPLATE
           
CONTENT_PROVIDER
           
GROUP_COMPATIBLE
           
GROUP_DEFINITION
           
GROUP_MIXED
           
METRIC_TEMPLATE
           
REPO
           
RESOURCE
           
ROLE
           
SERVER
           
USER
           
 
Method Summary
 String getResourceTargetUrl(int resourceId, int targetId)
           
 String getTargetUrl(int targetId)
           
 String getTemplateTargetUrl(int resourceTypeId, int targetId)
           
 boolean isResourceTarget()
           
 boolean isTemplateTarget()
           
static PerspectiveTarget valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PerspectiveTarget[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AGENT

public static final PerspectiveTarget AGENT

ALERT

public static final PerspectiveTarget ALERT

ALERT_DEFINITION

public static final PerspectiveTarget ALERT_DEFINITION

ALERT_TEMPLATE

public static final PerspectiveTarget ALERT_TEMPLATE

CONTENT_PROVIDER

public static final PerspectiveTarget CONTENT_PROVIDER

GROUP_COMPATIBLE

public static final PerspectiveTarget GROUP_COMPATIBLE

GROUP_DEFINITION

public static final PerspectiveTarget GROUP_DEFINITION

GROUP_MIXED

public static final PerspectiveTarget GROUP_MIXED

METRIC_TEMPLATE

public static final PerspectiveTarget METRIC_TEMPLATE

REPO

public static final PerspectiveTarget REPO

RESOURCE

public static final PerspectiveTarget RESOURCE

ROLE

public static final PerspectiveTarget ROLE

SERVER

public static final PerspectiveTarget SERVER

USER

public static final PerspectiveTarget USER
Method Detail

values

public static PerspectiveTarget[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PerspectiveTarget c : PerspectiveTarget.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PerspectiveTarget valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getTargetUrl

public String getTargetUrl(int targetId)
Parameters:
targetId - The target id. For example, the group id.
Returns:
The url path for the target.
Throws:
IllegalArgumentException - If the PerspectiveTarget is resource qualified (requires a resource id).

getResourceTargetUrl

public String getResourceTargetUrl(int resourceId,
                                   int targetId)
Parameters:
resourceId - The target's resource. For example, the resource on which the alert fired.
targetId - The resource target. For example, the alert for the specified resource.
Returns:
The url path for the resource qualified target.
Throws:
IllegalArgumentException - If the PerspectiveTarget is not resource qualified.

getTemplateTargetUrl

public String getTemplateTargetUrl(int resourceTypeId,
                                   int targetId)
Parameters:
resourceTypeId - The target's resource type. For example, the resource type for the alert template.
targetId - The target. For example, the alert definition for the alert template.
Returns:
The url path for the template target.
Throws:
IllegalArgumentException - If the PerspectiveTarget is not a template target.

isResourceTarget

public boolean isResourceTarget()

isTemplateTarget

public boolean isTemplateTarget()


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