com.xpn.xwiki.user.impl.LDAP
Class LDAPProfileXClass

java.lang.Object
  extended by com.xpn.xwiki.user.impl.LDAP.LDAPProfileXClass

public class LDAPProfileXClass
extends Object

Helper to manager LDAP profile XClass and XObject.

Version:
$Id: 4796bc30050bff6aa5559b61f98bc0d4a7ec4461 $

Field Summary
static String LDAP_XCLASS
           
static String LDAP_XFIELD_DN
           
static String LDAP_XFIELD_UID
           
static String LDAP_XFIELDPN_DN
           
static String LDAP_XFIELDPN_UID
           
static EntityReference LDAPPROFILECLASS_REFERENCE
           
 
Constructor Summary
LDAPProfileXClass(XWikiContext context)
           
 
Method Summary
 String getDn(BaseObject ldapObject)
           
 String getDn(XWikiDocument userDocument)
           
 String getUid(BaseObject ldapObject)
           
 String getUid(XWikiDocument userDocument)
           
 String searchDn(String uid)
          Search the LDAP user DN stored in an existing user profile with provided LDAP user uid stored.
 XWikiDocument searchDocumentByUid(String uid)
          Search the XWiki storage for a existing user profile with provided LDAP user uid stored.
 void updateLDAPObject(String xwikiUserName, String dn, String uid)
          Update or create LDAP profile of an existing user profile with provided LDAP user informations.
 boolean updateLDAPObject(XWikiDocument userDocument, String dn, String uid)
          Update LDAP profile object with provided LDAP user informations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LDAP_XCLASS

public static final String LDAP_XCLASS
See Also:
Constant Field Values

LDAP_XFIELD_DN

public static final String LDAP_XFIELD_DN
See Also:
Constant Field Values

LDAP_XFIELDPN_DN

public static final String LDAP_XFIELDPN_DN
See Also:
Constant Field Values

LDAP_XFIELD_UID

public static final String LDAP_XFIELD_UID
See Also:
Constant Field Values

LDAP_XFIELDPN_UID

public static final String LDAP_XFIELDPN_UID
See Also:
Constant Field Values

LDAPPROFILECLASS_REFERENCE

public static final EntityReference LDAPPROFILECLASS_REFERENCE
Constructor Detail

LDAPProfileXClass

public LDAPProfileXClass(XWikiContext context)
                  throws XWikiException
Throws:
XWikiException
Method Detail

getDn

public String getDn(XWikiDocument userDocument)
Parameters:
userDocument - the user profile page.
Returns:
the dn store in the user profile. Null if it can't find any or if it's empty.

getDn

public String getDn(BaseObject ldapObject)
Parameters:
ldapObject - the ldap profile object.
Returns:
the dn store in the user profile. Null if it can't find any or if it's empty.

getUid

public String getUid(XWikiDocument userDocument)
Parameters:
userDocument - the user profile page.
Returns:
the uid store in the user profile. Null if it can't find any or if it's empty.

getUid

public String getUid(BaseObject ldapObject)
Parameters:
ldapObject - the ldap profile object.
Returns:
the uid store in the user profile. Null if it can't find any or if it's empty.

updateLDAPObject

public void updateLDAPObject(String xwikiUserName,
                             String dn,
                             String uid)
                      throws XWikiException
Update or create LDAP profile of an existing user profile with provided LDAP user informations.

Parameters:
xwikiUserName - the name of the XWiki user to update LDAP profile.
dn - the dn to store in the LDAP profile.
uid - the uid to store in the LDAP profile.
Throws:
XWikiException - error when storing information in user profile.

updateLDAPObject

public boolean updateLDAPObject(XWikiDocument userDocument,
                                String dn,
                                String uid)
Update LDAP profile object with provided LDAP user informations.

Parameters:
userDocument - the user profile page to update.
dn - the dn to store in the LDAP profile.
uid - the uid to store in the LDAP profile.
Returns:
true if modifications has been made to provided user profile, false otherwise.

searchDocumentByUid

public XWikiDocument searchDocumentByUid(String uid)
Search the XWiki storage for a existing user profile with provided LDAP user uid stored.

If more than one profile is found the first one in returned and an error is logged.

Parameters:
uid - the LDAP unique id.
Returns:
the user profile containing LDAP uid.

searchDn

public String searchDn(String uid)
Search the LDAP user DN stored in an existing user profile with provided LDAP user uid stored.

If more than one profile is found the first one in returned and an error is logged.

Parameters:
uid - the LDAP unique id.
Returns:
the found LDAP DN, null if it can't find one or if it's empty.


Copyright © 2004–2014 XWiki. All rights reserved.