// Path: src/main/java/org/vaadin/spring/sample/security/ui/ViewToken.java
// public interface ViewToken extends Serializable {
// 	
// 	public static final String HOME="";
// 	public static final String USER="/user";	
// 	public static final String ADMIN="/admin";
// 	public static final String ADMIN_HIDDEN="/hidden";
// 	public static final String SIGNIN="/signin";
// 	public static final String SIGNUP="/signup";
// 	
// 	public static final List<String> VALID_TOKENS = Arrays.asList(new String[] {HOME, USER, ADMIN, ADMIN_HIDDEN, SIGNIN, SIGNUP});		
// 
// }


import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventScope;
import org.vaadin.spring.navigator.SpringViewProvider;
import org.vaadin.spring.sample.security.ui.ViewToken;
import org.vaadin.spring.security.Security;
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.ViewDisplay;
import com.vaadin.server.Page;
import com.vaadin.ui.UI;
package org.vaadin.spring.sample.security.ui.security;



public class SecuredNavigator extends Navigator {

	private static final long serialVersionUID = -1550472603474329940L;
	
	final Security security;
	final SpringViewProvider viewProvider;
	final EventBus eventBus;
			
	public SecuredNavigator(UI ui, ViewDisplay display, SpringViewProvider viewProvider, Security security, EventBus eventBus) {
		super(ui, display);		
		this.security = security;
		this.viewProvider = viewProvider;
		this.eventBus = eventBus;
		addProvider(this.viewProvider);
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.vaadin.navigator.Navigator#navigateTo(java.lang.String)
	 */
	@Override
	public void navigateTo(String navigationState) {
						
// Path: src/main/java/org/vaadin/spring/sample/security/ui/ViewToken.java
// public interface ViewToken extends Serializable {
// 	
// 	public static final String HOME="";
// 	public static final String USER="/user";	
// 	public static final String ADMIN="/admin";
// 	public static final String ADMIN_HIDDEN="/hidden";
// 	public static final String SIGNIN="/signin";
// 	public static final String SIGNUP="/signup";
// 	
// 	public static final List<String> VALID_TOKENS = Arrays.asList(new String[] {HOME, USER, ADMIN, ADMIN_HIDDEN, SIGNIN, SIGNUP});		
// 
// }


// Path: src/main/java/org/vaadin/spring/sample/security/ui/security/SecuredNavigator.java
import org.vaadin.spring.events.EventBus;
import org.vaadin.spring.events.EventScope;
import org.vaadin.spring.navigator.SpringViewProvider;
import org.vaadin.spring.sample.security.ui.ViewToken;
import org.vaadin.spring.security.Security;
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.ViewDisplay;
import com.vaadin.server.Page;
import com.vaadin.ui.UI;

package org.vaadin.spring.sample.security.ui.security;



public class SecuredNavigator extends Navigator {

	private static final long serialVersionUID = -1550472603474329940L;
	
	final Security security;
	final SpringViewProvider viewProvider;
	final EventBus eventBus;
			
	public SecuredNavigator(UI ui, ViewDisplay display, SpringViewProvider viewProvider, Security security, EventBus eventBus) {
		super(ui, display);		
		this.security = security;
		this.viewProvider = viewProvider;
		this.eventBus = eventBus;
		addProvider(this.viewProvider);
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.vaadin.navigator.Navigator#navigateTo(java.lang.String)
	 */
	@Override
	public void navigateTo(String navigationState) {
						
		if (ViewToken.VALID_TOKENS.contains(navigationState)) {