1 package org.apache.maven.repository.manager.web.action;
\r
3 import com.opensymphony.xwork.Action;
\r
4 import com.opensymphony.webwork.interceptor.ParameterAware;
\r
6 import java.util.Map;
\r
7 import java.util.HashMap;
\r
9 import org.apache.maven.repository.manager.web.utils.ConfigurationManager;
\r
12 * @author <a href="mailto:aramirez@apache.org">Allan Ramirez</a>
\r
14 * @plexus.component role="com.opensymphony.xwork.Action" role-hint="org.apache.maven.repository.manager.web.action.SchedulerConfigurationAction"
\r
16 public class SchedulerConfigurationAction
\r
17 implements Action, ParameterAware
\r
20 * @plexus.requirement
\r
22 private ConfigurationManager plexusConfig;
\r
24 private Map parameters;
\r
26 public Map getParameters()
\r
31 public void setParameters( Map parameters )
\r
33 this.parameters = parameters;
\r
37 * Execute this method if the action was invoked
\r
39 * @return String success or error
\r
41 public String execute()
\r
46 map = new HashMap();
\r
48 String[] cronExpression = (String[]) parameters.get( ConfigurationManager.DISCOVERY_CRON_EXPRESSION );
\r
50 if( cronExpression[0] != null )
\r
52 map.put( ConfigurationManager.DISCOVERY_CRON_EXPRESSION, cronExpression[0] );
\r
54 plexusConfig.updateConfiguration( map );
\r
63 catch( Exception e )
\r
65 e.printStackTrace();
\r