001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
003     * agreements. See the NOTICE file distributed with this work for additional information regarding
004     * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
005     * "License"); you may not use this file except in compliance with the License. You may obtain a
006     * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
007     * law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
008     * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
009     * for the specific language governing permissions and limitations under the License.
010     */
011    package javax.portlet.faces.event;
012    
013    
014    /**
015     * An <code>EventNavigationResult</code> is the type of object that can
016     * be returned from a <code>BrdigeEventHandler.handleEvent</code> call.
017     * When it is returned (non-null) it conveys the Faces navigation information
018     * to the bridge that it needs to utilize the Faces <code>NavigationHandler</code>
019     * to evaluate the navigation according to the configured rules.  The
020     * <code>fromAction</code> corresponds to the <code>fromAction</code> string
021     * in the faces-config.xml navigation rule.  The <code>outcome</code> 
022     * corresponds to the <code>outcome</code> string in the navigation rule.
023     */
024    
025    public class EventNavigationResult extends Object
026    {
027        private String mFromAction;
028        private String mOutcome;
029       
030      /**
031       * Null constructor
032       */    
033        public EventNavigationResult()
034        {
035          
036        }
037    
038      /**
039       * Constructor which sets the object to the desired fromAction and outcome
040       * 
041       * @param action
042       *       desired fromAction
043       * @param outcome
044       *       desired outcome
045       */     
046        public EventNavigationResult(String action, String outcome)
047        {
048          mFromAction = action;
049          mOutcome = outcome;
050        }
051        
052      /**
053       * Gets the fromAction stored in this object. The <code>fromAction</code>
054       * corresponds to the <code>fromAction</code> string in the faces-config.xml
055       * navigation rule.
056       * 
057       * @return <code>String</code> containing the fromAction
058       */
059        public String getFromAction()
060        {
061          return mFromAction;
062        }
063    
064      /**
065       * Sets the fromAction for this object. The <code>fromAction</code>
066       * corresponds to the <code>fromAction</code> string in the faces-config.xml
067       * navigation rule.
068       * 
069       * @param action
070       *       new fromAction
071       */    
072        public void setFromAction(String action)
073        {
074          mFromAction = action;
075        }
076    
077      /**
078       * Gets the outcome stored in this object. The <code>outcome</code>
079       * corresponds to the <code>outcome</code> string in the faces-config.xml
080       * navigation rule.
081       * 
082       * @return <code>String</code> containing the fromAction
083       */    
084      public String getOutcome()
085      {
086        return mOutcome;
087      }
088    
089      /**
090       * Sets the fromAction for this object. The <code>fromAction</code>
091       * corresponds to the <code>fromAction</code> string in the faces-config.xml
092       * navigation rule.
093       * 
094       * @param outcome
095       *       new outcome
096       */ 
097      public void setOutcome(String outcome)
098      {
099        mOutcome = outcome;
100      }   
101        
102    }