public class ControllerCommandImpl extends AbstractECTargetableCommand implements ControllerCommand, Protectable
performExecute
method and set up the proper response data.defaultCommandClassName
Constructor and Description |
---|
ControllerCommandImpl()
This is the default constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkPermission()
Deprecated.
This method has been replaced by
ECCommand.getResources() |
boolean |
fulfills(java.lang.Long member,
java.lang.String relationship)
This method determines if a given member fulfills a given relationship with the resource.
|
java.lang.Long |
getForUserId()
This method gets the user id for a customer agent command.
|
boolean |
getGeneric()
This method gets the generic property for this command.
|
java.lang.Long |
getOwner()
This method gets the owner of this command.
|
TypedProperty |
getRequestProperties()
This method gets the request properties associated with this command.
|
TypedProperty |
getResolvedRequestProperties()
This method gets the resolved request properties associated with this command.
|
java.lang.Long[] |
getResourceOwners()
Deprecated.
This method has been replaced by
AbstractECTargetableCommand.getResources() |
TypedProperty |
getResponseProperties()
This method gets the response properties associated with this command.
|
boolean |
getRetriable()
This method gets the retriable property for this command.
|
TypedProperty |
getViewInputProperties()
This method gets the input properties that will be passed on to the view command.
|
boolean |
isGeneric()
This method determines whether this is a generic command.
|
boolean |
isRetriable()
This method determines whether this command is retriable on transaction rollback exceptions.
|
TypedProperty |
mergeProperties(TypedProperty reqProp)
This method merges the properties passed to the request with the default properties.
|
void |
setForUserId(java.lang.Long value)
This method sets the
forUserId for a customer agent command. |
void |
setGeneric(boolean value)
This method sets the generic property of this command.
|
void |
setOwner(java.lang.Long value)
This method sets the owner for this command for the purpose of command level access control.
|
void |
setRequestProperties(TypedProperty reqProperties)
This method sets the
requestProperties for the command. |
void |
setResponseProperties(TypedProperty respProperties)
This method sets the response properties.
|
void |
setRetriable(boolean value)
This method sets the retriable property for this command.
|
void |
setViewInputProperties(TypedProperty reqProperties)
This method sets the input properties to be passed to the view command.
|
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, performExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
getCommandTarget, getCommandTargetName, hasOutputProperties, performExecute, setCommandTarget, setCommandTargetName, setOutputProperties
accessControlCheck, getAccCheck, setAccCheck
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
public ControllerCommandImpl()
public boolean checkPermission() throws ECException
ECCommand.getResources()
checkResourcePermission()
in this version.
Command writers should not implement this method but implement the getResources()
method instead.
The default implementation returns true.checkPermission
in interface ControllerCommand
true
if this user has permission to perform the operation on the
resource and false
otherwise.ECException
public java.lang.Long getForUserId()
getForUserId
in interface AccCommand
forUserId
.public boolean getGeneric()
ControllerCommandImpl
returns 'false' for this method.
The command writer needs to overwrite this method if this command can be executed by a generic user.getGeneric
in interface ControllerCommand
true
if this command can be called by a generic user and
false
otherwise.public java.lang.Long getOwner() throws java.lang.Exception
Protectable
interface.
This is required for command level access control where the command is the protectable resource.getOwner
in interface Protectable
java.lang.Exception
public TypedProperty getRequestProperties()
getRequestProperties
in interface ControllerCommand
public TypedProperty getResolvedRequestProperties()
Hashtable
of name/value pairs of interpreted request properties.
This method needs to be implemented for all commands that accept wild card parameter values
and where user traffic data monitoring is desired. The default implementation returns null.
The command will return only the properties with expanded parameter values.getResolvedRequestProperties
in interface ControllerCommand
public java.lang.Long[] getResourceOwners() throws ECException
AbstractECTargetableCommand.getResources()
getResourceOwners
in interface AccCommand
Long
objects that represents all the organization
unit reference numbers. A site owner is represented by an organization unit value of -1.ECException
public TypedProperty getResponseProperties()
Hashtable
of name value pairs.
The controller command should return a view command name for returning
response data.
For example, it could contain the following properties:
EC_VIEWTASKNAME
(viewTaskName
) - The name of a view command/view task. This is a required parameter.EC_DOCPATHNAME
(docname
) - The name of a JSP
to be forwarded.EC_TEXTDOCUMENT
(textDocument
)- An InputStream
for the text document to be returned.EC_RAWDOCUMENT
(rawDocument
)- An InputStream
for the raw document to be returned.EC_REDIRECTURL
(redirecturl
) - The name of a redirect URL
The response properties are combined with any default parameters defined in the properties
column of the URL
configuration before passing on to the view command.
getResponseProperties
in interface ControllerCommand
public boolean getRetriable()
getRetriable
in interface ControllerCommand
true
if this command is retriable and false
otherwise.public TypedProperty getViewInputProperties()
getViewInputProperties
in interface ControllerCommand
public boolean isGeneric()
isGeneric
in interface ControllerCommand
true
if this command can be called by a generic user and
false
otherwise.public boolean isRetriable()
isRetriable
in interface ControllerCommand
true
if this command is retriable and false
otherwise.public TypedProperty mergeProperties(TypedProperty reqProp)
mergeProperties
in interface ControllerCommand
reqProp
- This is an object that represents the input request properties.public void setForUserId(java.lang.Long value)
forUserId
for a customer agent command.
This method is for internal use by the framework only.setForUserId
in interface AccCommand
value
- This is the user id.public final void setGeneric(boolean value)
setGeneric
in interface ControllerCommand
value
- This is a boolean
value; true if the command is a generic command and false otherwise.public void setOwner(java.lang.Long value)
setOwner
in interface AccCommand
value
- This is the owner id.public void setRequestProperties(TypedProperty reqProperties) throws ECException
requestProperties
for the command. The WebController
calls the setRequestProperties
method before invoking the execute method for this command.
It is the responsibility of the command writer to extract the
required input parameters from the requestProperties
object.setRequestProperties
in interface ControllerCommand
reqProperties
- This is an object that represents the request properties.ECException
public void setResponseProperties(TypedProperty respProperties)
respProperties
- This is an object that represents the response properties.public final void setRetriable(boolean value)
retriable
properties in the PROPERTIES
column of the CMDREG
table, only when that entry exists in the database table, otherwise,<CommandRegistryRetriableProperty defaultValue="0" (or "false") />
is defined in
the wc-server.xml
file, then the command factory will use this setting as the default retriable configuration.setRetriable
in interface ControllerCommand
value
- This is a boolean
value; true
if retriable and false
otherwise.public void setViewInputProperties(TypedProperty reqProperties) throws ECException
setViewInputProperties
in interface ControllerCommand
reqProperties
- This is an object that represents the request properties.ECException
public boolean fulfills(java.lang.Long member, java.lang.String relationship) throws java.lang.Exception
fulfills
in interface Protectable
member
- This is the member id of the member.relationship
- This is the relationship the member has with to the resource.true
if the member fulfills the relationship with the resource
and false
otherwise.RemoteException
java.lang.Exception