com.ibm.commerce.scheduler.commands
Class UpdateRegistryCmdImpl

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

public class UpdateRegistryCmdImpl
extends ControllerCommandImpl
implements UpdateRegistryCmd

Refreshes a registry component in the runtime cache.

The parameters the command recognizes are as follows.

This command creates a broadcast job that runs the UpdateLocalRegistry command. After puts the information needed to redirect to the specified URL.

See Also:
Serialized Form

Field Summary
protected  java.lang.String action
           
protected  java.lang.Long jobId
           
protected  java.lang.Long jobInstanceId
           
protected  java.lang.String key
           
protected  Registry registry
           
protected  java.lang.String registryName
           
protected  java.lang.String url
           
 
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. UpdateRegistryCmd
COPYRIGHT, defaultCommandClassName, URLNAME
 
Fields inherited from interface com.ibm.commerce.command. ControllerCommand
COPYRIGHT
 
Constructor Summary
UpdateRegistryCmdImpl()
          Creates the UpdateRegistry command object.
 
Method Summary
protected  java.lang.String getItemKey()
          Deprecated. use getKey() instead.
 java.lang.Long getJobId()
          Gets the job reference number of schedule job that will execute UpdateLocalRegistry.
 java.lang.Long getJobInstanceId()
          Gets the job instance number that indicates when to run the job.
protected  java.lang.String getKey()
          Gets the cache key.
protected  java.lang.String getRegistryName()
          Gets the name of the registry to be refreshed.
 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()
          Creates a broadcast job to execute the UpdateLocalRegistry command and then updates the response properties so the specified URL can be redirect to.
 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 cache 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

action

protected java.lang.String action

key

protected java.lang.String key

registry

protected Registry registry

registryName

protected java.lang.String registryName

url

protected java.lang.String url

jobId

protected java.lang.Long jobId

jobInstanceId

protected java.lang.Long jobInstanceId
Constructor Detail

UpdateRegistryCmdImpl

public UpdateRegistryCmdImpl()
Creates the UpdateRegistry command object.
Method Detail

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

getJobId

public java.lang.Long getJobId()
Gets the job reference number of schedule job that will execute UpdateLocalRegistry.
Returns:
The job reference number.

getJobInstanceId

public java.lang.Long getJobInstanceId()
Gets the job instance number that indicates when to run the job.
Returns:
The job instance number.

getRegistryName

protected java.lang.String getRegistryName()
Gets the name of the registry to be refreshed.
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:
Should - never happen since only null is being returned.
ECException

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
Creates a broadcast job to execute the UpdateLocalRegistry command and then updates the response properties so the specified URL can be redirect to.
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - if there was a problem creating the new broadcast job.

setAction

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

setKey

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

setItemKey

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

setRegistryName

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

setRequestProperties

public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty reqParms)
                          throws ECApplicationException
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 parameters passed to the command.
Throws:
com.ibm.commerce.exception.ECApplicationException - if the require parameter is not specified.
ECApplicationException

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.
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException - if any of the parameters specified is invalid.