org.apache.lenya.cms.usecase.scheduling.impl
Class UsecaseCronJob

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.cron.ServiceableCronJob
          extended by org.apache.lenya.cms.usecase.scheduling.impl.UsecaseCronJob
All Implemented Interfaces:
org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.components.cron.ConfigurableCronJob, org.apache.cocoon.components.cron.CronJob

public class UsecaseCronJob
extends org.apache.cocoon.components.cron.ServiceableCronJob
implements org.apache.cocoon.components.cron.ConfigurableCronJob, org.apache.avalon.framework.context.Contextualizable

Job to schedule usecase execution.

Version:
$Id: UsecaseCronJob.java 535152 2007-05-04 10:14:41Z andreas $

Field Summary
protected static java.lang.String MACHINE_IP
           
protected static java.lang.String SOURCE_URL
           
protected static java.lang.String USECASE_NAME
           
protected static java.lang.String USER_ID
           
 
Fields inherited from class org.apache.cocoon.components.cron.ServiceableCronJob
manager
 
Fields inherited from interface org.apache.cocoon.components.cron.CronJob
ROLE
 
Constructor Summary
UsecaseCronJob()
           
 
Method Summary
protected  void authorizeRequest()
          Initializes the session with the access control information.
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 void execute(java.lang.String jobname)
           
protected  java.util.Map getParameters()
           
protected  java.lang.String getSourceURL()
           
 java.lang.String getUsecaseName()
           
 java.lang.String getUserId()
           
 void setup(org.apache.avalon.framework.parameters.Parameters parameters, java.util.Map objects)
           
 void setup(Usecase usecase)
          Initializes the job.
protected  void setupOriginalRequest()
          Creates a new request object based on the information from the original request which triggered the usecase.
 
Methods inherited from class org.apache.cocoon.components.cron.ServiceableCronJob
service
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USECASE_NAME

protected static final java.lang.String USECASE_NAME
See Also:
Constant Field Values

SOURCE_URL

protected static final java.lang.String SOURCE_URL
See Also:
Constant Field Values

USER_ID

protected static final java.lang.String USER_ID
See Also:
Constant Field Values

MACHINE_IP

protected static final java.lang.String MACHINE_IP
See Also:
Constant Field Values
Constructor Detail

UsecaseCronJob

public UsecaseCronJob()
Method Detail

setup

public void setup(Usecase usecase)
Initializes the job.

Parameters:
usecase - The usecase.

getUsecaseName

public java.lang.String getUsecaseName()
Returns:
The name of the usecase to execute.

getUserId

public java.lang.String getUserId()
Returns:
The ID of the user who scheduled the job.

getSourceURL

protected java.lang.String getSourceURL()

getParameters

protected java.util.Map getParameters()

execute

public void execute(java.lang.String jobname)
Specified by:
execute in interface org.apache.cocoon.components.cron.CronJob
See Also:
CronJob.execute(java.lang.String)

setupOriginalRequest

protected void setupOriginalRequest()
Creates a new request object based on the information from the original request which triggered the usecase.


authorizeRequest

protected void authorizeRequest()
                         throws org.apache.lenya.ac.AccessControlException,
                                org.apache.avalon.framework.service.ServiceException
Initializes the session with the access control information.

Throws:
org.apache.lenya.ac.AccessControlException - if an error occurs.
org.apache.avalon.framework.service.ServiceException - if the access controller resolver could not be created.

setup

public void setup(org.apache.avalon.framework.parameters.Parameters parameters,
                  java.util.Map objects)
Specified by:
setup in interface org.apache.cocoon.components.cron.ConfigurableCronJob
See Also:
ConfigurableCronJob.setup(org.apache.avalon.framework.parameters.Parameters, java.util.Map)

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)


Copyright $ Apache Software Foundation. All Rights Reserved.