本文整理汇总了Java中org.identityconnectors.framework.common.objects.Uid类的典型用法代码示例。如果您正苦于以下问题:Java Uid类的具体用法?Java Uid怎么用?Java Uid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Uid类属于org.identityconnectors.framework.common.objects包,在下文中一共展示了Uid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createContainsExpression
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected String createContainsExpression(ContainsFilter filter, boolean not) {
if (filter.getAttribute().is(Name.NAME) ||
filter.getAttribute().is(Uid.NAME)) {
String value = AttributeUtil.getAsStringValue(filter.getAttribute());
if (StringUtil.isBlank(value)) {
return null;
} else if (not) {
//It's not possible to create a not filter
return null;
} else {
return "*" + value + "*";
}
} else {
//It's not possible to filter by different attributes
return null;
}
}
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:22,代码来源:KerberosFilterTranslator.java
示例2: createEndsWithExpression
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected String createEndsWithExpression(EndsWithFilter filter, boolean not) {
if (filter.getAttribute().is(Name.NAME) ||
filter.getAttribute().is(Uid.NAME)) {
String value = AttributeUtil.getAsStringValue(filter.getAttribute());
if (StringUtil.isBlank(value)) {
return null;
} else if (not) {
//It's not possible to create a not filter
return null;
} else {
return "*" + value;
}
} else {
//It's not possible to filter by different attributes
return null;
}
}
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:22,代码来源:KerberosFilterTranslator.java
示例3: createStartsWithExpression
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected String createStartsWithExpression(StartsWithFilter filter, boolean not) {
if (filter.getAttribute().is(Name.NAME) ||
filter.getAttribute().is(Uid.NAME)) {
String value = AttributeUtil.getAsStringValue(filter.getAttribute());
if (StringUtil.isBlank(value)) {
return null;
} else if (not) {
//It's not possible to create a not filter
return null;
} else {
return value + "*";
}
} else {
//It's not possible to filter by different attributes
return null;
}
}
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:22,代码来源:KerberosFilterTranslator.java
示例4: createEqualsExpression
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected String createEqualsExpression(EqualsFilter filter, boolean not) {
if (filter.getAttribute().is(Name.NAME) ||
filter.getAttribute().is(Uid.NAME)) {
String value = AttributeUtil.getAsStringValue(filter.getAttribute());
if (StringUtil.isBlank(value)) {
return null;
} else if (not) {
//It's not possible to create a not filter
return null;
} else {
return value;
}
} else {
//It's not possible to filter by different attributes
return null;
}
}
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:22,代码来源:KerberosFilterTranslator.java
示例5: createRandkeyTest
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例6: exactSearchTest
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例7: renameTest
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例8: updatePolicyTest
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例9: updateLife
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例10: changePasswordTest
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例11: createEqualsExpression
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的package包/类
@Override
protected SapFilter createEqualsExpression(EqualsFilter filter, boolean not) {
LOG.ok("createEqualsExpression, filter: {0}, not: {1}", filter, not);
if (not) {
return null; // not supported attribute
}
Attribute attr = filter.getAttribute();
LOG.ok("attr.getId: {0}, attr.getValue: {1}", attr.getName(), attr.getValue());
// filter by NAME is the same as by UID
if (Name.NAME.equals(attr.getName()) || Uid.NAME.equals(attr.getName())) {
if (attr.getValue() != null && attr.getValue().get(0) != null) {
SapFilter lf = new SapFilter(String.valueOf(attr.getValue().get(0)));
return lf;
}
}
return null; // not supported attribute
}
开发者ID:Evolveum,项目名称:connector-sap,代码行数:21,代码来源:SapBasicFilterTranslator.java
示例12: initialize
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的package包/类
private static void initialize() {
addSpecialAttributeMapping(Name.NAME, SchemaConstants.ICFS_NAME);
addSpecialAttributeMapping(Uid.NAME, SchemaConstants.ICFS_UID);
addOperationalAttributeMapping(OperationalAttributeInfos.CURRENT_PASSWORD);
addOperationalAttributeMapping(OperationalAttributeInfos.DISABLE_DATE);
addOperationalAttributeMapping(OperationalAttributeInfos.ENABLE);
addOperationalAttributeMapping(OperationalAttributeInfos.ENABLE_DATE);
addOperationalAttributeMapping(OperationalAttributeInfos.LOCK_OUT);
addOperationalAttributeMapping(OperationalAttributeInfos.PASSWORD);
addOperationalAttributeMapping(OperationalAttributeInfos.PASSWORD_EXPIRATION_DATE);
addOperationalAttributeMapping(OperationalAttributeInfos.PASSWORD_EXPIRED);
addOperationalAttributeMapping(SecretIcfOperationalAttributes.DESCRIPTION);
addOperationalAttributeMapping(SecretIcfOperationalAttributes.GROUPS);
addOperationalAttributeMapping(SecretIcfOperationalAttributes.LAST_LOGIN_DATE);
}
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:ConnIdNameMapper.java
示例13: getUid
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的package包/类
private Uid getUid(ResourceObjectIdentification resourceObjectIdentification) throws SchemaException {
ResourceAttribute<String> primaryIdentifier = resourceObjectIdentification.getPrimaryIdentifier();
if (primaryIdentifier == null) {
return null;
}
String uidValue = primaryIdentifier.getRealValue();
String nameValue = null;
Collection<? extends ResourceAttribute<?>> secondaryIdentifiers = resourceObjectIdentification.getSecondaryIdentifiers();
if (secondaryIdentifiers != null && secondaryIdentifiers.size() == 1) {
nameValue = (String) secondaryIdentifiers.iterator().next().getRealValue();
}
if (uidValue != null) {
if (nameValue == null) {
return new Uid(uidValue);
} else {
return new Uid(uidValue, new Name(nameValue));
}
}
return null;
}
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:21,代码来源:ConnectorInstanceConnIdImpl.java
示例14: delete
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例15: getObjectAttribute
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例16: getObjectAttributes
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例17: getRemoteObject
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例18: searchByUid
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例19: update
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
示例20: ldapRename
import org.identityconnectors.framework.common.objects.Uid; //导入依赖的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
注:本文中的org.identityconnectors.framework.common.objects.Uid类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论