本文整理汇总了Java中org.identityconnectors.framework.common.objects.AttributeInfo类的典型用法代码示例。如果您正苦于以下问题:Java AttributeInfo类的具体用法?Java AttributeInfo怎么用?Java AttributeInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttributeInfo类属于org.identityconnectors.framework.common.objects包,在下文中一共展示了AttributeInfo类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: icfAttributeInfoToMatchingRule
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
private QName icfAttributeInfoToMatchingRule(AttributeInfo attributeInfo) {
String icfSubtype = attributeInfo.getSubtype();
if (icfSubtype == null) {
return null;
}
if (AttributeInfo.Subtypes.STRING_CASE_IGNORE.toString().equals(icfSubtype)) {
return StringIgnoreCaseMatchingRule.NAME;
}
if (AttributeInfo.Subtypes.STRING_LDAP_DN.toString().equals(icfSubtype)) {
return DistinguishedNameMatchingRule.NAME;
}
if (AttributeInfo.Subtypes.STRING_XML.toString().equals(icfSubtype)) {
return XmlMatchingRule.NAME;
}
if (AttributeInfo.Subtypes.STRING_UUID.toString().equals(icfSubtype)) {
return UuidMatchingRule.NAME;
}
LOGGER.debug("Unknown subtype {} defined for attribute {}, ignoring (no matching rule definition)", icfSubtype, attributeInfo.getName());
return null;
}
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:21,代码来源:ConnectorInstanceConnIdImpl.java
示例2: getSchema
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
/**
* Return resource schema names.
*
* @param showall return __NAME__ and __PASSWORD__ attribute if true.
* @return a list of schema names.
*/
public Set<String> getSchema(final boolean showall) {
final Set<String> resourceSchemaNames = new HashSet<String>();
final Schema schema = connector.schema();
try {
for (ObjectClassInfo info : schema.getObjectClassInfo()) {
for (AttributeInfo attrInfo : info.getAttributeInfo()) {
if (showall || (!Name.NAME.equals(attrInfo.getName())
&& !OperationalAttributes.PASSWORD_NAME.equals(
attrInfo.getName())
&& !OperationalAttributes.ENABLE_NAME.equals(
attrInfo.getName()))) {
resourceSchemaNames.add(attrInfo.getName());
}
}
}
} catch (Throwable t) {
// catch throwable in order to manage unpredictable behaviors
LOG.debug("Unsupported operation {}", t);
}
return resourceSchemaNames;
}
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:32,代码来源:ConnectorFacadeProxy.java
示例3: addExtraOperationalAttributes
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
private void addExtraOperationalAttributes(Map<String, AttributeInfo> attrInfoList) {
for (String operationalAttributeLdapName: configuration.getOperationalAttributes()) {
if (containsAttribute(attrInfoList, operationalAttributeLdapName)) {
continue;
}
AttributeInfoBuilder aib = new AttributeInfoBuilder(operationalAttributeLdapName);
aib.setRequired(false);
aib.setNativeName(operationalAttributeLdapName);
AttributeType attributeType = null;
try {
attributeType = schemaManager.lookupAttributeTypeRegistry(operationalAttributeLdapName);
} catch (LdapException e) {
// Ignore. We want this attribute even if it is not in the LDAP schema
}
if (attributeType != null) {
LdapSyntax ldapSyntax = getSyntax(attributeType);
Class<?> icfType = toIcfType(ldapSyntax, operationalAttributeLdapName);
aib.setType(icfType);
aib.setSubtype(toIcfSubtype(icfType, attributeType, operationalAttributeLdapName));
LOG.ok("Translating {0} -> {1} ({2} -> {3}) (operational)", operationalAttributeLdapName, operationalAttributeLdapName,
ldapSyntax==null?null:ldapSyntax.getOid(), icfType);
setAttributeMultiplicityAndPermissions(attributeType, operationalAttributeLdapName, aib);
} else {
LOG.ok("Translating {0} -> {1} ({2} -> {3}) (operational, not defined in schema)", operationalAttributeLdapName, operationalAttributeLdapName,
null, String.class);
aib.setType(String.class);
aib.setMultiValued(false);
}
aib.setReturnedByDefault(false);
AttributeInfo attributeInfo = aib.build();
attrInfoList.put(attributeInfo.getName(), attributeInfo);
}
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:38,代码来源:AbstractSchemaTranslator.java
示例4: addAttributeTypesFromLdapSchema
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
private void addAttributeTypesFromLdapSchema(Map<String, AttributeInfo> attrInfoList, org.apache.directory.api.ldap.model.schema.ObjectClass ldapObjectClass) {
LOG.ok(" ... translating attributes from {0}:\n{1}\nMUST\n{2}", ldapObjectClass.getName(), ldapObjectClass, ldapObjectClass.getMustAttributeTypes());
addAttributeTypes(attrInfoList, ldapObjectClass.getMustAttributeTypes(), true);
LOG.ok(" ... translating attributes from {0}:\n{1}\nMAY\n{2}", ldapObjectClass.getName(), ldapObjectClass, ldapObjectClass.getMayAttributeTypes());
addAttributeTypes(attrInfoList, ldapObjectClass.getMayAttributeTypes(), false);
List<org.apache.directory.api.ldap.model.schema.ObjectClass> superiors = ldapObjectClass.getSuperiors();
if ((superiors != null) && (superiors.size() > 0)) {
for (org.apache.directory.api.ldap.model.schema.ObjectClass superior: superiors) {
addAttributeTypesFromLdapSchema(attrInfoList, superior);
}
}
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:14,代码来源:AbstractSchemaTranslator.java
示例5: toIcfSubtype
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
public String toIcfSubtype(Class<?> icfType, AttributeType ldapAttribute, String icfAttributeName) {
if (OperationalAttributeInfos.PASSWORD.is(icfAttributeName)) {
return null;
}
if (ldapAttribute == null) {
return null;
}
if (hasEqualityMatching(ldapAttribute, SchemaConstants.CASE_IGNORE_MATCH_MR, SchemaConstants.CASE_IGNORE_MATCH_MR_OID)) {
return AttributeInfo.Subtypes.STRING_CASE_IGNORE.toString();
}
if (hasEqualityMatching(ldapAttribute, SchemaConstants.CASE_IGNORE_IA5_MATCH_MR, SchemaConstants.CASE_IGNORE_IA5_MATCH_MR_OID)) {
return AttributeInfo.Subtypes.STRING_CASE_IGNORE.toString();
}
if (hasEqualityMatching(ldapAttribute, SchemaConstants.UUID_MATCH_MR, SchemaConstants.UUID_MATCH_MR_OID)) {
return AttributeInfo.Subtypes.STRING_UUID.toString();
}
String syntaxOid = ldapAttribute.getSyntaxOid();
if (syntaxOid == null) {
return null;
}
if (SYNTAX_MAP.get(syntaxOid) == null) {
if (icfType == String.class) {
return AttributeInfo.Subtypes.STRING_CASE_IGNORE.toString();
} else {
return null;
}
}
return SYNTAX_MAP.get(syntaxOid).subtype;
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:30,代码来源:AbstractSchemaTranslator.java
示例6: findAttributeInfo
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
public static AttributeInfo findAttributeInfo(ObjectClassInfo icfObjectClassInfo, Attribute attribute) {
for (AttributeInfo attributeInfo: icfObjectClassInfo.getAttributeInfo()) {
if (attributeInfo.is(attribute.getName())) {
return attributeInfo;
}
}
return null;
}
开发者ID:Evolveum,项目名称:polygon,代码行数:9,代码来源:SchemaUtil.java
示例7: addOperationalAttributeMapping
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
private static void addOperationalAttributeMapping(AttributeInfo attrInfo) {
addOperationalAttributeMapping(attrInfo.getName());
}
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:4,代码来源:ConnIdNameMapper.java
示例8: addAttributeTypes
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
private void addAttributeTypes(Map<String, AttributeInfo> attrInfoList, org.apache.directory.api.ldap.model.schema.ObjectClass ldapObjectClass) {
// ICF UID
String uidAttribudeLdapName = configuration.getUidAttribute();
AttributeInfoBuilder uidAib = new AttributeInfoBuilder(Uid.NAME);
uidAib.setNativeName(uidAttribudeLdapName);
uidAib.setRequired(false); // Must be optional. It is not present for create operations
AttributeType uidAttributeLdapType = null;
try {
uidAttributeLdapType = schemaManager.lookupAttributeTypeRegistry(uidAttribudeLdapName);
} catch (LdapException e) {
// We can live with this
LOG.ok("Got exception looking up UID atribute {0}: {1} ({2}) (probabably harmless)", uidAttribudeLdapName,
e.getMessage(), e.getClass());
}
// UID must be string. It is hardcoded in the framework.
uidAib.setType(String.class);
if (uidAttributeLdapType != null) {
uidAib.setSubtype(toIcfSubtype(String.class, uidAttributeLdapType, Uid.NAME));
setAttributeMultiplicityAndPermissions(uidAttributeLdapType, Uid.NAME, uidAib);
} else {
uidAib.setCreateable(false);
uidAib.setUpdateable(false);
uidAib.setReadable(true);
}
AttributeInfo attributeInfo = uidAib.build();
attrInfoList.put(attributeInfo.getName(), attributeInfo);
// ICF NAME
AttributeInfoBuilder nameAib = new AttributeInfoBuilder(Name.NAME);
nameAib.setType(String.class);
nameAib.setNativeName(LdapConfiguration.PSEUDO_ATTRIBUTE_DN_NAME);
nameAib.setSubtype(AttributeInfo.Subtypes.STRING_LDAP_DN);
nameAib.setRequired(true);
attributeInfo = nameAib.build();
attrInfoList.put(attributeInfo.getName(), attributeInfo);
// AUXILIARY_OBJECT_CLASS
attrInfoList.put(PredefinedAttributeInfos.AUXILIARY_OBJECT_CLASS.getName(), PredefinedAttributeInfos.AUXILIARY_OBJECT_CLASS);
addAttributeTypesFromLdapSchema(attrInfoList, ldapObjectClass);
addExtraOperationalAttributes(attrInfoList);
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:48,代码来源:AbstractSchemaTranslator.java
示例9: containsAttribute
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
private boolean containsAttribute(Map<String, AttributeInfo> attrInfoList, String icfAttributeName) {
return attrInfoList.containsKey( icfAttributeName );
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:4,代码来源:AbstractSchemaTranslator.java
示例10: addToSyntaxMap
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
private static void addToSyntaxMap(String syntaxOid, Class<?> type, AttributeInfo.Subtypes subtype) {
SYNTAX_MAP.put(syntaxOid, new TypeSubType(type, subtype.toString()));
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:4,代码来源:AbstractSchemaTranslator.java
示例11: buildAttributeInfosFromTable
import org.identityconnectors.framework.common.objects.AttributeInfo; //导入依赖的package包/类
public Set<AttributeInfo> buildAttributeInfosFromTable(String nameOfTable, String keyNameOfTable, List<String> excludedNames) {
this.namesOfRequiredColumns.clear();
this.sqlTypes.clear();
if (nameOfTable == null) {
LOGGER.error("Attribute nameOfTable not provided.");
throw new InvalidAttributeValueException("Attribute nameOfTable not provided.");
}
if (keyNameOfTable == null) {
LOGGER.error("Attribute keyNameOfTable not provided.");
throw new InvalidAttributeValueException("Attribute keyNameOfTable not provided.");
}
StringBuilder sb = new StringBuilder();
sb.append("SELECT * FROM ").append(nameOfTable).append(" WHERE ").append(keyNameOfTable).append(" IS NULL");
String sql = sb.toString();
ResultSet result = null;
Statement stmt = null;
try {
stmt = getConnection().createStatement();
result = stmt.executeQuery(sql);
Set<AttributeInfo> attrsInfo = new HashSet<AttributeInfo>();
ResultSetMetaData metaData = result.getMetaData();
int countOfAttributes = metaData.getColumnCount();
for (int i = 1; i <= countOfAttributes; i++) {
final String nameOfColumn = metaData.getColumnName(i);
final AttributeInfoBuilder attrInfoBuilder = new AttributeInfoBuilder();
final Integer numberOfType = metaData.getColumnType(i);
this.sqlTypes.put(nameOfColumn.toLowerCase(), numberOfType);
if (excludedNames == null || !excludedNames.contains(nameOfColumn)) {
Class<?> type = JdbcUtil.getTypeOfAttribute(numberOfType, getConfiguration().getTimestampPresentation());
attrInfoBuilder.setName(nameOfColumn.toLowerCase());
attrInfoBuilder.setType(type);
boolean required = isRequired(metaData, i);
if(required && type.equals(String.class)){
this.namesOfRequiredColumns.add(nameOfColumn.toLowerCase());
}
attrInfoBuilder.setRequired(required);
attrInfoBuilder.setMultiValued(isMultivalue(metaData, i));
attrsInfo.add(attrInfoBuilder.build());
}
}
return attrsInfo;
} catch (SQLException ex) {
LOGGER.error(ex.getMessage());
if(rethrowSQLException(ex.getErrorCode())){
throw new ConnectorException(ex.getMessage(), ex);
}
}
return null;
}
开发者ID:Evolveum,项目名称:polygon,代码行数:54,代码来源:AbstractJdbcConnector.java
注:本文中的org.identityconnectors.framework.common.objects.AttributeInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论