Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.autonomy.aci
Class AciAction

    java.lang.Object
      com.autonomy.aci.AciAction

public class AciAction
extends java.lang.Object

The `AciAction` encapsulates the "action" to send to an ACI server and all its required parameters.

Say you want to find out all the user details stored in IDOL about the user 'Adam' including which roles he belongs to. Using a browser this would mean sending "action=UserRead&Username=Adam&RoleList=true" to the Nore partition's ACI port. The equivalent `AciAction` object can be constructed using:

        AciAction userRead = new AciAction(NoreConstants.USER_READ_ACTION);
        userRead.setParameter(new ActionParameter(NoreConstants.USER_NAME_PARAM_NAME, "Adam"));
        userRead.setParameter(new ActionParameter(NoreConstants.USER_ROLELIST_PARAM_NAME, true));

Actions are usually sent to the ACI server as 'GET' HTTP request but this can be change to 'POST' using:

        userRead.usePostHTTPMethod();

The action is sent to the ACI server using:

        AciConnection aciServer = ...;
        ....
        AciResponse response = aciServer.aciActionExecute(userRead);

If information about the access a user has to documents from a particular repository is needed (for example when retrieving results for a user who does not have a user entry define in IDOL), this should be set on the action via a `SecurityType` object:

        SecurityType notesSecurityInfo = new SecurityType("notes");
        notesSecurityInfo.setSecurityFieldValue("group", "myNotesGroup");
        notesSecurityInfo.setSecurityFieldValue("username", "myNotesUsername");

        AciAction query = new AciAction(SuirConstants.QUERY_ACTION);
        ....
        query.addUserSecurityInfo(notesSecurityInfo);

A user security string is then generated when the action is executed and sent as the value of an extra "SecurityInfo" parameter.

See Also:
  `SecurityType`, `ActionParameter`

Constructor Summary
`AciAction()` Instantiate an empty `AciAction` object.
`AciAction(java.lang.String sAction)` Instantiate an `AciAction` object and set an "action" command.

Method Summary
`void` | `addUserSecurityInfo(SecurityType securityInfo)` Set the user security information for all a document repository.
`java.lang.String` | `getAction()` Returns the "action" command that this object represents.
`java.lang.String` | `getHTTPMethod()` Gives the HTTP method that this action is set to use.
`java.util.ArrayList` | `getParameters()` Gives access to the action parameter `ArrayList`.
`void` | `setAction(java.lang.String sAction)` Set the "action" command.
`void` | `setParameter(ActionParameter actionParameter)` Set a parameter that will be sent along with the action command.
`void` | `setParameters(java.util.ArrayList alActionParameters)` Set a group of parameters that will be sent along with the action command.
`void` | `setUserSecurityInfo(java.util.ArrayList alSecurityTypes)` Set the user security information for all the repositories that the are relevent to this action.
`java.lang.String` | `toHTMLString()` Returns the action in the format "/action=<action>¶meter0=value0¶meter1=value1"
`java.lang.String` | `toString()` Returns the action in the format "/action=<action>¶meter0=value0¶meter1=value1...".
`java.lang.String` | `toString(java.lang.String sCharEncoding)` Returns the action in the format "/action=<action>¶meter0=value0¶meter1=value1..." with the parameter names and values URLEncoded using the character encoding given.
`void` | `usePostHTTPMethod()` Change the HTTP method used when sending this action from 'GET' (the default) to 'POST'.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AciAction

    public AciAction()

  Instantiate an empty `AciAction` object. An "action" command and any assosciated parameters must be set on this object before it is sent to a server using `setAction(String)`.

### AciAction

    public AciAction(java.lang.String sAction)

  Instantiate an `AciAction` object and set an "action" command.

Parameters:
  `sAction` - the action to send to the ACI server.

Method Detail

### setAction

    public void setAction(java.lang.String sAction)

  Set the "action" command.

  Parameters:
    `sAction` - the "action" command that this object should represent.

### getAction

    public java.lang.String getAction()

  Returns the "action" command that this object represents.

  Returns:
    the action that will be sent to the ACI server.

### setParameters

    public void setParameters(java.util.ArrayList alActionParameters)

  Set a group of parameters that will be sent along with the action command. Any parameters that are not already set on this action will be added while those that are already part of the action will have their values updated.

  Parameters:
    `alActionParameters` - an `ArrayList` of `ActionParameter`s giving the names and values of the parameters to set.
  Throws:
    `java.lang.ClassCastException` - if the objects in the parameter list are not all `ActionParameter`s.

### setParameter

    public void setParameter(ActionParameter actionParameter)

  Set a parameter that will be sent along with the action command. Since parameters must be unique within a given action, calling this method with a parameter that is already set on the action will update the parameters value, not add another parameter entry.

  Parameters:
    `actionParameter` - an `ActionParameter` giving the name and value of the parameters to set.

### setUserSecurityInfo

    public void setUserSecurityInfo(java.util.ArrayList alSecurityTypes)

  Set the user security information for all the repositories that the are relevent to this action. If present, this information is used to construct the value of the SecurityInfo parameter that will be sent with the action.

  Parameters:
    `alSecurityTypes` - an `ArrayList` of `SecurityType`s containing the per-repository security settings for a user.

### addUserSecurityInfo

    public void addUserSecurityInfo(SecurityType securityInfo)

  Set the user security information for all a document repository. If present, this information is used to construct the value of the SecurityInfo parameter that will be sent with the action.

  Parameters:
    `securityInfo` - a `SecurityType`s containing the security settings for the user for a particular repository.

### usePostHTTPMethod

    public void usePostHTTPMethod()

  Change the HTTP method used when sending this action from 'GET' (the default) to 'POST'.

### getHTTPMethod

    public java.lang.String getHTTPMethod()

  Gives the HTTP method that this action is set to use. The default is `HTTP_METHOD_GET` but this is changed to `HTTP_METHOD_POST` by calling `usePostHttpMethod`.

  Returns:
    the HTTP method for this action.

### getParameters

    public java.util.ArrayList getParameters()

  Gives access to the action parameter `ArrayList`.

  Returns:
    a reference to the the action parameter `ArrayList`.

### toString

    public java.lang.String toString()

  Returns the action in the format "/action=<action>¶meter0=value0¶meter1=value1...". Parameter names and values are URLEncoded using utf-8 as the character encoding.

  Returns:
    the action in the format "/action=<action>¶meter0=value0¶meter1=value1...".

### toString

    public java.lang.String toString(java.lang.String sCharEncoding)

  Returns the action in the format "/action=<action>¶meter0=value0¶meter1=value1..." with the parameter names and values URLEncoded using the character encoding given.

  Parameters:
    `sCharEncoding` - the character encoding to use when URLEncoding the parameters.
  Returns:
    the action in the format "/action=<action>¶meter0=value0¶meter1=value1...".

### toHTMLString

    public java.lang.String toHTMLString()

  Returns the action in the format "/action=<action>¶meter0=value0¶meter1=value1"

  Returns:
    the action in the format "/action=<action>¶meter0=value0¶meter1=value1".

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD