org.apache.jetspeed.om.security.ldap
Class LDAPRole

java.lang.Object
  extended byorg.apache.jetspeed.om.security.ldap.BaseLDAPObject
      extended byorg.apache.jetspeed.om.security.ldap.LDAPRole
All Implemented Interfaces:
javax.naming.Context, javax.naming.directory.DirContext, Role

public class LDAPRole
extends BaseLDAPObject
implements Role

Version:
$Id: LDAPRole.java,v 1.6 2004/02/23 03:12:13 jford Exp $
Author:
Ender KILICOGLU, Sami Leino

Field Summary
protected static java.lang.String ATTR_ROLE_ID
           
protected static java.lang.String ATTR_ROLE_NAME
           
protected static java.lang.String ATTR_ROLE_PERMISSIONS
           
protected  java.lang.String id
           
protected  boolean isNew
           
protected  java.lang.String name
           
protected static java.lang.String OBJECT_CLASS
           
protected static java.lang.String ORGANIZATIONAL_UNIT
           
protected  java.util.Vector rolePermissions
           
 
Fields inherited from class org.apache.jetspeed.om.security.ldap.BaseLDAPObject
Id, LDAP_DATE_PATTERN, ldapurl, myAttrs, OK, rmAttrs, updated
 
Fields inherited from interface javax.naming.directory.DirContext
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
LDAPRole()
           
LDAPRole(LDAPURL ldapurl)
           
LDAPRole(java.lang.String id)
           
LDAPRole(java.lang.String name, boolean isNew)
           
 
Method Summary
 void addRolePermissions(java.lang.String rolePermission)
           
 java.lang.String getId()
          Get the id of the Role
 java.lang.String getName()
          Get the name of the Role
 java.util.Vector getRolePermissions()
           
 boolean isNew()
           
 boolean permissionExists(java.lang.String rolePermission)
           
 void removePreviousPermissionsFromLDAP()
           
 void removeRolePermissions(java.lang.String rolePermission)
           
 void setId(java.lang.String id)
          Set the id of the Role
 void setName(java.lang.String roleName)
          Set the name of the Role
 javax.naming.directory.Attribute toAttribute(java.lang.String id, java.util.Vector values)
           
 void update(boolean create)
           
 
Methods inherited from class org.apache.jetspeed.om.security.ldap.BaseLDAPObject
addToEnvironment, bind, bind, bind, bind, close, composeName, composeName, createId, createSubcontext, createSubcontext, createSubcontext, createSubcontext, deserializePerm, destroySubcontext, destroySubcontext, fastgetutil, formatDate, getAttributes, getAttributes, getAttributes, getAttributes, getEnvironment, getldapurl, getNameInNamespace, getNameParser, getNameParser, getSchema, getSchema, getSchemaClassDefinition, getSchemaClassDefinition, getupdated, getutil, getutil, getutil, getutil, isOK, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, modifyAttributes, modifyAttributes, modifyAttributes, modifyAttributes, parseDate, parseDate, rebind, rebind, rebind, rebind, removeFromEnvironment, removeutil, rename, rename, search, search, search, search, search, search, search, search, serializePerm, setLdapUrl, setObjectClass, setObjectClasses, setutil, setutil, setutil, setutil, toString, unbind, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OBJECT_CLASS

protected static final java.lang.String OBJECT_CLASS
See Also:
Constant Field Values

ORGANIZATIONAL_UNIT

protected static final java.lang.String ORGANIZATIONAL_UNIT
See Also:
Constant Field Values

ATTR_ROLE_PERMISSIONS

protected static final java.lang.String ATTR_ROLE_PERMISSIONS
See Also:
Constant Field Values

ATTR_ROLE_NAME

protected static final java.lang.String ATTR_ROLE_NAME
See Also:
Constant Field Values

ATTR_ROLE_ID

protected static final java.lang.String ATTR_ROLE_ID
See Also:
Constant Field Values

name

protected java.lang.String name

id

protected java.lang.String id

rolePermissions

protected java.util.Vector rolePermissions

isNew

protected boolean isNew
Constructor Detail

LDAPRole

public LDAPRole()

LDAPRole

public LDAPRole(java.lang.String id)

LDAPRole

public LDAPRole(java.lang.String name,
                boolean isNew)

LDAPRole

public LDAPRole(LDAPURL ldapurl)
Method Detail

update

public void update(boolean create)
            throws RoleException
Throws:
RoleException

removePreviousPermissionsFromLDAP

public void removePreviousPermissionsFromLDAP()

toAttribute

public javax.naming.directory.Attribute toAttribute(java.lang.String id,
                                                    java.util.Vector values)

getName

public java.lang.String getName()
Get the name of the Role

Specified by:
getName in interface Role
Overrides:
getName in class BaseLDAPObject
Returns:
the name of the role.

setName

public void setName(java.lang.String roleName)
Set the name of the Role

Specified by:
setName in interface Role
Overrides:
setName in class BaseLDAPObject
Parameters:
roleName - the name of the Role.

getId

public java.lang.String getId()
Get the id of the Role

Specified by:
getId in interface Role
Overrides:
getId in class BaseLDAPObject
Returns:
the id of the role.

setId

public void setId(java.lang.String id)
Set the id of the Role

Specified by:
setId in interface Role
Overrides:
setId in class BaseLDAPObject
Parameters:
id - the new id for the role

isNew

public boolean isNew()
Overrides:
isNew in class BaseLDAPObject

getRolePermissions

public java.util.Vector getRolePermissions()

addRolePermissions

public void addRolePermissions(java.lang.String rolePermission)

removeRolePermissions

public void removeRolePermissions(java.lang.String rolePermission)

permissionExists

public boolean permissionExists(java.lang.String rolePermission)


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.