001    package videoautomat.contentcreator.stdactions;
002    
003    import sale.Action;
004    import sale.GateChangeTransition;
005    import sale.SaleProcess;
006    import sale.SalesPoint;
007    import sale.UIGate;
008    
009    /**
010     * Standard action to change to stop gate and detach user.
011     * 
012     * @author Alexander Herrmann
013     *
014     */
015    public class LogOutAction implements Action {
016    
017        /**
018             * ID for Serialization.
019             */
020            private static final long serialVersionUID = 8638643725086381180L;
021    
022            /**
023         * Changes to the stop gate and detaches User. Called by an action listener, such as an button.
024         * The attribues are set by the action listener.
025         * @param saleProcess - current {@link sale.SaleProcess}
026         * @param salePoint   - current {@link sale.SalesPoint}
027         */
028        public void doAction(SaleProcess saleProcess, SalesPoint sp) throws Throwable {
029            sp.detachUser();
030            UIGate currentGate = (UIGate)saleProcess.getCurrentGate();
031            currentGate.setNextTransition(GateChangeTransition.CHANGE_TO_STOP_GATE);
032        }
033    
034    }