• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ObjectClass类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.identityconnectors.framework.common.objects.ObjectClass的典型用法代码示例。如果您正苦于以下问题:Java ObjectClass类的具体用法?Java ObjectClass怎么用?Java ObjectClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectClass类属于org.identityconnectors.framework.common.objects包,在下文中一共展示了ObjectClass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createRandkeyTest

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
public void createRandkeyTest() {
	logger.info("Running Create Randkey Test");

	final String principal = "host/[email protected]" + realm;
	final String policy = "default_nohistory";
	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);
	ConnectorObject co;

	Set<Attribute> createAttributes = new HashSet<Attribute>();
	createAttributes.add(new Name(principal));
	createAttributes.add(AttributeBuilder.build("policy", policy));
	createAttributes.add(AttributeBuilder.build("requiresPreauth", true));
	Uid uid = facade.create(ObjectClass.ACCOUNT, createAttributes, null);
	Assert.assertEquals(uid.getUidValue(), principal);

	co = facade.getObject(ObjectClass.ACCOUNT, new Uid(principal), null);
	Assert.assertNotNull(co);
	Assert.assertTrue(AttributeUtil.getBooleanValue(co.getAttributeByName("requiresPreauth")));
	Assert.assertEquals((int)AttributeUtil.getIntegerValue(co.getAttributeByName("attributes")), 128);
	Assert.assertEquals(AttributeUtil.getStringValue(co.getAttributeByName("policy")), policy);
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:23,代码来源:KerberosConnectorTests.java


示例2: exactSearchTest

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
public void exactSearchTest() {
	logger.info("Running Exact Search Test");

	final String principal = "user2";
	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);
	final OperationOptionsBuilder builder = new OperationOptionsBuilder();
	builder.setPageSize(10);

	final ResultsHandler handler = new ToListResultsHandler();
	SearchResult result = facade.search(ObjectClass.ACCOUNT, FilterBuilder.equalTo(new Name(principal)), handler, builder.build());
	Assert.assertEquals(result.getPagedResultsCookie(), "NO_COOKIE");
	Assert.assertEquals(((ToListResultsHandler) handler).getObjects().size(), 1);

	final ResultsHandler handler2 = new ToListResultsHandler();
	result = facade.search(ObjectClass.ACCOUNT, FilterBuilder.equalTo(new Uid(principal)), handler2, builder.build());
	Assert.assertEquals(((ToListResultsHandler) handler2).getObjects().size(), 1);

	final ResultsHandler handler3 = new ToListResultsHandler();
	result = facade.search(ObjectClass.ACCOUNT, FilterBuilder.equalTo(new Uid(principal + "@" + realm)), handler3, builder.build());
	Assert.assertEquals(((ToListResultsHandler) handler3).getObjects().size(), 1);
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:23,代码来源:KerberosConnectorTests.java


示例3: endsWithSearchTest

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
public void endsWithSearchTest() {
	logger.info("Running \"Ends with\" Search Test");
	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);
	final OperationOptionsBuilder builder = new OperationOptionsBuilder();
	ResultsHandler handler;
	builder.setPageSize(10);

	handler = new ToListResultsHandler();
	SearchResult result =
			facade.search(ObjectClass.ACCOUNT, FilterBuilder.endsWith(new Name("3")), handler,
					builder.build());
	Assert.assertEquals(result.getPagedResultsCookie(), "NO_COOKIE");
	Assert.assertEquals(((ToListResultsHandler) handler).getObjects().size(), 1);

	handler = new ToListResultsHandler();
	result =
			facade.search(ObjectClass.ACCOUNT, FilterBuilder.endsWith(new Name("[email protected]" + realm)), handler,
					builder.build());
	Assert.assertEquals(result.getPagedResultsCookie(), "NO_COOKIE");
	Assert.assertEquals(((ToListResultsHandler) handler).getObjects().size(), 1);
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:23,代码来源:KerberosConnectorTests.java


示例4: searchAllTest

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
/**
 * Test search with empty filter.
 */
public void searchAllTest() {
	logger.info("Running Search All Test");

	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);
	final OperationOptionsBuilder builder = new OperationOptionsBuilder();
	builder.setPageSize(10);
	final ResultsHandler handler = new ToListResultsHandler();

	SearchResult result =
			facade.search(ObjectClass.ACCOUNT, null, handler,
					builder.build());
	Assert.assertEquals(result.getPagedResultsCookie(), "NO_COOKIE");
	Assert.assertTrue(((ToListResultsHandler) handler).getObjects().size() > 1);
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:19,代码来源:KerberosConnectorTests.java


示例5: renameTest

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
public void renameTest() {
	logger.info("Running Update Name Test");

	final String principal = "[email protected]" + realm;
	final String newPrincipal = "[email protected]" + realm;
	final Uid testUid = new Uid(principal);
	Uid uid;
	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);
	final OperationOptionsBuilder builder = new OperationOptionsBuilder();
	Set<Attribute> updateAttributes = new HashSet<Attribute>();
	updateAttributes.add(new Name(newPrincipal));

	uid = facade.update(ObjectClass.ACCOUNT, testUid, updateAttributes, builder.build());
	Assert.assertEquals(uid.getUidValue(), newPrincipal);

	ConnectorObject co = facade.getObject(ObjectClass.ACCOUNT, new Uid(newPrincipal), null);
	Assert.assertNotNull(co);
	Assert.assertEquals(co.getName().getNameValue(), newPrincipal);
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:21,代码来源:KerberosConnectorTests.java


示例6: updatePolicyTest

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
public void updatePolicyTest() {
	logger.info("Running Update Policy Test");

	final String principal = "[email protected]" + realm;
	final Uid testUid = new Uid(principal);
	Uid uid;
	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);

	Set<Attribute> updateAttributes = new HashSet<Attribute>();
	updateAttributes.add(AttributeBuilder.build("policy", "mypolicy"));
	uid = facade.update(ObjectClass.ACCOUNT, testUid, updateAttributes, null);
	Assert.assertEquals(uid.getUidValue(), principal);
	ConnectorObject co = facade.getObject(ObjectClass.ACCOUNT, testUid, null);
	Assert.assertNotNull(co);
	Assert.assertEquals(co.getAttributeByName("policy").getValue().get(0), "mypolicy");

	// clear policy
	updateAttributes = new HashSet<Attribute>();
	updateAttributes.add(AttributeBuilder.build("policy"));
	uid = facade.update(ObjectClass.ACCOUNT, testUid, updateAttributes, null);
	Assert.assertEquals(uid.getUidValue(), principal);
	co = facade.getObject(ObjectClass.ACCOUNT, testUid, null);
	Assert.assertNotNull(co);
	Assert.assertNull(co.getAttributeByName("policy").getValue().get(0));
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:27,代码来源:KerberosConnectorTests.java


示例7: updateLife

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
public void updateLife() {
	logger.info("Running Update Ticket/Renew Life Test");

	final String principal = "[email protected]" + realm;
	final long maxTicket = 1000 * 3600 * 4;
	final long maxRenew = 1000 * 3600 * 24;
	final Uid testUid = new Uid(principal);
	Uid uid;
	ConnectorObject co;
	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);
	Set<Attribute> updateAttributes;

	updateAttributes = new HashSet<Attribute>();
	updateAttributes.add(AttributeBuilder.build("maxTicketLife", maxTicket));
	updateAttributes.add(AttributeBuilder.build("maxRenewableLife", maxRenew));
	uid = facade.update(ObjectClass.ACCOUNT, testUid, updateAttributes, null);
	Assert.assertEquals(uid.getUidValue(), principal);
	co = facade.getObject(ObjectClass.ACCOUNT, testUid, null);
	Assert.assertNotNull(co);
	Assert.assertEquals(co.getAttributeByName("maxTicketLife").getValue().get(0), maxTicket);
	Assert.assertEquals(co.getAttributeByName("maxRenewableLife").getValue().get(0), maxRenew);
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:24,代码来源:KerberosConnectorTests.java


示例8: changePasswordTest

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Test
public void changePasswordTest() {
	logger.info("Running Change Password Test");

	final String principal = "[email protected]" + realm;
	final Uid testUid = new Uid(principal);
	Uid uid;
	ConnectorObject co;
	final ConnectorFacade facade = getFacade(KerberosConnector.class, null);
	Set<Attribute> attrs;

	attrs = new HashSet<Attribute>();
	attrs.add(AttributeBuilder.buildPassword("new-password".toCharArray()));
	uid = facade.update(ObjectClass.ACCOUNT, testUid, attrs, null);
	Assert.assertEquals(uid.getUidValue(), principal);
	co = facade.getObject(ObjectClass.ACCOUNT, testUid, null);
	Assert.assertNotNull(co);

	// empty password not supported: ConnId expect always non-empty password
	//attrs.add(AttributeBuilder.build(OperationalAttributes.PASSWORD_NAME));
}
 
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:22,代码来源:KerberosConnectorTests.java


示例9: objectClassToQname

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
/**
 * Maps ICF native objectclass name to a midPoint QName objctclass name.
 * <p/>
 * The mapping is "stateless" - it does not keep any mapping database or any
 * other state. There is a bi-directional mapping algorithm.
 * <p/>
 * TODO: mind the special characters in the ICF objectclass names.
 */
public QName objectClassToQname(ObjectClass icfObjectClass, String schemaNamespace, boolean legacySchema) {
	if (icfObjectClass == null) {
		return null;
	}
	if (icfObjectClass.is(ObjectClass.ALL_NAME)) {
		return null;
	}
	if (legacySchema) {
		if (icfObjectClass.is(ObjectClass.ACCOUNT_NAME)) {
			return new QName(schemaNamespace, SchemaConstants.ACCOUNT_OBJECT_CLASS_LOCAL_NAME,
					SchemaConstants.NS_ICF_SCHEMA_PREFIX);
		} else if (icfObjectClass.is(ObjectClass.GROUP_NAME)) {
			return new QName(schemaNamespace, SchemaConstants.GROUP_OBJECT_CLASS_LOCAL_NAME,
					SchemaConstants.NS_ICF_SCHEMA_PREFIX);
		} else {
			return new QName(schemaNamespace, CUSTOM_OBJECTCLASS_PREFIX + icfObjectClass.getObjectClassValue()
					+ CUSTOM_OBJECTCLASS_SUFFIX, MidPointConstants.PREFIX_NS_RI);
		}
	} else {
		return new QName(schemaNamespace, icfObjectClass.getObjectClassValue());
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:31,代码来源:ConnIdNameMapper.java


示例10: objectClassToIcf

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
public ObjectClass objectClassToIcf(PrismObject<? extends ShadowType> shadow, String schemaNamespace, ConnectorType connectorType, boolean legacySchema) {

		ShadowType shadowType = shadow.asObjectable();
		QName qnameObjectClass = shadowType.getObjectClass();
		if (qnameObjectClass == null) {
			ResourceAttributeContainer attrContainer = ShadowUtil
					.getAttributesContainer(shadowType);
			if (attrContainer == null) {
				return null;
			}
			ResourceAttributeContainerDefinition objectClassDefinition = attrContainer.getDefinition();
			qnameObjectClass = objectClassDefinition.getTypeName();
		}

		return objectClassToIcf(qnameObjectClass, schemaNamespace, connectorType, legacySchema);
	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:17,代码来源:ConnIdNameMapper.java


示例11: addConvertedValues

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
private void addConvertedValues(Collection<PrismPropertyValue<QName>> pvals,
		Set<Attribute> attributes, Map<QName,ObjectClassComplexTypeDefinition> auxiliaryObjectClassMap) throws SchemaException {
	if (pvals == null) {
		return;
	}
	AttributeBuilder ab = new AttributeBuilder();
	ab.setName(PredefinedAttributes.AUXILIARY_OBJECT_CLASS_NAME);
	for (PrismPropertyValue<QName> pval: pvals) {
		QName auxQName = pval.getValue();
		ObjectClassComplexTypeDefinition auxDef = resourceSchema.findObjectClassDefinition(auxQName);
		if (auxDef == null) {
			throw new SchemaException("Auxiliary object class "+auxQName+" not found in the schema");
		}
		auxiliaryObjectClassMap.put(auxQName, auxDef);
		ObjectClass icfOc = connIdNameMapper.objectClassToIcf(pval.getValue(), resourceSchemaNamespace, connectorType, false);
		ab.addValue(icfOc.getObjectClassValue());
	}
	attributes.add(ab.build());
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:ConnectorInstanceConnIdImpl.java


示例12: delete

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
/**
 * Delete user on a connector instance.
 *
 * @param propagationMode propagation mode
 * @param objectClass ConnId's object class
 * @param uid user to be deleted
 * @param options ConnId's OperationOptions
 * @param propagationAttempted if deletion is actually performed (based on
 * connector instance's capabilities)
 */
public void delete(final PropagationMode propagationMode,
        final ObjectClass objectClass,
        final Uid uid,
        final OperationOptions options,
        final Set<String> propagationAttempted) {

    if (propagationMode == PropagationMode.ONE_PHASE
            ? capabitilies.contains(
            ConnectorCapability.ONE_PHASE_DELETE)
            : capabitilies.contains(
            ConnectorCapability.TWO_PHASES_DELETE)) {

        propagationAttempted.add("delete");

        connector.delete(objectClass, uid, options);
    } else {
        LOG.info("Delete for {} was attempted, although the "
                + "connector only has these capabilities: {}. No action.",
                uid.getUidValue(), capabitilies);
    }
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:32,代码来源:ConnectorFacadeProxy.java


示例13: getObjectAttribute

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
/**
 * Read attribute for a given connector object.
 *
 * @param objectClass ConnId's object class
 * @param uid ConnId's Uid
 * @param options ConnId's OperationOptions
 * @param attributeName attribute to read
 * @return attribute (if present)
 */
public Attribute getObjectAttribute(
        final ObjectClass objectClass,
        final Uid uid,
        final OperationOptions options,
        final String attributeName) {

    Attribute attribute = null;

    try {
        final ConnectorObject object =
                connector.getObject(objectClass, uid, options);

        attribute = object.getAttributeByName(attributeName);
    } catch (NullPointerException e) {
        // ignore exception
        LOG.debug("Object for '{}' not found", uid.getUidValue());
    }

    return attribute;
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:30,代码来源:ConnectorFacadeProxy.java


示例14: getObjectAttributes

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
/**
 *
 * @param objectClass ConnId's object class
 * @param uid ConnId's Uid
 * @param options ConnId's OperationOptions
 * @param attributeNames attributes to read
 * @return attributes (if present)
 */
public Set<Attribute> getObjectAttributes(
        final ObjectClass objectClass,
        final Uid uid,
        final OperationOptions options,
        final Collection<String> attributeNames) {

    final Set<Attribute> attributes = new HashSet<Attribute>();

    try {
        final ConnectorObject object =
                connector.getObject(objectClass, uid, options);

        for (String attribute : attributeNames) {
            attributes.add(object.getAttributeByName(attribute));
        }
    } catch (NullPointerException e) {
        // ignore exception
        LOG.debug("Object for '{}' not found", uid.getUidValue());
    }

    return attributes;
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:31,代码来源:ConnectorFacadeProxy.java


示例15: getRemoteObject

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
/**
 * Get remote object.
 *
 * @param connector connector facade proxy.
 * @param task current propagation task.
 * @param latest 'FALSE' to retrieve object using old accountId if not null.
 * @return remote connector object.
 */
private ConnectorObject getRemoteObject(
        final ConnectorFacadeProxy connector,
        final PropagationTask task,
        final boolean latest) {
    try {
        return connector.getObject(
                task.getPropagationMode(),
                task.getPropagationOperation(),
                ObjectClass.ACCOUNT,
                new Uid(latest || task.getOldAccountId() == null
                ? task.getAccountId()
                : task.getOldAccountId()),
                null);
    } catch (RuntimeException ignore) {
        LOG.debug("Resolving username", ignore);
        return null;
    }
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:27,代码来源:PropagationManager.java


示例16: addAttributeModification

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Override
protected void addAttributeModification(Dn dn, List<Modification> modifications,
		org.apache.directory.api.ldap.model.schema.ObjectClass ldapStructuralObjectClass,
		ObjectClass icfObjectClass, Attribute icfAttr, ModificationOperation modOp) {
	
	if (icfAttr.is(OperationalAttributes.LOCK_OUT_NAME) 
			&& LdapConfiguration.LOCKOUT_STRATEGY_OPENLDAP.equals(getConfiguration().getLockoutStrategy())) {
		List<Object> values = icfAttr.getValue();
		if (values.size() != 1) {
			throw new InvalidAttributeValueException("Unexpected number of values in attribute "+icfAttr);
		}
		Boolean value = (Boolean)values.get(0);
		if (value) {
			throw new UnsupportedOperationException("Locking object is not supported (only unlocking is)");
		}
		modifications.add(
				new DefaultModification(modOp, SchemaConstants.PWD_ACCOUNT_LOCKED_TIME_AT)); // no value
		
	} else {
		super.addAttributeModification(dn, modifications, ldapStructuralObjectClass, icfObjectClass, icfAttr, modOp);
	}
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:23,代码来源:LdapConnector.java


示例17: searchByUid

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
/**
 * Returns a complete object based on ICF UID.
 * 
 * This is different from resolveDn() method in that it returns a complete object.
 * The resolveDn() method is supposed to be optimized to only return DN.
 */
protected SearchStrategy<C> searchByUid(Uid uid, ObjectClass objectClass, org.apache.directory.api.ldap.model.schema.ObjectClass ldapObjectClass,
		ResultsHandler handler, OperationOptions options) {
	String uidValue = SchemaUtil.getSingleStringNonBlankValue(uid);
	if (LdapUtil.isDnAttribute(configuration.getUidAttribute())) {
		return searchByDn(schemaTranslator.toDn(uidValue), objectClass, ldapObjectClass, handler, options);
	} else {
		// We know that this can return at most one object. Therefore always use simple search.
		SearchStrategy<C> searchStrategy = getDefaultSearchStrategy(objectClass, ldapObjectClass, handler, options);
		String[] attributesToGet = getAttributesToGet(ldapObjectClass, options);
		SearchScope scope = getScope(options);			
		ExprNode filterNode = LdapUtil.createUidSearchFilter(uidValue, ldapObjectClass, getSchemaTranslator());
		Dn baseDn = getBaseDn(options);
		checkBaseDnPresent(baseDn);
		try {
			searchStrategy.search(baseDn, filterNode, scope, attributesToGet);
		} catch (LdapException e) {
			throw processLdapException("Error searching for UID '"+uidValue+"'", e);
		}
		
		return searchStrategy;
	}
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:29,代码来源:AbstractLdapConnector.java


示例18: update

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
@Override
public Uid update(ObjectClass objectClass, Uid uid, Set<Attribute> replaceAttributes,
		OperationOptions options) {
   	
	Dn newDn = null;
	for (Attribute icfAttr: replaceAttributes) {
		if (icfAttr.is(Name.NAME)) {
			// This is rename. Which means change of DN. This is a special operation
			
			newDn = getSchemaTranslator().toDn(icfAttr);
			ldapRename(objectClass, uid, newDn, options);
			
			// Do NOT return here. There may still be other (non-name) attributes to update
		}
	}
   	
   	return ldapUpdate(objectClass, uid, newDn, replaceAttributes, options, ModificationOperation.REPLACE_ATTRIBUTE);
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:19,代码来源:AbstractLdapConnector.java


示例19: ldapRename

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
private void ldapRename(ObjectClass objectClass, Uid uid, Dn newDn, OperationOptions options) {
	Dn oldDn;
	
	if (getConfiguration().isUseUnsafeNameHint() && uid.getNameHint() != null) {
		String dnHintString = uid.getNameHintValue();
		oldDn = getSchemaTranslator().toDn(dnHintString);
		LOG.ok("Using (unsafe) DN from the name hint: {0} for rename", oldDn);
		try {
			
			ldapRenameAttempt(oldDn, newDn);
			return;
		
		} catch (Throwable e) {
			LOG.warn("Attempt to delete object with DN failed (DN taked from the name hint). The operation will continue with next attempt. Error: {0}",
					e.getMessage(), e);
		}
	}
	
	oldDn = resolveDn(objectClass, uid, options);
	LOG.ok("Resolved DN: {0}", oldDn);
	
	ldapRenameAttempt(oldDn, newDn);
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:24,代码来源:AbstractLdapConnector.java


示例20: addAttributeModification

import org.identityconnectors.framework.common.objects.ObjectClass; //导入依赖的package包/类
protected void addAttributeModification(Dn dn, List<Modification> modifications,
		org.apache.directory.api.ldap.model.schema.ObjectClass ldapStructuralObjectClass,
		ObjectClass icfObjectClass, Attribute icfAttr, ModificationOperation modOp) {
	AbstractSchemaTranslator<C> schemaTranslator = getSchemaTranslator();
	AttributeType attributeType = schemaTranslator.toLdapAttribute(ldapStructuralObjectClass, icfAttr.getName());
	if (attributeType == null && !configuration.isAllowUnknownAttributes() 
			&& !ArrayUtils.contains(configuration.getOperationalAttributes(), icfAttr.getName())) {
		throw new InvalidAttributeValueException("Unknown attribute "+icfAttr.getName()+" in object class "+icfObjectClass);
	}
	List<Value<Object>> ldapValues = schemaTranslator.toLdapValues(attributeType, icfAttr.getValue());
	if (ldapValues == null || ldapValues.isEmpty()) {
		// Do NOT set AttributeType here
		modifications.add(new DefaultModification(modOp, attributeType.getName()));					
	} else {
		// Do NOT set AttributeType here
		modifications.add(new DefaultModification(modOp, attributeType.getName(), ldapValues.toArray(new Value[ldapValues.size()])));
	}
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:19,代码来源:AbstractLdapConnector.java



注:本文中的org.identityconnectors.framework.common.objects.ObjectClass类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NamedMethodGenerator类代码示例发布时间:2022-05-23
下一篇:
Java ReservationId类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap