|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.client.core.RemotingAction
public abstract class RemotingAction
An action that makes a server-side call.
Field Summary |
---|
Fields inherited from interface ccc.client.core.Action |
---|
UI_CONSTANTS, USER_ACTIONS |
Constructor Summary | |
---|---|
RemotingAction()
Constructor. |
|
RemotingAction(java.lang.String actionName)
Constructor. |
|
RemotingAction(java.lang.String actionName,
HttpMethod method)
Constructor. |
Method Summary | |
---|---|
protected boolean |
beforeExecute()
Handler method called immediately before an action is executed. |
protected java.lang.String |
encode(java.lang.String string)
URL encode a string. |
void |
execute()
Perform the action. |
protected void |
fireEvent(Event<CommandType> event)
Submit an event to the event bus. |
java.lang.String |
getActionName()
Accessor. |
protected java.lang.String |
getBody()
Provide a body for this method. |
TextParser |
getParser()
Accessor. |
protected java.lang.String |
getPath()
Determine the server path for this action. |
protected Request |
getRequest()
Get the HTTP request for this action. |
protected void |
onFailure(java.lang.Throwable throwable)
Handle failure. |
protected void |
onNoContent(Response response)
Handle a '204 NO CONTENT' response from the remote server. |
protected void |
onOK(Response response)
Handle a '200 OK' response from the remote server. |
protected ResourceSummary |
parseResourceSummary(Response response)
Parse the response as a resource summary. |
RemotingAction |
setExecutor(RequestExecutor executor)
Mutator. |
RemotingAction |
setParser(TextParser parser)
Mutator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RemotingAction()
public RemotingAction(java.lang.String actionName)
actionName
- The name of this action.public RemotingAction(java.lang.String actionName, HttpMethod method)
actionName
- The name of this action.method
- The HTTP method to use.Method Detail |
---|
public void execute()
execute
in interface Action
public RemotingAction setExecutor(RequestExecutor executor)
executor
- The executor to set.
public TextParser getParser()
public RemotingAction setParser(TextParser parser)
parser
- The parser to set.
protected Request getRequest()
protected boolean beforeExecute()
You can override this method to present confirmation dialogs, etc. to users, when an action is invoked. If this method returns true the action will continue; if false is returned the action will not be executed.
protected void onFailure(java.lang.Throwable throwable)
throwable
- The throwable.protected java.lang.String getBody()
Only called for POST requests.
public final java.lang.String getActionName()
protected java.lang.String getPath()
protected void onNoContent(Response response)
response
- The server response.protected void onOK(Response response)
response
- The server response.protected java.lang.String encode(java.lang.String string)
string
- The string to encode.
protected ResourceSummary parseResourceSummary(Response response)
response
- The response to parse.
protected void fireEvent(Event<CommandType> event)
event
- The event to submit.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |