public abstract class AbstractECTargetableCommand extends com.ibm.commerce.command.MeasuredCacheableCommandImpl implements ECTargetableCommand
ECTargetableCommand
objects.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
defaultCommandClassName
Constructor and Description |
---|
AbstractECTargetableCommand()
This is the default constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accessControlCheck()
This method performs a command level access control check for this command.
|
void |
checkIsAllowed(java.lang.Object resource,
java.lang.String action)
This method determines whether a user can perform a specified action on a certain resource.
|
void |
checkResourcePermission()
This method performs resource level access control checking.
|
void |
createCommandExecutionEvent(com.ibm.commerce.command.event.CommandExecutionTrigger trigger)
This method creates a command execution event.
|
void |
execute()
This method is part of the command framework.
|
boolean |
getAccCheck()
This method checks to see if an access control check is required for this command.
|
CommandContext |
getCommandContext()
This method gets the command context associated with this command.
|
java.lang.String |
getCommandIfName()
This method gets the command interface name.
|
java.lang.String |
getCommandName()
This method gets the name of the originating command.
|
java.lang.Integer |
getCommandStoreId()
This method gets the store id used to create this command.
|
TypedProperty |
getDefaultProperties()
This method gets the default properties associated with this command.
|
java.util.Map |
getExceptionInvokeParameters(java.lang.String event)
This method returns the attributes for a particular event type when the command executed throws an exception.
|
long |
getObjectSize()
Returns the estimated footprint size in bytes
of this object and the objects it contains.
|
java.util.Map |
getPostInvokeParameters(java.lang.String event)
This method returns the attributes for a particular event type after the command is executed.
|
java.util.Map |
getPreInvokeParameters(java.lang.String event)
This method returns the attributes for a particular event type before the command is executed.
|
AccessVector |
getResources()
This method gets the access vector accessed by this command.
|
java.lang.Integer |
getStoreId()
This method gets the store id associated with this command.
|
UserAccessBean |
getUser()
This method gets the
UserAccessBean object associated with the user. |
java.lang.Long |
getUserId()
This method gets the user id for the user associated with this command from the command context.
|
boolean |
isReadyToCallExecute()
This method is called by the targetable command framework.
|
void |
performExecute()
This method performs the business logic for this command.
|
void |
reset()
This method is called after a command has been executed.
|
void |
setAccCheck(boolean newValue)
This method is set by the web controller to indicate whether an access control check is
required for this command.
|
void |
setCommandContext(CommandContext aCommandContext)
This method sets the command context associated with this command.
|
void |
setCommandIfName(java.lang.String name)
This method sets the command interface name.
|
void |
setCommandStoreId(java.lang.Integer storeId)
This method sets the store id used to create this command.
|
void |
setDefaultProperties(TypedProperty val)
This method sets default properties associated with this
ECCommand . |
void |
validateParameters()
This method performs server side parameter checking.
|
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
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
public static final java.lang.String COPYRIGHT
public AbstractECTargetableCommand()
public long getObjectSize()
getObjectSize
in interface com.ibm.websphere.cache.Sizeable
getObjectSize
in class com.ibm.websphere.command.CacheableCommandImpl
public boolean accessControlCheck() throws ECException
true
if the user has authority and false
otherwise.ECException
- An ECApplicationException is thrown when an _ERR_USER_AUTHORITY
error occurs.
public void checkIsAllowed(java.lang.Object resource, java.lang.String action) throws ECException
getResources()
method.checkIsAllowed
in interface ECCommand
resource
- This is the resource to be acted on.action
- This is the action to be performed on the resource.ECException
- An ECApplicationException
is thrown when an _ERR_USER_AUTHORITY
error occurs.public void checkResourcePermission() throws ECException
AccManager
to perform
resource level access control checking based on the command interface name and the
AccessVector
returned by the getResources()
method.
This method will throw an ECApplicationException
with message _ERR_USER_AUTHORITY
if the user has no authority to perform the operation on the resource.
checkResourcePermission
in interface ECCommand
ECException
- This is thrown with the message _ERR_USER_AUTHORITY
if user does not have permission to perform the operation on the resource.public final void execute() throws ECException
ECException
will be thrown if there are any errors detected during the
command execution.execute
in interface ECCommand
execute
in interface com.ibm.websphere.command.Command
execute
in class com.ibm.commerce.command.MeasuredCacheableCommandImpl
ECException
- This is thrown if there are any errors detected during the command execution.public boolean getAccCheck()
getAccCheck
in interface ECCommand
true
if an access control check is required for this command
and false
otherwise.public final CommandContext getCommandContext()
getCommandContext
in interface ECCommand
CommandContext
object.public final java.lang.String getCommandIfName()
getCommandIfName
in interface ECCommand
public final java.lang.String getCommandName()
URL
name defined in the URL
configuration.getCommandName
in interface ECCommand
public final TypedProperty getDefaultProperties()
getDefaultProperties
in interface ECCommand
public AccessVector getResources() throws ECException
getResources
in interface ECCommand
AccessVector
object of resource/action pairs.ECException
public java.lang.Integer getStoreId()
getStoreId
in interface ECCommand
public final java.lang.Integer getCommandStoreId()
getCommandStoreId
in interface ECCommand
public final void setCommandStoreId(java.lang.Integer storeId)
setCommandStoreId
in interface ECCommand
storeId
- This is the command store id.public final UserAccessBean getUser() throws ECSystemException
UserAccessBean
object associated with the user.getUser
in interface ECCommand
ECSystemException
public java.lang.Long getUserId()
public boolean isReadyToCallExecute()
true
.isReadyToCallExecute
in interface com.ibm.websphere.command.Command
isReadyToCallExecute
in class com.ibm.websphere.command.TargetableCommandImpl
boolean
value; true
if we can execute the
command and false
otherwise. This default implementation will return true
.public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in interface com.ibm.websphere.command.TargetableCommand
performExecute
in class com.ibm.websphere.command.TargetableCommandImpl
ECException
public void reset()
reset
in interface com.ibm.websphere.command.Command
reset
in class com.ibm.websphere.command.CacheableCommandImpl
public void setAccCheck(boolean newValue)
JSP
page associated with a command because access control has already
been performed on the controller command.setAccCheck
in interface ECCommand
newValue
- This is a boolean
value; true
if an access check is required
and false
otherwise.public final void setCommandContext(CommandContext aCommandContext)
setCommandContext
in interface ECCommand
aCommandContext
- This is a CommandContext
object.public final void setCommandIfName(java.lang.String name)
setCommandIfName
in interface ECCommand
name
- This is the command interface name.public final void setDefaultProperties(TypedProperty val)
ECCommand
. Default properties are defined in the URL
configuration.
This method is called by the CommandFactory
object during command
creation to set the default properties for this command.setDefaultProperties
in interface ECCommand
val
- This is a TypedProperty
object.public void validateParameters() throws ECException
checkParameters()
method from version 5.1.
The default implementation of validateParameters()
is a no op
.
It is the responsibility of the command writers to implement this method if they want to perform
server side parameter checking.validateParameters
in interface ECCommand
ECException
public void createCommandExecutionEvent(com.ibm.commerce.command.event.CommandExecutionTrigger trigger) throws ECException
createCommandExecutionEvent
in interface ECCommand
trigger
- This is a command execution trigger.ECException
public java.util.Map getPreInvokeParameters(java.lang.String event)
getPreInvokeParameters
in interface ECCommand
event
- This is the event type.public java.util.Map getPostInvokeParameters(java.lang.String event)
getPostInvokeParameters
in interface ECCommand
event
- This is the event type.public java.util.Map getExceptionInvokeParameters(java.lang.String event)
getExceptionInvokeParameters
in interface ECCommand
event
- This is the event type.