com.ibm.commerce.scheduler.commands
Class UpdateLocalRegistryCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.scheduler.commands.UpdateLocalRegistryCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, UpdateLocalRegistryCmd

public class UpdateLocalRegistryCmdImpl
extends ControllerCommandImpl
implements UpdateLocalRegistryCmd

Refresh the local copy of a registry in the runtime cache. This is invoked by the scheduler as an asynchronize command.

The parameters the command recognizes are as follows.

Finds the registry to update and updates it passing the actiona and key./p>

See Also:
Serialized Form

Field Summary
protected  java.lang.String action
           
protected  java.lang.String itUrl
           
protected  java.lang.String key
           
protected  Registry registry
           
protected  java.lang.String registryName
           
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.scheduler.commands. UpdateLocalRegistryCmd
COPYRIGHT, defaultCommandClassName, NAME, URLNAME
 
Fields inherited from interface com.ibm.commerce.command. ControllerCommand
COPYRIGHT
 
Constructor Summary
UpdateLocalRegistryCmdImpl()
          Creates the UpdateLocalRegistry command object.
 
Method Summary
protected  java.lang.String getAction()
          Gets the action to be performed on the element.
protected  java.lang.String getItemKey()
          Deprecated. use getKey() instead.
protected  java.lang.String getKey()
          Gets the cache key.
protected  java.lang.String getRegistryName()
          Gets the name of the registry to be updated.
 AccessVector getResources()
          Gets the access vector accessed by this command.
protected  java.lang.String getUrl()
          Gets the URL to be redirected to at the end of the command.
 void performExecute()
          Finds the registry to update and updates it passing the actiona and key.
 void setAction(java.lang.String action)
          Sets the action to perform.
 void setItemKey(java.lang.String key)
          Deprecated. use setKey(String) instead.
 void setKey(java.lang.String key)
          Sets the element Key.
 void setRegistryName(java.lang.String name)
          Sets the name of the registry to be refreshed.
 void setRequestProperties(com.ibm.commerce.datatype.TypedProperty reqParms)
          This method extracts the required parameters from the request properties and sets it locally in the command.
 void setUrl(java.lang.String url)
          Sets the URL to be redirected to at the end of the command.
 void validateParameters()
          Validates the parameters passed to the command.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command. ControllerCommand
execute, mergeProperties, setRequestProperties, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, setAccCheck
 

Field Detail

registryName

protected java.lang.String registryName

itUrl

protected java.lang.String itUrl

action

protected java.lang.String action

key

protected java.lang.String key

registry

protected Registry registry
Constructor Detail

UpdateLocalRegistryCmdImpl

public UpdateLocalRegistryCmdImpl()
Creates the UpdateLocalRegistry command object.
Method Detail

getAction

protected java.lang.String getAction()
Gets the action to be performed on the element.
Returns:
The action to perform.

getKey

protected java.lang.String getKey()
Gets the cache key.
Returns:
The cache key

getItemKey

protected java.lang.String getItemKey()
Deprecated. use getKey() instead.
Gets the cache key.
Returns:
The cache key

getRegistryName

protected java.lang.String getRegistryName()
Gets the name of the registry to be updated.
Returns:
The registry name

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector accessed by this command. The default implementation returns null indicating that no protectable resource is accessed by this command. It is the responsibilities of the command writer to return the protectable primary resource(s) and the corresponding actions accessed by this command.
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
Always will return null.
Throws:
ECException - should not happen since null will always be returned.

getUrl

protected java.lang.String getUrl()
Gets the URL to be redirected to at the end of the command.
Returns:
The URL to redirect to.

performExecute

public void performExecute()
                    throws ECException
Finds the registry to update and updates it passing the actiona and key.
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - if there was an exception updating the registry.

setAction

public void setAction(java.lang.String action)
Sets the action to perform.
Specified by:
setAction in interface UpdateLocalRegistryCmd
Parameters:
action - the action.

setKey

public void setKey(java.lang.String key)
Sets the element Key.
Specified by:
setKey in interface UpdateLocalRegistryCmd
Parameters:
key - the element key.

setItemKey

public void setItemKey(java.lang.String key)
Deprecated. use setKey(String) instead.
Sets the element Key.
Specified by:
setItemKey in interface UpdateLocalRegistryCmd
Parameters:
key - the element key.

setRegistryName

public void setRegistryName(java.lang.String name)
Sets the name of the registry to be refreshed.
Specified by:
setRegistryName in interface UpdateLocalRegistryCmd
Parameters:
name - the registry name

setRequestProperties

public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty reqParms)
                          throws ECException
This method extracts the required parameters from the request properties and sets it locally in the command. It throws an ECApplicationException if a required parameter is missing.
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
reqParms - the command parameters.
Throws:
com.ibm.commerce.exception.ECApplicationException - if an exception occurs when retrieving the command properties.
ECException

setUrl

public void setUrl(java.lang.String url)
Sets the URL to be redirected to at the end of the command.
Parameters:
url - the URL to redirect to.

validateParameters

public void validateParameters()
                        throws ECException
Validates the parameters passed to the command. The validation is ensuring the URL, registry and action is specified.
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException - if a command parameter is missing of invalid.