|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.autonomy.aci.AciAction
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.
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 |
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)
.
public AciAction(java.lang.String sAction)
Instantiate an AciAction
object and set an "action" command.
sAction
- the action to send to the ACI server.Method Detail |
public void setAction(java.lang.String sAction)
Set the "action" command.
sAction
- the "action" command that this object should represent.public java.lang.String getAction()
Returns the "action" command that this object represents.
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.
alActionParameters
- an ArrayList
of ActionParameter
s giving the
names and values of the parameters to set.
java.lang.ClassCastException
- if the objects in the parameter list are not all ActionParameter
s.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.
actionParameter
- an ActionParameter
giving the name and value of the parameters
to set.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.
alSecurityTypes
- an ArrayList
of SecurityType
s containing the
per-repository security settings for a user.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.
securityInfo
- a SecurityType
s containing the security settings for the user for
a particular repository.public void usePostHTTPMethod()
Change the HTTP method used when sending this action from 'GET' (the default) to 'POST'.
public java.lang.String getHTTPMethod()
HTTP_METHOD_GET
but
this is changed to HTTP_METHOD_POST
by calling usePostHttpMethod
.
public java.util.ArrayList getParameters()
ArrayList
.
ArrayList
.public java.lang.String toString()
public java.lang.String toString(java.lang.String sCharEncoding)
sCharEncoding
- the character encoding to use when URLEncoding the parameters.
public java.lang.String toHTMLString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |