本文整理汇总了Java中org.identityconnectors.framework.common.objects.OperationOptions类的典型用法代码示例。如果您正苦于以下问题:Java OperationOptions类的具体用法?Java OperationOptions怎么用?Java OperationOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperationOptions类属于org.identityconnectors.framework.common.objects包,在下文中一共展示了OperationOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: dumpOptions
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
public static String dumpOptions(OperationOptions options) {
if (options == null) {
return "null";
}
StringBuilder sb = new StringBuilder();
sb.append("OperationOptions(");
Map<String, Object> map = options.getOptions();
if (map == null) {
sb.append("null");
} else {
for (Entry<String,Object> entry: map.entrySet()) {
sb.append(entry.getKey());
sb.append("=");
sb.append(PrettyPrinter.prettyPrint(entry.getValue()));
sb.append(",");
}
}
sb.append(")");
return sb.toString();
}
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:21,代码来源:ConnIdUtil.java
示例2: delete
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的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
示例3: getObjectAttribute
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的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
示例4: getObjectAttributes
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的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
示例5: runScriptOnResource
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
@Override
public Object runScriptOnResource(ScriptContext scriptCtx, OperationOptions options) {
String scriptLanguage = scriptCtx.getScriptLanguage();
PowerHell powerHell = getPowerHell(scriptLanguage);
String command = scriptCtx.getScriptText();
OperationLog.log("{0} Script REQ {1}: {2}", winRmHost, scriptLanguage, command);
LOG.ok("Executing {0} script on {0} as {1} using {2}: {3}", scriptLanguage, winRmHost, winRmUsername, powerHell.getImplementationName(), command);
String output;
try {
output = powerHell.runCommand(command, scriptCtx.getScriptArguments());
} catch (PowerHellException e) {
OperationLog.error("{0} Script ERR {1}", winRmHost, e.getMessage());
throw new ConnectorException("Script execution failed: "+e.getMessage(), e);
}
OperationLog.log("{0} Script RES {1}", winRmHost, (output==null||output.isEmpty())?"no output":("output "+output.length()+" chars"));
LOG.ok("Script returned output\n{0}", output);
return output;
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:25,代码来源:AdLdapConnector.java
示例6: fetchEntry
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
/**
* Fetch a single entry using its DN.
*
* @param connection The LDAP connection to use
* @param dn The entry's DN
* @param ldapObjectClass The entry's ObjectClass
* @param options The options to use
* @param schemaTranslator The Schema translator instance
* @return The found entry, or null if none is found.
*/
public static Entry fetchEntry(LdapNetworkConnection connection, String dn,
org.apache.directory.api.ldap.model.schema.ObjectClass ldapObjectClass,
OperationOptions options, AbstractSchemaTranslator schemaTranslator) {
String[] attributesToGet = getAttributesToGet(ldapObjectClass, options, schemaTranslator);
Entry entry = null;
LOG.ok("Search REQ base={0}, filter={1}, scope={2}, attributes={3}",
dn, AbstractLdapConfiguration.SEARCH_FILTER_ALL, SearchScope.OBJECT, attributesToGet);
try {
entry = connection.lookup( dn, attributesToGet );
} catch (LdapException e) {
LOG.error("Search ERR {0}: {1}", e.getClass().getName(), e.getMessage(), e);
throw processLdapException("Search for "+dn+" failed", e);
}
LOG.ok("Search RES {0}", entry);
return entry;
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:30,代码来源:LdapUtil.java
示例7: searchByUid
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的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
示例8: update
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的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
示例9: ldapRename
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的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
示例10: delete
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
@Override
public void delete(ObjectClass objectClass, Uid uid, OperationOptions options) {
Dn dn;
if (getConfiguration().isUseUnsafeNameHint() && uid.getNameHint() != null) {
String dnHintString = uid.getNameHintValue();
dn = getSchemaTranslator().toDn(dnHintString);
LOG.ok("Using (unsafe) DN from the name hint: {0}", dn);
try {
deleteAttempt(dn, uid);
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);
}
}
dn = resolveDn(objectClass, uid, options);
LOG.ok("Resolved DN: {0}", dn);
deleteAttempt(dn, uid);
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:26,代码来源:AbstractLdapConnector.java
示例11: delete
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
@Override
public void delete(ObjectClass objectClass, Uid uid, OperationOptions options) {
if (objectClass.is(ObjectClass.ACCOUNT_NAME)) {
try {
gitlabAPI.deleteUser(toInteger(uid));
} catch (IOException e) {
throw new ConnectorIOException(e.getMessage(), e);
}
} else if (objectClass.is(ObjectClass.GROUP_NAME)) {
throw new UnsupportedOperationException("Deletion of group seems to be not supported by Gitlab API");
} else if (objectClass.is(OBJECT_CLASS_PROJECT_NAME)) {
throw new UnsupportedOperationException("Deletion of project seems to be not supported by Gitlab API");
} else {
throw new UnsupportedOperationException("Unsupported object class "+objectClass);
}
}
开发者ID:Evolveum,项目名称:connector-gitlab,代码行数:17,代码来源:GitlabConnector.java
示例12: createProject
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
private Uid createProject(Set<Attribute> attributes, OperationOptions options) {
String name = getStringAttr(attributes, Name.NAME);
Integer namespaceId = getAttr(attributes, ATTR_NAMESPACE, Integer.class);
if (namespaceId == null) {
throw new InvalidAttributeValueException("Missing mandatory attribute "+ATTR_NAMESPACE);
}
String description = getStringAttr(attributes, ATTR_DESCRIPTION);
Boolean issuesEnabled = getAttr(attributes, ATTR_ISSUES_ENABLED, Boolean.class);
Boolean wallEnabled = getAttr(attributes, ATTR_WALL_ENABLED, Boolean.class);
Boolean mergeRequestsEnabled = getAttr(attributes, ATTR_MERGE_REQUESTS_ENABLED, Boolean.class);
Boolean wikiEnabled = getAttr(attributes, ATTR_WIKI_ENABLED, Boolean.class);
Boolean snippetsEnabled = getAttr(attributes, ATTR_SNIPPETS_ENABLED, Boolean.class);
Boolean publik = getAttr(attributes, ATTR_PUBLIC, Boolean.class);
Integer visibilityLevel = getAttr(attributes, ATTR_VISIBILITY_LEVEL, Integer.class);
String importUrl = getStringAttr(attributes, ATTR_IMPORT_URL);
try {
GitlabProject gitlabProject = gitlabAPI.createProject(name, namespaceId, description, issuesEnabled, wallEnabled, mergeRequestsEnabled, wikiEnabled, snippetsEnabled, publik, visibilityLevel, importUrl);
Integer id = gitlabProject.getId();
return new Uid(id.toString());
} catch (IOException e) {
throw new ConnectorIOException(e.getMessage(), e);
}
}
开发者ID:Evolveum,项目名称:connector-gitlab,代码行数:25,代码来源:GitlabConnector.java
示例13: filteredReconciliation
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
@Transactional
@Override
public void filteredReconciliation(
final ObjectClass objectClass,
final ReconFilterBuilder filterBuilder,
final SyncResultsHandler handler,
final OperationOptions options) {
Filter filter = null;
OperationOptions actualOptions = options;
if (filterBuilder != null) {
filter = filterBuilder.build();
actualOptions = filterBuilder.build(actualOptions);
}
search(objectClass, filter, object -> handler.handle(new SyncDeltaBuilder().
setObject(object).
setUid(object.getUid()).
setDeltaType(SyncDeltaType.CREATE_OR_UPDATE).
setToken(new SyncToken("")).
build()), actualOptions);
}
开发者ID:apache,项目名称:syncope,代码行数:23,代码来源:ConnectorFacadeProxy.java
示例14: search
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
@Override
public SearchResult search(
final ObjectClass objectClass,
final Filter filter,
final ResultsHandler handler,
final int pageSize,
final String pagedResultsCookie,
final List<OrderByClause> orderBy,
final OperationOptions options) {
OperationOptionsBuilder builder = new OperationOptionsBuilder().setPageSize(pageSize).setPagedResultsOffset(-1);
if (pagedResultsCookie != null) {
builder.setPagedResultsCookie(pagedResultsCookie);
}
builder.setSortKeys(orderBy.stream().map(clause
-> new SortKey(clause.getField(), clause.getDirection() == OrderByClause.Direction.ASC)).
collect(Collectors.toList()));
builder.setAttributesToGet(options.getAttributesToGet());
return search(objectClass, filter, handler, builder.build());
}
开发者ID:apache,项目名称:syncope,代码行数:23,代码来源:ConnectorFacadeProxy.java
示例15: buildOperationOptions
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
/**
* Build options for requesting all mapped connector attributes.
*
* @param iterator items
* @return options for requesting all mapped connector attributes
* @see OperationOptions
*/
public static OperationOptions buildOperationOptions(final Iterator<? extends Item> iterator) {
OperationOptionsBuilder builder = new OperationOptionsBuilder();
Set<String> attrsToGet = new HashSet<>();
attrsToGet.add(Name.NAME);
attrsToGet.add(Uid.NAME);
attrsToGet.add(OperationalAttributes.ENABLE_NAME);
while (iterator.hasNext()) {
Item item = iterator.next();
if (item.getPurpose() != MappingPurpose.NONE) {
attrsToGet.add(item.getExtAttrName());
}
}
builder.setAttributesToGet(attrsToGet);
// -------------------------------------
return builder.build();
}
开发者ID:apache,项目名称:syncope,代码行数:28,代码来源:MappingUtils.java
示例16: run
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
@Override
public void run() {
KerberosConnector connector = new KerberosConnector();
connector.init(config);
Map<String, Object> opts = new HashMap<String, Object>();
opts.put(OperationOptions.OP_PAGE_SIZE, 20);
opts.put(OperationOptions.OP_PAGED_RESULTS_OFFSET, (int)Math.floor(Math.random()*400));
OperationOptions op = new OperationOptions(opts);
connector.executeQuery(null, null, new PrintResultsHandler(), op);
connector.dispose();
}
开发者ID:CESNET,项目名称:kerberos-connector,代码行数:14,代码来源:ExampleThread.java
示例17: create
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
/**
* Create user on a connector instance.
*
* @param propagationMode propagation mode
* @param objectClass ConnId's object class
* @param attrs attributes for creation
* @param options ConnId's OperationOptions
* @param propagationAttempted if creation is actually performed (based on
* connector instance's capabilities)
* @return Uid for created user
*/
public Uid create(
final PropagationMode propagationMode,
final ObjectClass objectClass,
final Set<Attribute> attrs,
final OperationOptions options,
final Set<String> propagationAttempted) {
Uid result = null;
if (propagationMode == PropagationMode.ONE_PHASE
? capabitilies.contains(
ConnectorCapability.ONE_PHASE_CREATE)
: capabitilies.contains(
ConnectorCapability.TWO_PHASES_CREATE)) {
propagationAttempted.add("create");
result = connector.create(objectClass, attrs, options);
} else {
LOG.info("Create was attempted, although the "
+ "connector only has these capabilities: {}. No action.",
capabitilies);
}
return result;
}
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:38,代码来源:ConnectorFacadeProxy.java
示例18: update
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
/**
* Update user on a connector instance.
*
* @param propagationMode propagation mode
* @param objectClass ConnId's object class
* @param uid user to be updated
* @param attrs attributes for update
* @param options ConnId's OperationOptions
* @param propagationAttempted if update is actually performed (based on
* connector instance's capabilities)
* @return Uid for created user
*/
public Uid update(final PropagationMode propagationMode,
final ObjectClass objectClass,
final Uid uid,
final Set<Attribute> attrs,
final OperationOptions options,
final Set<String> propagationAttempted) {
Uid result = null;
if (propagationMode == PropagationMode.ONE_PHASE
? capabitilies.contains(
ConnectorCapability.ONE_PHASE_UPDATE)
: capabitilies.contains(
ConnectorCapability.TWO_PHASES_UPDATE)) {
propagationAttempted.add("update");
result = connector.update(
objectClass, uid, attrs, options);
} else {
LOG.info("Update for {} was attempted, although the "
+ "connector only has these capabilities: {}. No action.",
uid.getUidValue(), capabitilies);
}
return result;
}
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:40,代码来源:ConnectorFacadeProxy.java
示例19: getAllObjects
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
/**
* Get remote object used by the propagation manager in order to choose for
* a create (object doesn't exist) or an update (object exists).
*
* @param objectClass ConnId's object class.
* @param handler to be used to handle deltas.
* @param options ConnId's OperationOptions.
*/
public void getAllObjects(
final ObjectClass objectClass,
final SyncResultsHandler handler,
final OperationOptions options) {
if (capabitilies.contains(ConnectorCapability.SEARCH)) {
connector.search(objectClass, null,
new ResultsHandler() {
@Override
public boolean handle(final ConnectorObject obj) {
final SyncDeltaBuilder bld = new SyncDeltaBuilder();
bld.setObject(obj);
bld.setUid(obj.getUid());
bld.setDeltaType(SyncDeltaType.CREATE_OR_UPDATE);
bld.setToken(new SyncToken(""));
return handler.handle(bld.build());
}
}, options);
} else {
LOG.info("Search was attempted, although the "
+ "connector only has these capabilities: {}. No action.",
capabitilies);
}
}
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:36,代码来源:ConnectorFacadeProxy.java
示例20: SearchStrategy
import org.identityconnectors.framework.common.objects.OperationOptions; //导入依赖的package包/类
protected SearchStrategy(ConnectionManager<C> connectionManager, AbstractLdapConfiguration configuration,
AbstractSchemaTranslator<C> schemaTranslator, ObjectClass objectClass,
org.apache.directory.api.ldap.model.schema.ObjectClass ldapObjectClass,
ResultsHandler handler, OperationOptions options) {
super();
this.connectionManager = connectionManager;
this.configuration = configuration;
this.schemaTranslator = schemaTranslator;
this.objectClass = objectClass;
this.ldapObjectClass = ldapObjectClass;
this.handler = handler;
this.options = options;
}
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:14,代码来源:SearchStrategy.java
注:本文中的org.identityconnectors.framework.common.objects.OperationOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论