com.tivoli.pd.jadmin
Class PDAction

java.lang.Object
  extended by com.tivoli.pd.jutil.PDEnvironmentObject
      extended by com.tivoli.pd.jadmin.PDAction
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PDAction
extends com.tivoli.pd.jutil.PDEnvironmentObject
implements java.lang.Cloneable

Security Access Manager Action (Permission) class.

An action represents a given permission. The actual permission represented is determined by the end user. For example, an action might represent permission to read a given file resource. Each action belongs to an action group. Each action is uniquely identified by the single letter identifier given to it and the action group to which it belongs.

Security Access Manager by default contains a primary action group and several actions in this group. For details on the actions in the primary action group, please refer to the Base Administrator's Guide. It is possible to customize the default set using the methods in the PDAction class to add new actions. Actions that exist by default in the primary action group cannot be deleted. Within a given action group, the type of an action can be used to further categorize actions.

Modes: Local,Remote

See Also:
Serialized Form

Constructor Summary
PDAction(PDContext context, java.lang.String id, java.lang.String actionGroupId, PDMessages messages)
          Constructs a local object of an action that already exists in the policy server.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
static void createAction(PDContext context, java.lang.String id, java.lang.String description, java.lang.String type, java.lang.String actionGroupId, PDMessages messages)
          Creates an action in the policy server.
static void deleteAction(PDContext context, java.lang.String id, java.lang.String actionGroupId, PDMessages messages)
          Deletes the specified action in the policy server.
 boolean equals(java.lang.Object obj)
          Determines whether this PDAction is equivalent to the input object.
 java.lang.String getDescription()
          Gets the action description from this object.
 java.lang.String getId()
          Gets the name from this Action object.
 java.lang.String getType()
          Gets the type from this Action object.
static java.util.ArrayList listActions(PDContext context, java.lang.String actionGroupId, PDMessages messages)
          Returns a list of names of all actions in a specific action group that exists in the policy server.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class com.tivoli.pd.jutil.PDEnvironmentObject
getContext, setContext
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDAction

public PDAction(PDContext context,
                java.lang.String id,
                java.lang.String actionGroupId,
                PDMessages messages)
         throws PDException
Constructs a local object of an action that already exists in the policy server. Throws an exception if the action does not exist.

This method implements the function provided by the ivadmin_action_list() and the ivadmin_action_list_in_group() C APIs, both of which return ivadmin_action objects.

Parameters:
context - the context for communicating with the policy server. Cannot be null.
id - name of the action to be constructed. Cannot be null.
actionGroupId - the action group that the action belongs to. Use PDActionGroup.PDACTIONGROUP_PRIMARY_NAME for the primary action group. Cannot be null.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output. Cannot be null.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.
Method Detail

getId

public java.lang.String getId()
                       throws PDException
Gets the name from this Action object.

This method implements the function provided by the ivadmin_action_getid() C API.

Returns:
name of the action from this object.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

getDescription

public java.lang.String getDescription()
                                throws PDException
Gets the action description from this object.

This method implements the function provided by the ivadmin_action_getdescription() C API.

Returns:
description for the action from this object. Cannot be null. Returns an empty string if no description was set prior to this call.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

getType

public java.lang.String getType()
                         throws PDException
Gets the type from this Action object.

This method implements the function provided by the ivadmin_action_gettype() C API.

Returns:
type of the action from this object.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Returns a copy of this object.

Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Determines whether this PDAction is equivalent to the input object.

Overrides:
equals in class java.lang.Object

createAction

public static void createAction(PDContext context,
                                java.lang.String id,
                                java.lang.String description,
                                java.lang.String type,
                                java.lang.String actionGroupId,
                                PDMessages messages)
                         throws PDException
Creates an action in the policy server.

This method is equivalent to the ivadmin_action_create() and the ivadmin_action_create_in_group() C APIs.

Parameters:
context - the context for communicating with the policy server. Cannot be null.
id - single letter code that represents the new action. It cannot conflict with existing action codes in the same Action Group. Cannot be null.
description - description of the action to be created. If null, an empty string is used.
type - type of the action to be created. This can be any String, and is typically used to categorize an action in some way meaningful to an application using the action. Cannot be null.
actionGroupId - the action group in which to create the action. Specify PDActionGroup.PDACTIONGROUP_PRIMARY_NAME to create as part of the primary action group.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output. Cannot be null.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

listActions

public static java.util.ArrayList listActions(PDContext context,
                                              java.lang.String actionGroupId,
                                              PDMessages messages)
                                       throws PDException
Returns a list of names of all actions in a specific action group that exists in the policy server.

This method is equivalent to the ivadmin_action_list() and the ivadmin_action_list_in_group() C APIs.

Parameters:
context - the context for communicating with the policy server. Cannot be null.
actionGroupId - the action group whose actions need to be returned in the ArrayList return value. If the value is PDActionGroup.PDACTIONGROUP_PRIMARY_NAME, then the actions that belong to the primary action group are returned.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output. Cannot be null.
Returns:
an ArrayList of String objects that are the names of all actions that are in the specified action group. Cannot be null. In the case of the primary action group, the return ArrayList cannot be empty because it will contain at least the actions that are created by default by Security Access Manager. In the case of the non-primary action group, it can be empty.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

deleteAction

public static void deleteAction(PDContext context,
                                java.lang.String id,
                                java.lang.String actionGroupId,
                                PDMessages messages)
                         throws PDException
Deletes the specified action in the policy server.

This method is equivalent to the ivadmin_action_delete() and the ivadmin_action_delete_from_group() C APIs.

Parameters:
context - the context for communicating with the policy server. Cannot be null.
id - name of the action to be deleted. Cannot be null.
actionGroupId - name of the action group from which the action needs to be deleted. If the value is PDActionGroup.PDACTIONGROUP_PRIMARY_NAME, then the primary action group is used. Cannot be null.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output. Cannot be null.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.