|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.indexdata.mkjsf.pazpar2.commands.Pazpar2Command
public abstract class Pazpar2Command
Represents a generic Pazpar2 or Service Proxy command with all its current parameters, and has methods for executing the command against the currently selected Pazpar2 service
Being an abstract class it only has generic methods for getting and setting parameters. Implementing classes are supposed to create named getters and setters for convenient access to parameters from the UI.
Parameters can be set with or without notifying the state manager.
Note: Internally the application has to be able to set parameters without state changes - for instance to avoid eternal feedback when copying parameter from one state to the next. A setting from the UI should spawn a new search state however.
Field Summary | |
---|---|
protected String |
name
|
protected Map<String,CommandParameter> |
parameters
|
Constructor Summary | |
---|---|
Pazpar2Command()
|
|
Pazpar2Command(String name)
|
Method Summary | |
---|---|
void |
addExpression(String parameterName,
Expression expression)
Adds an expression to an ordered list of expressions on a given parameter and notifies the state manager of the change |
protected void |
checkInState(Pazpar2Command command)
Notifies the state manager that this command changed a parameter |
abstract Pazpar2Command |
copy()
Commands must implement this method to provide an completely detached, deep clone of themselves. |
boolean |
equals(Object otherCommand)
|
String |
getCommandName()
|
String |
getEncodedQueryString()
|
CommandParameter |
getParameter(String name)
Retrieves a command parameter by parameter name |
String |
getParameterValue(String parameterName)
|
String |
getSession()
|
abstract ServiceProxyCommand |
getSp()
Implementing classes must provide their Service Proxy extension command if any extension parameters exists, or -- just to be polite -- 'this' if there is no Service Proxy extension to the given command. |
String |
getValueWithExpressions()
|
int |
hashCode()
|
boolean |
hasParameters()
|
boolean |
hasParameterValue(String parameterName)
|
void |
removeExpression(String parameterName,
Expression expression)
|
void |
removeExpressions(String parameterName,
String... expressionFields)
|
void |
removeExpressionsAfter(String parameterName,
Expression expression,
String... expressionFields)
|
void |
removeParameter(String name)
Removes a parameter completely and notifies the state manager about the change |
void |
removeParameters()
Removes multiple parameters completely and notifies the state manager -- once -- about the change |
void |
removeParametersInState()
Removes all parameters without notifying the state manager. |
ResponseDataObject |
run()
Executes the command with the currently selected parameters against the currently selected Pazpar2 service |
ResponseDataObject |
run(SearchClient client,
Responses pzresp)
Executes the command in a thread. |
ResponseDataObject |
runWith(String... parameters)
Executes the commands with the currently selected parameters, while adding the parameters provided |
void |
setCommandName(String name)
|
void |
setParameter(CommandParameter parameter)
Sets a parameter on this command and notifies the state manager about the change |
void |
setParameterInState(CommandParameter parameter)
Sets a parameter on this command without notifying the state manager. |
void |
setParameters(CommandParameter... params)
Sets multiple parameters on the command and notifies the state manager -- once -- about the change |
void |
setParametersInState(CommandParameter... params)
Sets multiple parameters on this command without notifying the state manager. |
void |
setSession(String sessionId)
|
abstract boolean |
spOnly()
Here implementing commands publish whether they only apply to the Service Proxy or can be executed against straight Pazpar2 as well. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String name
protected Map<String,CommandParameter> parameters
Constructor Detail |
---|
public Pazpar2Command()
public Pazpar2Command(String name)
Method Detail |
---|
public void setCommandName(String name)
public abstract Pazpar2Command copy()
public String getCommandName()
public ResponseDataObject run()
public ResponseDataObject runWith(String... parameters)
parameters
- A list of parameters on the form [key=value]
public ResponseDataObject run(SearchClient client, Responses pzresp)
client
- pzresp
-
public void setParameter(CommandParameter parameter)
parameter
- public void setParameters(CommandParameter... params)
params
- public void setParametersInState(CommandParameter... params)
params
- public void setParameterInState(CommandParameter parameter)
parameter
- public CommandParameter getParameter(String name)
name
- of the parameter
public void removeParameter(String name)
name
- of the parameter to removepublic void removeParameters()
name
- of the parameter to removepublic void removeParametersInState()
public void addExpression(String parameterName, Expression expression)
parameterName
- name of the parameter to add the expression toexpression
- public void removeExpression(String parameterName, Expression expression)
public void removeExpressionsAfter(String parameterName, Expression expression, String... expressionFields)
public void removeExpressions(String parameterName, String... expressionFields)
public boolean hasParameters()
public boolean hasParameterValue(String parameterName)
public String getEncodedQueryString()
public String getValueWithExpressions()
public boolean equals(Object otherCommand)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public String getParameterValue(String parameterName)
public void setSession(String sessionId)
public String getSession()
protected void checkInState(Pazpar2Command command)
command
- public abstract ServiceProxyCommand getSp()
public abstract boolean spOnly()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |