***  This class provides Binary Compatibility only, not Source Compatibility  ***

com.sas.services.information
Class FactoryAction

com.sas.services.information.FactoryAction
All Implemented Interfaces:
ConsumedResourceInterface, java.io.Serializable, java.lang.Cloneable, java.util.Comparator

public final class FactoryAction
implements java.lang.Cloneable, java.util.Comparator, ConsumedResourceInterface, java.io.Serializable

An Information Service factory's action (type, class name, and optionally method name) and optional filter. This class is intended for use by the com.sas.services.information package, and is likely not useful by external clients.

The syntax of the entry is as follows...

ctor::<fully qualified java class name> service::<fully qualified java class name>::<method name> class::<fully qualified java class name>::<method name>

Since:
1.0
See Also:
Serialized Form

Field Summary
static java.lang.String TYPE_CLASS
          Action type: class.
static java.lang.String TYPE_CONSTRUCTOR
          Action type: constructor.
static java.lang.String TYPE_SERVICE
          Action type: service.
 
Constructor Summary
FactoryAction()
          Constructs a default instance.
FactoryAction(org.w3c.dom.Element element)
          Constructs a factory action by parsing a "Type" XML Element.
FactoryAction(java.lang.String action, java.lang.String filter)
          Constructs an instance for the specified action and filter.
FactoryAction(java.lang.String uid, java.lang.String action, java.lang.String filter)
          Constructs an instance for the specified action and filter.
FactoryAction(java.lang.String actionType, java.lang.String actionClassName, java.lang.String actionMethodName, java.lang.String filter)
          Constructs a factory action based upon its constituent components: action type fully qualified java class name
FactoryAction(java.lang.String uid, java.lang.String actionType, java.lang.String actionClassName, java.lang.String actionMethodName, java.lang.String filter)
          Constructs a factory action based upon its constituent components: action type fully qualified java class name
 
Method Summary
 java.lang.Object clone()
          Clones the resource.
 int compare(java.lang.Object o1, java.lang.Object o2)
          
 boolean equals(java.lang.Object otherAction)
          Determines if the other factory action is equivalent to this factory action.
 java.lang.String getAction()
          Gets an Information Service action string based upon the currently defined type, class, and method.
 java.lang.String getActionClassName()
          Gets the action's class name.
 java.lang.String getActionMethodName()
          Gets the action's method name.
 java.lang.String getActionType()
          Gets the action's type: class constructor method
 java.lang.String getFilter()
           
 java.lang.String getID()
           
 java.lang.String getLocalizedResourceType()
          Gets a localized value describing the resource's type.
 java.lang.String getLocalizedResourceTypeAndValue()
          Gets a localized value describing the resource's type and value.
 java.lang.String getResourceID()
          Gets the id that uniquely identifies the resource within a service's configuration.
 java.lang.String getResourceType()
          Gets a value describing the resource's type.
 int getResourceTypeCode()
          Gets the code describing the resource's type.
 java.lang.String getResourceValue()
          Gets the value for this factory action.
static java.lang.String[][] getValidActionTypes()
          Gets an array of string values representing valid factory action types and an accompanying localized description suitable for use in a choice user interface component.
 int hashCode()
          Gets a hash code based upon this object's attributes.
static boolean isMethodEnabled(java.lang.String type)
          Determines whether or not the action's method is enabled for the specified type of action.
 boolean isRequired()
          Determines if this resource is required by the service's configuration.
static boolean isValidType(java.lang.String type)
          Determines whether or not the specified Information Service factory type is valid.
 void setAction(java.lang.String action)
          Sets the factory's action.
 void setAction(java.lang.String actionType, java.lang.String actionClassName, java.lang.String actionMethodName, java.lang.String actionFilter)
          Sets the action's class name.
 void setActionClassName(java.lang.String actionClassName)
          Sets the factory action's class name.
 void setActionMethodName(java.lang.String actionMethodName)
          Sets the factory action's method name.
 void setActionType(java.lang.String actionType)
           
 void setFilter(java.lang.String filter)
          Sets the factory action's filter.
 void setFilter(java.lang.String filter, boolean isValidating)
          Sets the factory action's filter.
 java.lang.String toString()
          Gets a string representation of this factory action.
 void validate()
          Validates the factory action.
 

Field Detail

TYPE_CLASS

public static final java.lang.String TYPE_CLASS
Action type: class.

See Also:
Constant Field Values

TYPE_CONSTRUCTOR

public static final java.lang.String TYPE_CONSTRUCTOR
Action type: constructor.

See Also:
Constant Field Values

TYPE_SERVICE

public static final java.lang.String TYPE_SERVICE
Action type: service.

See Also:
Constant Field Values
Constructor Detail

FactoryAction

public FactoryAction()
Constructs a default instance.


FactoryAction

public FactoryAction(java.lang.String action,
                     java.lang.String filter)
Constructs an instance for the specified action and filter.

Parameters:
action - Action
filter - Filter

FactoryAction

public FactoryAction(java.lang.String uid,
                     java.lang.String action,
                     java.lang.String filter)
Constructs an instance for the specified action and filter.

Parameters:
uid - Unique identifier or null if an ID should be generated.
action - Action
filter - Filter

FactoryAction

public FactoryAction(java.lang.String actionType,
                     java.lang.String actionClassName,
                     java.lang.String actionMethodName,
                     java.lang.String filter)
Constructs a factory action based upon its constituent components:

FactoryAction

public FactoryAction(org.w3c.dom.Element element)
Constructs a factory action by parsing a "Type" XML Element.

Parameters:
element - XML "Type" Element that represents an Information Service factory action.
Throws:
java.lang.IllegalArgumentException - if an invalid parameter is specified.

FactoryAction

public FactoryAction(java.lang.String uid,
                     java.lang.String actionType,
                     java.lang.String actionClassName,
                     java.lang.String actionMethodName,
                     java.lang.String filter)
Constructs a factory action based upon its constituent components:
Method Detail

getID

public java.lang.String getID()

getAction

public java.lang.String getAction()
Gets an Information Service action string based upon the currently defined type, class, and method.

Returns:
Information Service action.

setAction

public void setAction(java.lang.String action)
Sets the factory's action.

Parameters:
action - Factory's action.

setAction

public void setAction(java.lang.String actionType,
                      java.lang.String actionClassName,
                      java.lang.String actionMethodName,
                      java.lang.String actionFilter)
               throws java.lang.IllegalArgumentException
Sets the action's class name.

Parameters:
actionType - The type of action to take: "ctor", "constructor", "service".
actionClassName - Action's fully qualified java class name.
actionMethodName - If the action is "service", the service method name to invoke.
actionFilter - A filter to test the object against to select the correct action.
Throws:
java.lang.IllegalArgumentException - If the actionType is not valid.

setFilter

public void setFilter(java.lang.String filter)
Sets the factory action's filter. Use this method if the filter is known to be valid.

Parameters:
filter - Factory action's filter.
See Also:
setFilter(String, boolean)

setFilter

public void setFilter(java.lang.String filter,
                      boolean isValidating)
               throws ServiceException
Sets the factory action's filter. Use this method the filter needs to be validated.

Parameters:
filter -
isValidating - true if the filter should be validated or false if the caller knows the filter is valid.
Throws:
ServiceException - if an invalid filter is specified.
See Also:
setFilter(String)

getFilter

public java.lang.String getFilter()

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)

Specified by:
compare in interface java.util.Comparator

getActionType

public java.lang.String getActionType()
Gets the action's type:

Returns:
action's type or null if undefined.

getActionClassName

public java.lang.String getActionClassName()
Gets the action's class name.

Returns:
action's fully qualified java class name or null if undefined.

setActionType

public void setActionType(java.lang.String actionType)
                   throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

setActionClassName

public void setActionClassName(java.lang.String actionClassName)
Sets the factory action's class name.

Parameters:
actionClassName - Fully qualified Java class name.
Throws:
java.lang.IllegalArgumentException - if an invalid class is specified.

validate

public void validate()
              throws java.lang.IllegalArgumentException
Validates the factory action.

