public class LDAPNovell extends LDAPModel
ACCOUNT_CANCELLED, ACCOUNT_DEACTIVATED, DOMAIN_NOT_FOUND, INTERNAL_ERROR, INVALID_PASSWORD, PASSWORD_EXPIRED, PWD_CLEAR_TEXT, PWD_DTIP_RC4, SESSION_EXPIRED, USER_NOT_FOUND, WORKAREA_NOT_FOUND, WORKAREA_NOT_SET
Constructor and Description |
---|
LDAPNovell() |
Modifier and Type | Method and Description |
---|---|
void |
addAddress(java.sql.Connection oJdbc,
java.lang.String sAddrId)
Add an address from v_ldap_contacts view to an LDAP directory
Addresses may be either public or private depending on the value of field
v_ldap_contacts.bo_private.
|
void |
addOrReplaceAddress(java.sql.Connection oJdbc,
java.lang.String sAddrId)
Add or replace an Address
This method is the same as addAddress() except that it does not raise an
LDAPException if address already exists; in that case address is just replaced.
|
void |
addOrReplaceUser(java.sql.Connection oJdbc,
java.lang.String sUserId)
Add or replace a User from v_ldap_users SQL view to the LDAP directory
|
void |
addUser(java.sql.Connection oJdbc,
java.lang.String sUserId)
Add a User from v_ldap_users view to an LDAP directory
Users are added under cn=user@mail.com,dc=users,dc=workarea_name,dc=domain_name,dc=hipergate,dc=org
|
void |
bind(java.lang.String sUser,
java.lang.String sPass)
Synchronously authenticates to the LDAP server using LDAP_V3.
|
void |
connect(java.lang.String sConnStr)
Connect to LDAP Service
At this point, there is no authentication, and any operations are conducted as an anonymous client.
|
void |
connectAndBind(java.util.Properties oProps)
Connect to LDAP Server using a Properties object
|
void |
deleteAddress(java.sql.Connection oJdbc,
java.lang.String sAddrId)
Delete an address from LDAP directory
|
void |
deleteUser(java.sql.Connection oJdbc,
java.lang.String sUserId)
Delete a User from LDAP directory
|
void |
deleteWorkArea(java.lang.String sDomainNm,
java.lang.String sWorkAreaNm)
Delete a WorkArea from the LDAP directory
All entries under dc=sDomainNm,dc=hipergate,dc=org that match dc=sWorkAreaNm are deleted
|
void |
disconnect()
Synchronously disconnects from the LDAP server
The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.
|
void |
dropAll()
Drop an entire LDAP directory
|
boolean |
exists(java.lang.String sSearchString)
Check whether or not an LDAP entry exists
The directory is searched from the connection string key.
|
void |
loadDomain(java.sql.Connection oJdbc,
int iDomainId)
Load all users and contact address from a Domain into an LDAP directory
|
void |
loadWorkArea(java.sql.Connection oJdbc,
java.lang.String sDomainNm,
java.lang.String sWorkAreaNm)
Load all users and contact address from a WorkArea into an LDAP directory
|
static void |
main(java.lang.String[] argv) |
getPartitionName, setPartitionName
public void connect(java.lang.String sConnStr) throws LDAPException
Connect to LDAP Service
At this point, there is no authentication, and any operations are conducted as an anonymous client.connect
in class LDAPModel
sConnStr
- ldap://host:port/distinguished_nameLDAPException
public void connectAndBind(java.util.Properties oProps) throws LDAPException
Connect to LDAP Server using a Properties object
connectAndBind
in class LDAPModel
oProps
- Properties for connecting to LDAP server.LDAPException
public void disconnect() throws LDAPException
Synchronously disconnects from the LDAP server
The disconnect method abandons any outstanding requests, issues an unbind request to the server, and then closes the socket.disconnect
in class LDAPModel
LDAPException
public void bind(java.lang.String sUser, java.lang.String sPass) throws LDAPException, java.lang.IllegalStateException
Synchronously authenticates to the LDAP server using LDAP_V3.
If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object has already authenticated, the old authentication is discarded.bind
in class LDAPModel
sUser
- If non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name.sPass
- If non-null and non-empty, specifies that the connection and all operations through it should be authenticated with dn as the distinguished name and passwd as password.LDAPException
java.lang.IllegalStateException
- If not conencted to LDAPpublic boolean exists(java.lang.String sSearchString) throws LDAPException
Check whether or not an LDAP entry exists
The directory is searched from the connection string key.exists
in class LDAPModel
sSearchString
- LDAP search string, for example "cn=user@mail.com,dc=publicContacts,dc=my_workarea,dc=my_domain"LDAPException
public void addAddress(java.sql.Connection oJdbc, java.lang.String sAddrId) throws LDAPException, java.sql.SQLException, java.lang.IllegalStateException
Add an address from v_ldap_contacts view to an LDAP directory
Addresses may be either public or private depending on the value of field v_ldap_contacts.bo_private. If bo_private is zero then the address is public, if bo_private is not zero then the address is private.addAddress
in class LDAPModel
oJdbc
- JDBC ConnectionsAddrId
- GUID of address to be addedLDAPException
- If address already exists at directoryjava.sql.SQLException
- If sAddrId is not found at v_ldap_contacts SQL viewjava.lang.IllegalStateException
- If not connected to LDAPpublic void addOrReplaceAddress(java.sql.Connection oJdbc, java.lang.String sAddrId) throws LDAPException, java.sql.SQLException
Add or replace an Address
This method is the same as addAddress() except that it does not raise an LDAPException if address already exists; in that case address is just replaced.addOrReplaceAddress
in class LDAPModel
oJdbc
- JDBC ConnectionsAddrId
- GUID of address to be added or replacedLDAPException
java.sql.SQLException
public void deleteAddress(java.sql.Connection oJdbc, java.lang.String sAddrId) throws LDAPException, java.sql.SQLException, java.lang.IllegalStateException
deleteAddress
in class LDAPModel
oJdbc
- JDBC ConnectionsAddrId
- GUID of address to be deletedLDAPException
java.sql.SQLException
- If sAddrId is not found at v_ldap_contacts SQL viewjava.lang.IllegalStateException
- If not connected to LDAPpublic void addUser(java.sql.Connection oJdbc, java.lang.String sUserId) throws LDAPException, java.sql.SQLException, java.lang.IllegalStateException
Add a User from v_ldap_users view to an LDAP directory
Users are added under cn=user@mail.com,dc=users,dc=workarea_name,dc=domain_name,dc=hipergate,dc=orgaddUser
in class LDAPModel
oJdbc
- JDBC ConnectionsUserId
- GUID of user to be addedLDAPException
java.sql.SQLException
- If sUserId is not found at v_ldap_users SQL viewjava.lang.IllegalStateException
- If not connected to LDAPpublic void addOrReplaceUser(java.sql.Connection oJdbc, java.lang.String sUserId) throws LDAPException, java.sql.SQLException
addOrReplaceUser
in class LDAPModel
oJdbc
- JDBC database connectionsUserId
- GUID of user to be added or replacedLDAPException
java.sql.SQLException
public void deleteUser(java.sql.Connection oJdbc, java.lang.String sUserId) throws LDAPException, java.sql.SQLException
deleteUser
in class LDAPModel
oJdbc
- JDBC ConnectionsUserId
- GUID of user to be addedLDAPException
java.sql.SQLException
- If sUserId is not found at v_ldap_users SQL viewpublic void loadDomain(java.sql.Connection oJdbc, int iDomainId) throws LDAPException, java.sql.SQLException
Load all users and contact address from a Domain into an LDAP directory
loadDomain
in class LDAPModel
oJdbc
- JDBC ConnectioniDomainId
- Numeric Identifier for DomainLDAPException
java.sql.SQLException
public void loadWorkArea(java.sql.Connection oJdbc, java.lang.String sDomainNm, java.lang.String sWorkAreaNm) throws LDAPException, java.sql.SQLException
Load all users and contact address from a WorkArea into an LDAP directory
loadWorkArea
in class LDAPModel
oJdbc
- JDBC ConnectionsDomainNm
- Name for Domain containing the WorkAreasWorkAreaNm
- WorkArea NameLDAPException
java.sql.SQLException
public void deleteWorkArea(java.lang.String sDomainNm, java.lang.String sWorkAreaNm) throws LDAPException, java.lang.IllegalStateException
Delete a WorkArea from the LDAP directory
All entries under dc=sDomainNm,dc=hipergate,dc=org that match dc=sWorkAreaNm are deleteddeleteWorkArea
in class LDAPModel
sDomainNm
- Domain NamesWorkAreaNm
- WorkArea NameLDAPException
java.lang.IllegalStateException
- If not connected to LDAPpublic void dropAll() throws LDAPException, java.lang.IllegalStateException
dropAll
in class LDAPModel
LDAPException
java.lang.IllegalStateException
- If not connected to LDAPpublic static void main(java.lang.String[] argv) throws java.lang.ClassNotFoundException, java.io.IOException, java.sql.SQLException, LDAPException
java.lang.ClassNotFoundException
java.io.IOException
java.sql.SQLException
LDAPException