org.nakedobjects.metamodel.authentication.AuthenticationSession Maven / Gradle / Ivy
package org.nakedobjects.metamodel.authentication;
import java.util.List;
/**
* The representation within the system of an authenticated user.
*/
public interface AuthenticationSession {
/**
* The name of the authenticated user; for display purposes only.
*/
public String getUserName();
public boolean hasUserNameOf(String userName);
/**
* The roles this user belongs to
*/
public List getRoles();
/**
* A unique code given to this session during authentication.
*
*
* This can be used to confirm that this session has been properly created and the user has been
* authenticated. It should return an empty string ("") if this is unauthenticated user (i.e., as
* created within an exploration system).
*/
public String getValidationCode();
/**
* For viewers (in particular) to store additional attributes, analogous to an
* HttpSession.
*/
public Object getAttribute(String attributeName);
/**
* @see #getAttribute(String)
*/
public void setAttribute(String attributeName, Object attribute);
}
// Copyright (c) Naked Objects Group Ltd.