net.sf.jguard.core.organization
Class Organization

java.lang.Object
  extended by net.sf.jguard.core.organization.Organization
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, java.security.Principal, CoreConstants, BasePrincipal

public class Organization
extends java.lang.Object
implements BasePrincipal, java.lang.Cloneable

an organization which can own one SubjectTemplate .

Author:
Charles Gay, Maximiliano Batelli
See Also:
Serialized Form

Field Summary
protected  java.util.Set credentials
           
protected  java.lang.Long id
           
static java.lang.String ID
           
protected  java.util.Set principals
          these objects are some references to principals present in the AuthenticationManager.
protected  SubjectTemplate subjectTemplate
           
protected  java.util.Set users
           
 
Fields inherited from interface net.sf.jguard.core.principals.BasePrincipal
serialVersionUID
 
Fields inherited from interface net.sf.jguard.core.CoreConstants
APPLICATION_HOME_PATH, APPLICATION_NAME_SYSTEM_PROPERTY, AUTHENTICATION, AUTHENTICATION_CONFIGURATION_FILE, AUTHENTICATION_DATABASE_FILE_LOCATION, AUTHENTICATION_JNDI_FILE_LOCATION, AUTHENTICATION_MANAGER, AUTHENTICATION_MANAGER_OPTIONS, AUTHENTICATION_SCHEME_HANDLER, AUTHENTICATION_SCHEME_HANDLER_NAME, AUTHENTICATION_XML_FILE_LOCATION, AUTHN_UTILS, AUTHORIZATION, AUTHORIZATION_DATABASE_FILE_LOCATION, AUTHORIZATION_MANAGER, AUTHORIZATION_MANAGER_OPTIONS, AUTHORIZATION_PERMISSION_RESOLUTION_CACHING, AUTHORIZATION_XML_FILE_LOCATION, DEBUG, DEFAULT_APPLICATION_NAME, DIGEST_ALGORITHM, FLAG, GUEST, INCLUDE_CONFIG_FROM_JAVA_PARAM, INCLUDE_OLD_CONFIG, INCLUDE_POLICY_FROM_JAVA_PARAM, JGUARD_CONFIGURATION, JVM_SCOPE, LAST_ACCESS_DENIED_PERMISSION, LOCAL_SCOPE, LOGIN_EXCEPTION_CLASS, LOGIN_EXCEPTION_MESSAGE, LOGIN_MODULE, LOGIN_MODULE_OPTIONS, LOGIN_MODULES, NAME, OPTION, OPTIONAL, POLICY_CONFIGURATION_FILE, REGISTRATION_DONE, REQUIRED, REQUISITE, SALT, SCOPE, SUFFICIENT, VALUE_MARKUP
 
Constructor Summary
Organization()
           
 
Method Summary
 void addPrincipal(java.security.Principal principal)
           
 void addPrincipalToUser(javax.security.auth.Subject user, java.lang.String roleName)
          add role from this application to user.
 void addPrincipalToUser(javax.security.auth.Subject user, java.lang.String roleName, java.lang.String applicationName)
          add a role from any application without check to user.
 java.lang.Object clone()
           
 int compareTo(java.lang.Object object)
           
 javax.security.auth.Subject createUser(javax.security.auth.Subject user)
           
 javax.security.auth.Subject createUser(SubjectTemplate user)
           
 void deleteUser(javax.security.auth.Subject user)
          remove user.
 boolean equals(java.lang.Object organization)
           
 java.util.Set getCredentials()
           
 java.lang.Long getId()
           
 java.lang.String getName()
          return the unique name of the organization.
 java.util.Set getPrincipals()
           
 SubjectTemplate getSubjectTemplate()
           
 java.util.Set getUsers()
           
 int hashCode()
           
 void removePrincipal(java.security.Principal principal)
           
 void setCredentials(java.util.Set credentials)
           
 void setId(java.lang.Long id)
           
 void setPrincipals(java.util.Set principals)
           
 void setSubjectTemplate(SubjectTemplate subjectTemplate)
           
 void setUsers(java.util.Set users)
           
 void updateUser(JGuardCredential cred, javax.security.auth.Subject user)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
toString
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values

subjectTemplate

protected SubjectTemplate subjectTemplate

principals

protected java.util.Set principals
these objects are some references to principals present in the AuthenticationManager. some of them can be owned by the Organization, which implies the ability to reorganize them, but without overrule the set of permissions granted via all of its roles references.


credentials

protected java.util.Set credentials

id

protected java.lang.Long id

users

protected java.util.Set users
Constructor Detail

Organization

public Organization()
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface BasePrincipal
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getPrincipals

public java.util.Set getPrincipals()

setPrincipals

public void setPrincipals(java.util.Set principals)

equals

public boolean equals(java.lang.Object organization)
Specified by:
equals in interface java.security.Principal
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class java.lang.Object

addPrincipal

public void addPrincipal(java.security.Principal principal)
                  throws AuthenticationException
Throws:
AuthenticationException

removePrincipal

public void removePrincipal(java.security.Principal principal)
                     throws AuthenticationException
Throws:
AuthenticationException

getSubjectTemplate

public SubjectTemplate getSubjectTemplate()

setSubjectTemplate

public void setSubjectTemplate(SubjectTemplate subjectTemplate)

createUser

public javax.security.auth.Subject createUser(SubjectTemplate user)
                                       throws AuthenticationException
Parameters:
user -
Returns:
created subject
Throws:
AuthenticationException

createUser

public javax.security.auth.Subject createUser(javax.security.auth.Subject user)
                                       throws AuthenticationException
Parameters:
user -
Returns:
created subject
Throws:
AuthenticationException

updateUser

public void updateUser(JGuardCredential cred,
                       javax.security.auth.Subject user)
                throws AuthenticationException
Parameters:
cred -
user -
Throws:
AuthenticationException

getUsers

public java.util.Set getUsers()

deleteUser

public void deleteUser(javax.security.auth.Subject user)
                throws AuthenticationException
remove user.

Parameters:
user -
Throws:
AuthenticationException

addPrincipalToUser

public void addPrincipalToUser(javax.security.auth.Subject user,
                               java.lang.String roleName)
                        throws AuthenticationException
add role from this application to user.

Parameters:
user -
roleName -
Throws:
AuthenticationException

addPrincipalToUser

public void addPrincipalToUser(javax.security.auth.Subject user,
                               java.lang.String roleName,
                               java.lang.String applicationName)
                        throws AuthenticationException
add a role from any application without check to user.

Parameters:
user -
roleName -
applicationName -
Throws:
AuthenticationException

getCredentials

public java.util.Set getCredentials()

setCredentials

public void setCredentials(java.util.Set credentials)

getName

public java.lang.String getName()
return the unique name of the organization. this name is the value of the credentrial keyed by 'id'.

Specified by:
getName in interface java.security.Principal
Returns:

compareTo

public int compareTo(java.lang.Object object)
Specified by:
compareTo in interface java.lang.Comparable

getId

public java.lang.Long getId()

setId

public void setId(java.lang.Long id)

setUsers

public void setUsers(java.util.Set users)


Copyright © 2004-2009. All Rights Reserved.