|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.cert.LdapOperations
public final class LdapOperations
Utility class to read from and write to the ldap server holding the certificates used by the authorization framework.
Field Summary | |
---|---|
static String |
ATTRIBUTE_CERTIFICATE_ATTRIBUTE
The name of the attribute holding the attribute certificate. |
static String |
NAME_ATTRIBUTE
The name of the attribute holding the name. |
Method Summary | |
---|---|
static void |
addPmiUser(InitialLdapContext context,
String ldapPath,
String name,
byte[] certificate)
Adds a pmiUser object to an ldap. |
static InitialLdapContext |
createInitialContext(String ldapUrl,
String bindPrincipal,
String bindPrincipalPassword)
Creates a new InitialLdapContext . |
static void |
editAttribute(InitialLdapContext context,
String ldapPath,
String attributeName,
Object newValue)
Changes the value of an attribute in an ldap. |
static List<SearchResult> |
getSubtreeEntries(InitialLdapContext context,
String ldapPath,
String objectClass)
Returns all entries of a sub-tree. |
static void |
main(String[] args)
Performs some editing on a test ldap for testing and demonstration purposes. |
static void |
removeEntry(InitialLdapContext context,
String ldapPath)
Removes an entry from an ldap. |
static Object |
retrieveAttribute(InitialLdapContext context,
String ldapPath,
String attributeName)
Returns an attribute from an LDAP server as an Object . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ATTRIBUTE_CERTIFICATE_ATTRIBUTE
"attributeCertificateAttribute"
public static final String NAME_ATTRIBUTE
"name"
Method Detail |
---|
public static InitialLdapContext createInitialContext(String ldapUrl, String bindPrincipal, String bindPrincipalPassword) throws NamingException
InitialLdapContext
.
ldapUrl
- the url of the lda server e.g. "ldap://localhost:1389".bindPrincipal
- the ldap administrator's common name e.g. "cn=Directory Manager".bindPrincipalPassword
- the ldap administrator's password.
InitialLdapContext
.
NamingException
- if a naming exception is encountered.public static List<SearchResult> getSubtreeEntries(InitialLdapContext context, String ldapPath, String objectClass) throws NamingException
context
- the InitialLdapContext
referencing the ldap to be read.ldapPath
- the path of the subtree root.objectClass
- class of the object that should be retrieved.
NamingException
- if a naming exception is encountered.public static Object retrieveAttribute(InitialLdapContext context, String ldapPath, String attributeName) throws NamingException
Object
.
context
- the InitialLdapContext
referencing the ldap to be read.ldapPath
- the path of the ldap entry to be read.
Object
.
NamingException
- if a naming exception is encountered.public static void editAttribute(InitialLdapContext context, String ldapPath, String attributeName, Object newValue) throws NamingException
context
- the InitialLdapContext
referencing the ldap to be edited.ldapPath
- the path of the ldap entry to be edited.attributeName
- the name of the attribute to be edited.newValue
- the new value of the attribute.
NamingException
- if a naming exception is encountered.public static void removeEntry(InitialLdapContext context, String ldapPath) throws NamingException
context
- the InitialLdapContext
referencing the ldap to be edited.ldapPath
- the path of the ldap entry to be removed.
NamingException
- if a naming exception is encountered.public static void addPmiUser(InitialLdapContext context, String ldapPath, String name, byte[] certificate) throws NamingException
context
- the InitialLdapContext
referencing the ldap to be edited.ldapPath
- the path of the ldap entry to be added.name
- value of the 'name' attribute of the pmiUser object.certificate
- value of the 'certificate' attribute of the pmiUser object.
NamingException
- if a naming exception is encountered.public static void main(String[] args) throws NamingException
args
- not used.
NamingException
- if a naming exception is encountered.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:16:59
Copyright (c) 2002-2007 Ergon Informatik AG