Throws:
java.lang.IllegalArgumentException - if the factory action is invalid.

setActionMethodName

public void setActionMethodName(java.lang.String actionMethodName)
                         throws java.lang.IllegalArgumentException
Sets the factory action's method name. A method name is required for some action types including "service" and "class".

Parameters:
actionMethodName - Action's method name.
Throws:
java.lang.IllegalArgumentException - if an invalid action method name is specified.

getActionMethodName

public java.lang.String getActionMethodName()
Gets the action's method name.

Returns:
action's method name or an empty string if one is not defined.

isValidType

public static boolean isValidType(java.lang.String type)
Determines whether or not the specified Information Service factory type is valid.

Parameters:
type - Type of Information Service factory action for which we'd like to determine if its valid or not.
Returns:
true if the type is valid or false if it isn't.

isMethodEnabled

public static boolean isMethodEnabled(java.lang.String type)
Determines whether or not the action's method is enabled for the specified type of action.

Parameters:
type - Action's type
Returns:
true if a method may be specified for the action type or false if not.

equals

public boolean equals(java.lang.Object otherAction)
Determines if the other factory action is equivalent to this factory action.

Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object
Parameters:
otherAction - Another factory action to be compared for equivalency to this object.
Returns:
true if the other factory action is equivalent.

hashCode

public int hashCode()
Gets a hash code based upon this object's attributes.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code.

getValidActionTypes

public static java.lang.String[][] getValidActionTypes()
Gets an array of string values representing valid factory action types and an accompanying localized description suitable for use in a choice user interface component.

Returns:
Valid factory action types.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the resource.

Specified by:
clone in interface ConsumedResourceInterface
Overrides:
clone in class java.lang.Object
Returns:
Clone of this resource.
Throws:
java.lang.CloneNotSupportedException

getResourceID

public java.lang.String getResourceID()
Description copied from interface: ConsumedResourceInterface
Gets the id that uniquely identifies the resource within a service's configuration.

Specified by:
getResourceID in interface ConsumedResourceInterface
Returns:
Resource's ID.

getResourceValue

public java.lang.String getResourceValue()
Gets the value for this factory action.

The syntax of the entry is:

If a filter is defined, it will suffix the preceding values.

Specified by:
getResourceValue in interface ConsumedResourceInterface
Returns:
Service configuration resource's value.

getLocalizedResourceType

public java.lang.String getLocalizedResourceType()
Description copied from interface: ConsumedResourceInterface
Gets a localized value describing the resource's type.

Specified by:
getLocalizedResourceType in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be localized values for "Context", "Output", and "Renderer".

getLocalizedResourceTypeAndValue

public java.lang.String getLocalizedResourceTypeAndValue()
Description copied from interface: ConsumedResourceInterface
Gets a localized value describing the resource's type and value.

Specified by:
getLocalizedResourceTypeAndValue in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be localized values for
  • "Context : com.sas.services"
  • "Output : A1"
  • "Renderer: com.sas.MyRenderer"

getResourceType

public java.lang.String getResourceType()
Description copied from interface: ConsumedResourceInterface
Gets a value describing the resource's type.

Specified by:
getResourceType in interface ConsumedResourceInterface
Returns:
Resource's type. For example, a Logging Service configuration's resource types would be "Context", "Output", and "Renderer".

getResourceTypeCode

public int getResourceTypeCode()
Description copied from interface: ConsumedResourceInterface
Gets the code describing the resource's type.

Specified by:
getResourceTypeCode in interface ConsumedResourceInterface
Returns:
Resource's type code.

isRequired

public boolean isRequired()
Description copied from interface: ConsumedResourceInterface
Determines if this resource is required by the service's configuration.

Specified by:
isRequired in interface ConsumedResourceInterface
Returns:
true if this resource is required by the service's configuration.

toString

public java.lang.String toString()
Gets a string representation of this factory action. The following values are summarized.

Overrides:
toString in class java.lang.Object

***  This class provides Binary Compatibility only, not Source Compatibility  ***




Copyright © 2009 SAS Institute Inc. All Rights Reserved.