当前位置: 首页>>代码示例>>Java>>正文


Java LDAPException.OPERATIONS_ERROR属性代码示例

本文整理汇总了Java中com.novell.ldap.LDAPException.OPERATIONS_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java LDAPException.OPERATIONS_ERROR属性的具体用法?Java LDAPException.OPERATIONS_ERROR怎么用?Java LDAPException.OPERATIONS_ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.novell.ldap.LDAPException的用法示例。


在下文中一共展示了LDAPException.OPERATIONS_ERROR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

@Override
public void configure(String name, Properties props, NameSpace nameSpace)
		throws LDAPException {
	LDIFReader reader = null;
	
	try {
		reader = new LDIFReader(new FileInputStream(new File(props.getProperty("schemaLDIF"))));
		this.schemaEntry = ((LDAPSearchResult) reader.readMessage()).getEntry();
	} catch (Exception e) {
		throw new LDAPException("Could not start Schema insert",LDAPException.OPERATIONS_ERROR,e.toString(),e);
	}

	this.name = name;
	

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:16,代码来源:SchemaInsert.java

示例2: search

@Override
public void search(SearchInterceptorChain chain, DistinguishedName base,
		Int scope, Filter filter, ArrayList<Attribute> attributes,
		Bool typesOnly, Results results, LDAPSearchConstraints constraints)
		throws LDAPException {
	try {
		chain.nextSearch(base, scope, filter, attributes, typesOnly, results, constraints);
	} catch (Throwable t) {
		if (this.isRequired) {
			if (t instanceof LDAPException) {
				throw (LDAPException) t;
			} else {
				throw new LDAPException("Could not execute search",LDAPException.OPERATIONS_ERROR,"Operations error",t);
			}
			
		} else {
			StringBuffer logline = new StringBuffer();
			logline.append("Could not execute search on ").append(this.name);
			logger.warn(logline,t);
		}
	}

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:23,代码来源:RequiredForSearch.java

示例3: bind

public void bind(BindInterceptorChain chain, DistinguishedName dn,
		Password pwd, LDAPConstraints constraints) throws LDAPException {
	Connection con = null;
	
	chain.getRequest().put(JdbcInsert.MYVD_DID_BIND + this.name, false);
	
	try {
		con = this.getCon();
		chain.getRequest().put(JdbcInsert.MYVD_DB_CON + this.name, con);
		chain.nextBind(dn, pwd, constraints);
	} catch (Throwable t) {
		if (t instanceof LDAPException) {
			throw (LDAPException) t;
		} else {
			throw new LDAPException("Error",LDAPException.OPERATIONS_ERROR,"Error",t);
		}
		
	} finally {
		unloadRequest(chain, con);
		if (! ((Boolean) chain.getRequest().get(MYVD_DID_BIND + this.name))) {
			throw new LDAPException(LDAPException.resultCodeToString(LDAPException.INVALID_CREDENTIALS),LDAPException.INVALID_CREDENTIALS,"No authentication occurred");
		}
	}

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:25,代码来源:JdbcInsert.java

示例4: modify

public void modify(ModifyInterceptorChain chain, DistinguishedName dn,
		ArrayList<LDAPModification> mods, LDAPConstraints constraints)
		throws LDAPException {
	Connection con = null;
	
	try {
		con = this.getCon();
		this.loadRequest(chain, con);
		chain.nextModify(dn, mods, constraints);
	} catch (Throwable t) {
		if (t instanceof LDAPException) {
			throw (LDAPException) t;
		} else {
			throw new LDAPException("Error",LDAPException.OPERATIONS_ERROR,"Error",t);
		}
		
	} finally {
		unloadRequest(chain, con);
	}

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:21,代码来源:JdbcInsert.java

示例5: findJdbcInsert

private synchronized void findJdbcInsert() throws LDAPException {
	if (this.jdbc != null) {
		return;
	}
	
	for (int i=0;i<this.ns.getChain().getLength();i++) {
		if (this.ns.getChain().getInsert(i) instanceof JdbcPool) {
			this.jdbc = (JdbcPool) this.ns.getChain().getInsert(i);
			break;
		}
	}
	
	if (this.jdbc == null) {
		throw new LDAPException("No Jdbc Insert found on this chain",LDAPException.OPERATIONS_ERROR,LDAPException.resultCodeToString(LDAPException.OPERATIONS_ERROR));
	}
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:16,代码来源:SimpleDBAuth.java

示例6: postSearchComplete

public void postSearchComplete(PostSearchCompleteInterceptorChain chain,
		DistinguishedName base, Int scope, Filter filter,
		ArrayList<Attribute> attributes, Bool typesOnly,
		LDAPSearchConstraints constraints) throws LDAPException {
	if (chain.getRequest().containsKey(FLAG)) {
		throw new LDAPException("Insert called twice",LDAPException.OPERATIONS_ERROR,"");
	}
	
	chain.getRequest().put(FLAG,FLAG);
	chain.nextPostSearchComplete(base,scope,filter,attributes,typesOnly,constraints);
	chain.getRequest().remove(FLAG);
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:12,代码来源:ExceptionInterceptor.java

示例7: search

public void search(SearchInterceptorChain chain, DistinguishedName base,
		Int scope, Filter filter, ArrayList<Attribute> attributes,
		Bool typesOnly, Results results, LDAPSearchConstraints constraints)
		throws LDAPException {
	if (chain.getRequest().containsKey(FLAG)) {
		throw new LDAPException("Insert called twice",LDAPException.OPERATIONS_ERROR,"");
	}
	
	chain.getRequest().put(FLAG,FLAG);
	chain.nextSearch(base,scope,filter,attributes,typesOnly,results,constraints);

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:12,代码来源:ExceptionInterceptor.java

示例8: add

public void add(AddInterceptorChain chain, Entry entry,
		LDAPConstraints constraints) throws LDAPException {
	
	long start = System.currentTimeMillis();
	long end = 0;
	int result = -1;
	Int op = new Int(0);
	Int con = new Int(0);
	
	this.getOpNum(chain.getSession(), con, op);
	
	StringBuffer buf = new StringBuffer("ADD op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(entry.getEntry().getDN()).append("'");
	
	logger.info(buf.toString());
	
	try {
		chain.nextAdd(entry, constraints);
		result = 0;
	} catch (LDAPException le) {
		result = le.getResultCode();
		throw le;
	} finally {
		end = System.currentTimeMillis();
		if (result == -1) {
			result = LDAPException.OPERATIONS_ERROR;
		}
		
		buf.setLength(0);
		buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end-start);
		logger.info(buf.toString());
		
	}

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:34,代码来源:AccessLog.java

示例9: add

public void add(AddInterceptorChain chain, Entry entry,
		LDAPConstraints constraints) throws LDAPException {
	Connection con = (Connection) chain.getRequest().get(JdbcInsert.MYVD_DB_CON + this.dbInsertName);
	
	if (con == null) {
		throw new LDAPException("Operations Error",LDAPException.OPERATIONS_ERROR,"No Database Connection");
	}
	
	addEntry(chain, entry, con);

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:11,代码来源:DBAddOnModify.java

示例10: delete

public void delete(DeleteInterceptorChain chain, DistinguishedName dn,
		LDAPConstraints constraints) throws LDAPException {
	Connection con = (Connection) chain.getRequest().get(JdbcInsert.MYVD_DB_CON + this.dbInsertName);
	
	if (con == null) {
		throw new LDAPException("Operations Error",LDAPException.OPERATIONS_ERROR,"No Database Connection");
	}
	
	try {
		// begin the transaction
		con.setAutoCommit(false);
		String uid = ((RDN) dn.getDN().getRDNs().get(0)).getValue();
		
		PreparedStatement ps = con.prepareStatement(this.deleteSQL);
		ps.setString(1, uid);
		ps.executeUpdate();
		
		con.commit();
	} catch (SQLException e) {
		try {
			con.rollback();
			
		} catch (SQLException e1) {
			throw new LDAPException("Could not delete entry or rollback transaction",LDAPException.OPERATIONS_ERROR,e.toString(),e);
		}
		throw new LDAPException("Could not delete entry",LDAPException.OPERATIONS_ERROR,e.toString(),e);
	}

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:29,代码来源:DBTableUpdate.java

示例11: postSearchEntry

public void postSearchEntry(PostSearchEntryInterceptorChain chain,
		Entry entry, DistinguishedName base, Int scope, Filter filter,
		ArrayList<Attribute> attributes, Bool typesOnly,
		LDAPSearchConstraints constraints) throws LDAPException {
	if (chain.getRequest().containsKey(FLAG)) {
		throw new LDAPException("Insert called twice",LDAPException.OPERATIONS_ERROR,"");
	}
	
	chain.getRequest().put(FLAG,FLAG);
	chain.nextPostSearchEntry(entry,base,scope,filter,attributes,typesOnly,constraints);
	chain.getRequest().remove(FLAG);
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:12,代码来源:ExceptionInterceptor.java

示例12: modify

public void modify(ModifyInterceptorChain chain, DistinguishedName dn,
		ArrayList<LDAPModification> mods, LDAPConstraints constraints)
		throws LDAPException {
	if (chain.getRequest().containsKey(FLAG)) {
		throw new LDAPException("Insert called twice",LDAPException.OPERATIONS_ERROR,"");
	}
	
	chain.getRequest().put(FLAG,FLAG);
	chain.nextModify(dn,mods,constraints);

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:11,代码来源:ExceptionInterceptor.java

示例13: search

public void search(SearchInterceptorChain chain, DistinguishedName base, Int scope, Filter filter, ArrayList<Attribute> attributes, Bool typesOnly, Results results, LDAPSearchConstraints constraints) throws LDAPException {
	FilterNode newRoot;
	try {
		newRoot = (FilterNode) filter.getRoot().clone();
	} catch (CloneNotSupportedException e) {
		throw new LDAPException("Could not map filter " + e.toString(),LDAPException.OPERATIONS_ERROR,"");
	}
	this.renameFilter(newRoot);
	
	chain.nextSearch(base,scope,new Filter(newRoot),attributes,typesOnly,results,constraints);
	
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:12,代码来源:AttributeValueMapper.java

示例14: delete

public void delete(DeleteInterceptorChain chain, DistinguishedName dn,
		LDAPConstraints constraints) throws LDAPException {
	if (chain.getRequest().containsKey(FLAG)) {
		throw new LDAPException("Insert called twice",LDAPException.OPERATIONS_ERROR,"");
	}
	
	chain.getRequest().put(FLAG,FLAG);
	chain.nextDelete(dn,constraints);

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:10,代码来源:ExceptionInterceptor.java

示例15: compare

public void compare(CompareInterceptorChain chain, DistinguishedName dn,
		Attribute attrib, LDAPConstraints constraints) throws LDAPException {
	long start = System.currentTimeMillis();
	long end = 0;
	int result = -1;
	Int op = new Int(0);
	Int con = new Int(0);
	
	this.getOpNum(chain.getSession(), con, op);
	
	StringBuffer buf = new StringBuffer("COMPARE op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" dn='").append(dn.getDN()).append("' attribute='").append(attrib.getAttribute().getName()).append("' value='").append(attrib.getAttribute().getName()).append("'");
	
	logger.info(buf.toString());
	
	try {
		chain.nextCompare(dn, attrib, constraints);
		result = 0;
	} catch (LDAPException le) {
		result = le.getResultCode();
		throw le;
	} finally {
		end = System.currentTimeMillis();
		if (result == -1) {
			result = LDAPException.OPERATIONS_ERROR;
		}
		
		buf.setLength(0);
		buf.append("RESULT op=").append(op.getValue()).append(" con=").append(con.getValue()).append(" result=").append(result).append(" time=").append(end-start);
		logger.info(buf.toString());
		
	}

}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:33,代码来源:AccessLog.java


注:本文中的com.novell.ldap.LDAPException.OPERATIONS_ERROR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。