View Javadoc

1   package org.astrogrid.portal.myspace.acting.framework;
2   
3   import java.util.Map;
4   
5   /***
6    * Change the MySpace end point used.
7    * 
8    * @author peter.shillan
9    */
10  public class ChangeHandler extends AbstractMySpaceHandler {
11    /***
12     * @see org.astrogrid.portal.myspace.acting.framework.AbstractMySpaceHandler#AbstractMySpaceHandler(org.astrogrid.portal.myspace.acting.framework.ContextWrapper)
13     * @param context
14     */
15    public ChangeHandler(ContextWrapper context) {
16      super(context);
17    }
18  
19    /***
20     * Set a new MySpace end point for global use.
21     * 
22     * @see org.astrogrid.portal.myspace.acting.framework.AbstractMySpaceHandler#executeTemplateMethod(java.util.Map)
23     */
24    protected void executeTemplateMethod(Map results) throws Throwable {
25      // Set the new MySpace end point.
26      String endPoint = context.getParameter(ContextWrapper.PARAM_END_POINT, ContextWrapper.DEFAULT_END_POINT);
27  //    String endPoint = context.getEndPoint();
28      
29      if(endPoint != null && endPoint.length() > 0) {
30        addGlobalResult(ContextWrapper.PARAM_END_POINT, endPoint, results);
31      }
32      else {
33        throw new MySpaceHandlerException("no valid end point");
34      }
35    }
36  }