org.wicketstuff.security.hive.authentication
Class LoginContainer

java.lang.Object
  extended by org.wicketstuff.security.hive.authentication.LoginContainer
All Implemented Interfaces:
Serializable

public final class LoginContainer
extends Object
implements Serializable

Container class for multiple LoginContexts. Allows the concept of multi-level login. Note this class is not thread safe.

Author:
marrink
See Also:
Serialized Form

Constructor Summary
LoginContainer()
           
 
Method Summary
 org.wicketstuff.security.hive.authentication.Subject getSubject()
          returns an immutable Subject which Contains all the principals of the subjects in the loginContexts.
 boolean isClassAuthenticated(Class<?> clazz)
          Queries all available subjects (descending sort order) for the authentication of a class.
 boolean isComponentAuthenticated(org.apache.wicket.Component component)
          Queries all available subjects (descending sort order) for the authentication of a component.
 boolean isModelAuthenticated(org.apache.wicket.model.IModel<?> model, org.apache.wicket.Component component)
          Queries all available subjects (descending sort order) for the authentication of a model.
 void login(org.wicketstuff.security.hive.authentication.LoginContext context)
          Attempts to login through the context, if successful the subject and all its rights are included in the overall user rights.
 boolean logoff(org.wicketstuff.security.hive.authentication.LoginContext context)
          Removes the subject and all its rights associated with a certain context from this container.
 int size()
          Returns the number of Subjects contained here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginContainer

public LoginContainer()
Method Detail

login

public void login(org.wicketstuff.security.hive.authentication.LoginContext context)
           throws org.wicketstuff.security.authentication.LoginException
Attempts to login through the context, if successful the subject and all its rights are included in the overall user rights. When successful this binds the session if not already bound and marks it dirty to support cluster replication.

Parameters:
context -
Throws:
org.wicketstuff.security.authentication.LoginException - if the login fails
See Also:
LoginContext.login()

logoff

public boolean logoff(org.wicketstuff.security.hive.authentication.LoginContext context)
Removes the subject and all its rights associated with a certain context from this container.

Parameters:
context -
Returns:
true if the logoff was successful, false otherwise

getSubject

public org.wicketstuff.security.hive.authentication.Subject getSubject()
returns an immutable Subject which Contains all the principals of the subjects in the loginContexts. Note that the Subject is replaced by a new one if a login or logoff is performed, so don't keep a reference to this subject any longer then required.

Returns:
a subject

size

public int size()
Returns the number of Subjects contained here.

Returns:
the size

isModelAuthenticated

public boolean isModelAuthenticated(org.apache.wicket.model.IModel<?> model,
                                    org.apache.wicket.Component component)
Queries all available subjects (descending sort order) for the authentication of a model.

Parameters:
model - the model
component - the component holding the model
Returns:
true if at least one of the registered subjects authenticates the model, false otherwise.
See Also:
WicketSubject.isModelAuthenticated(IModel, Component)

isComponentAuthenticated

public boolean isComponentAuthenticated(org.apache.wicket.Component component)
Queries all available subjects (descending sort order) for the authentication of a component.

Parameters:
component - the component
Returns:
true if at least one of the registered subjects authenticates the component, false otherwise.
See Also:
WicketSubject.isComponentAuthenticated(Component)

isClassAuthenticated

public boolean isClassAuthenticated(Class<?> clazz)
Queries all available subjects (descending sort order) for the authentication of a class.

Parameters:
clazz - the (component) class
Returns:
true if at least one of the registered subjects authenticates the class, false otherwise.
See Also:
WicketSubject.isClassAuthenticated(Class)


Copyright © 2006–2018 Apache Software Foundation. All rights reserved.