org.jboss.reliance.drools.core.security
Class RuleBasedIdentity

java.lang.Object
  extended by org.jboss.reliance.identity.Identity
      extended by org.jboss.reliance.drools.core.security.RuleBasedIdentity
All Implemented Interfaces:
RuleDependencyCheck

public class RuleBasedIdentity
extends org.jboss.reliance.identity.Identity
implements RuleDependencyCheck

Drools based identity.

Author:
Shane Bryzak, Ales Justin

Field Summary
 
Fields inherited from class org.jboss.reliance.identity.Identity
log, ROLES_GROUP
 
Constructor Summary
RuleBasedIdentity()
           
 
Method Summary
 boolean addRole(String role)
           
 void authenticate()
           
 void authenticate(LoginContext loginContext)
           
 boolean canResolve(Object name, Object action, Object... arg)
          Performs a check for the specified name and action if they can be resolved.
 void create()
           
 org.drools.StatefulSession getSecurityContext()
          Get the statefull session.
 boolean isLoggedIn()
           
 boolean isLoggedIn(boolean attemptLogin)
           
 boolean login()
           
protected  void postAuthenticate()
           
 void quietLogin()
           
 void removeRole(String role)
           
 void setSecurityContext(org.drools.StatefulSession securityContext)
          Set statefull session.
 void setSecurityRules(org.drools.RuleBase securityRules)
          Set the rule base.
protected  void unAuthenticate()
           
 
Methods inherited from class org.jboss.reliance.identity.Identity
getDefaultCallbackHandler, getJaasConfigName, getLoginContext, getPassword, getPrincipal, getSubject, getUsername, hasRole, isCredentialsSet, logout, preAuthenticate, setConfiguration, setJaasConfigName, setPassword, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleBasedIdentity

public RuleBasedIdentity()
Method Detail

create

public void create()
Overrides:
create in class org.jboss.reliance.identity.Identity

postAuthenticate

protected void postAuthenticate()
Overrides:
postAuthenticate in class org.jboss.reliance.identity.Identity

canResolve

public boolean canResolve(Object name,
                          Object action,
                          Object... arg)
Description copied from interface: RuleDependencyCheck
Performs a check for the specified name and action if they can be resolved.

Specified by:
canResolve in interface RuleDependencyCheck
Parameters:
name - Object The permission name
action - Obejct The permission action
arg - Object Optional object parameter used to make a permission decision
Returns:
boolean true if the user has the specified permission

unAuthenticate

protected void unAuthenticate()
Overrides:
unAuthenticate in class org.jboss.reliance.identity.Identity

addRole

public boolean addRole(String role)
Overrides:
addRole in class org.jboss.reliance.identity.Identity

removeRole

public void removeRole(String role)
Overrides:
removeRole in class org.jboss.reliance.identity.Identity

getSecurityContext

public org.drools.StatefulSession getSecurityContext()
Get the statefull session.

Returns:
statefull session

setSecurityContext

public void setSecurityContext(org.drools.StatefulSession securityContext)
Set statefull session.

Parameters:
securityContext - the session

setSecurityRules

public void setSecurityRules(org.drools.RuleBase securityRules)
Set the rule base.

Parameters:
securityRules - the rule base instance

login

public boolean login()
Overrides:
login in class org.jboss.reliance.identity.Identity

quietLogin

public void quietLogin()
Overrides:
quietLogin in class org.jboss.reliance.identity.Identity

authenticate

public void authenticate()
                  throws LoginException
Overrides:
authenticate in class org.jboss.reliance.identity.Identity
Throws:
LoginException

authenticate

public void authenticate(LoginContext loginContext)
                  throws LoginException
Overrides:
authenticate in class org.jboss.reliance.identity.Identity
Throws:
LoginException

isLoggedIn

public boolean isLoggedIn()
Overrides:
isLoggedIn in class org.jboss.reliance.identity.Identity

isLoggedIn

public boolean isLoggedIn(boolean attemptLogin)
Overrides:
isLoggedIn in class org.jboss.reliance.identity.Identity


Copyright © 2008 JBoss Inc.. All Rights Reserved.