资源简介
java连接LDAP实例和jar包,里面包含ssl连接和更改LDAP属性的例子,公参考
代码片段和文件信息
/*******************************************************************************
* $Novell: AddEntry.javav 1.15 2003/08/21 11:28:45 $
* Copyright (c) 2000-2003 Novell Inc. All Rights Reserved.
*
* THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND
* TREATIES. USE AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO THE LICENSE
* AGREEMENT ACCOMPANYING THE SOFTWARE DEVELOPMENT KIT (SDK) THAT CONTAINS
* THIS WORK. PURSUANT TO THE SDK LICENSE AGREEMENT NOVELL HEREBY GRANTS TO
* DEVELOPER A ROYALTY-FREE NON-EXCLUSIVE LICENSE TO INCLUDE NOVELL‘S SAMPLE
* CODE IN ITS PRODUCT. NOVELL GRANTS DEVELOPER WORLDWIDE DISTRIBUTION RIGHTS
* TO MARKET DISTRIBUTE OR SELL NOVELL‘S SAMPLE CODE AS A COMPONENT OF
* DEVELOPER‘S PRODUCTS. NOVELL SHALL HAVE NO OBLIGATIONS TO DEVELOPER OR
* DEVELOPER‘S CUSTOMERS WITH RESPECT TO THIS CODE.
*
* $name: AddEntry.java
* $description: AddEntry adds an entry to the directory. First it creates
* each attribute of the entry adds it to the attribute
* set and then uses the DN and the newly created attribute
* set to create an LDAPEntry entry newEntry. Finally it calls
* the LDAPConnection add method to add the entry into the
* directory.
******************************************************************************/
import com.novell.ldap.LDAPAttribute;
import com.novell.ldap.LDAPAttributeSet;
import com.novell.ldap.LDAPEntry;
import com.novell.ldap.LDAPConnection;
import com.novell.ldap.LDAPException;
import java.io.UnsupportedEncodingException;
public class AddEntry
{
public static void main( String[] args )
{
if (args.length != 4) {
System.err.println(“Usage: java AddEntry “
+ “ “);
System.err.println(“Example: java AddEntry Acme.com“
+ “ \“cn=admino=Acme\“ secret \“ou=Saleso=Acme\““);
System.exit(1);
}
int ldapPort = LDAPConnection.DEFAULT_PORT;
int ldapVersion = LDAPConnection.LDAP_V3;
String ldapHost = args[0];
String loginDN = args[1];
String password = args[2];
String containerName = args[3];
LDAPConnection lc = new LDAPConnection();
LDAPAttribute attribute = null;
LDAPAttributeSet attributeSet = new LDAPAttributeSet();
/* To Add an entry to the directory
* - Create the attributes of the entry and add them to an attribute set
* - Specify the DN of the entry to be created
* - Create an LDAPEntry object with the DN and the attribute set
* - Call the LDAPConnection add method to add it to the directory
*/
attributeSet.add( new LDAPAttribute(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-11-21 06:14 novell-jldap-devel-2013.08.30.1433-xplat\
目录 0 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\
文件 1464 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldaprootdse.bat
文件 1111 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldaprootdse
文件 1118 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldapschema
文件 1114 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldapsearch
文件 1467 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldapsearch.bat
文件 967 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\getpath.bat
文件 1122 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldappassword
文件 1471 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldapschema.bat
文件 1475 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\bin\jldappassword.bat
目录 0 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\lib\
文件 432436 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\lib\ldap.jar
文件 44107 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\lib\utilities.jar
目录 0 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\wars\
文件 579337 2009-10-16 15:53 novell-jldap-devel-2013.08.30.1433-xplat\wars\dsmlstream.war
文件 2303152 2009-10-16 15:53 novell-jldap-devel-2013.08.30.1433-xplat\wars\dsmldom.war
文件 2033 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\LICENSE
目录 0 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\
文件 4326 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\SetPassword.java
文件 5882 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\UrlSearch.java
文件 5637 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\LDAPSchemaDSMLSerialization.java
文件 20448 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\GetDSE.java
文件 3587 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\VerifyPassword.java
文件 8252 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\ModifyAttrs.java
文件 14325 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\ExtendSchema.java
文件 9348 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\ModifyTimeStamp.java
文件 5614 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\MD5Bind.java
目录 0 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\dsml_consumers\
文件 1678 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\dsml_consumers\DsmlClient.java
文件 3776 2013-08-30 09:03 novell-jldap-devel-2013.08.30.1433-xplat\samples\dsml_consumers\LDAPOperation.java
............此处省略101个文件信息
- 上一篇:使用JNA的jar包
- 下一篇:BBS系统,JSP做的
相关资源
- mysql数据处理,java用户登录处理
- 法律咨询信息系统(java+jsp+sqlserver)
- Java快速开发平台源码(renren-fast)
- 锐聘学院QST青软JavaWeb十二个打包
- 3.3.6微信支付JAVA版demo
- javaweb网上购物系统源码(附数据库脚
- javaweb校园宿舍系统(附数据库脚本)
- JavaWeb书城项目(附数据库脚本)
- 基于JAVA_JSP电子书系统(源码+数据库
- Java网络编程知识点总结.xmind
- 一站式Java网络编程 BIO-NIO-AIO资料源码
- jsp讲解
- 基于SSH框架的JavaWeb项目—人员信息管
- javaweb实现的邮件收发系统(附数据库
- Java 仿QQ(附客户端以及服务端源码)
- Java TCP IP Socket
- java定时发送邮件(基于quartz)
- Java Swing开发的《星际争霸》游戏
- java+数据库商品交易管理系统(附数据
- 使用java语言编译一个计算器
- java swing工资管理系统(源码+数据库
- JAVALibrary
- 微信企业号回调模式Java版
- 顺丰丰桥接口开发详细教程源码含下
- Java博客概要设计文档
- 药品进销存管理系统(论文范文_JSP
- 奖学金管理系统java+jsp+mysql
- 毕设参考——基于java酒店管理
- Java写的一个简单的字体更改程序
- java8学习教程之lambda表达式的使用方法
评论
共有 条评论