Package org.identityconnectors.framework.common.objects

Examples of org.identityconnectors.framework.common.objects.ConnectorObject


     * @return ConnId's connector object for given uid
     */
    public ConnectorObject getObject(final PropagationMode propagationMode, final PropagationOperation operationType,
            final ObjectClass objectClass, final Uid uid, final OperationOptions options) {

        ConnectorObject result = null;

        if (activeConnInstance.getCapabilities().contains(ConnectorCapability.SEARCH)) {
            if (operationType == null) {
                result = connector.getObject(objectClass, uid, options);
            } else {
View Full Code Here


            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());
        }
View Full Code Here

            final OperationOptions options) {

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

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

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

        if (policySpec != null && !policySpec.getAlternativeSearchAttrs().isEmpty()) {

            // search external attribute name/value
            // about each specified name
            final ConnectorObject object = delta.getObject();

            final Map<String, Attribute> extValues = new HashMap<String, Attribute>();

            for (SchemaMapping mapping : syncTask.getResource().getMappings()) {
                extValues.put(SchemaMappingUtil.getIntAttrName(mapping), object.getAttributeByName(SchemaMappingUtil
                        .getExtAttrName(mapping)));
            }

            // search user by attributes specified into the policy
            NodeCond searchCondition = null;
View Full Code Here

        String taskExecutionMessage = null;

        // Flag to state whether any propagation has been attempted
        Set<String> propagationAttempted = new HashSet<String>();

        ConnectorObject before = null;
        ConnectorObject after = null;

        try {
            final ConnectorFacadeProxy connector = connLoader.getConnector(task.getResource());
            if (connector == null) {
                throw new NoSuchBeanDefinitionException(String.format(
View Full Code Here

            throw new NotFoundException("Resource '" + resourceName + "'");
        }

        final ConnectorFacadeProxy connector = connLoader.getConnector(resource);

        final ConnectorObject connectorObject = connector.getObject(ObjectClass.ACCOUNT, new Uid(objectId), connector.
                getOperationOptions(resource));

        if (connectorObject == null) {
            throw new NotFoundException("Object " + objectId + " not found on resource " + resourceName);
        }

        final Set<Attribute> attributes = connectorObject.getAttributes();

        if (AttributeUtil.find(Uid.NAME, attributes) == null) {
            attributes.add(connectorObject.getUid());
        }

        if (AttributeUtil.find(Name.NAME, attributes) == null) {
            attributes.add(connectorObject.getName());
        }

        auditManager.audit(Category.resource, ResourceSubCategory.getObject, Result.success,
                "Successfully read object " + objectId + " from resource " + resourceName);
View Full Code Here

            for (ExternalResource resource : getTargetResource(virAttr, type, attrUtil)) {
                LOG.debug("Search values into {}", resource.getName());
                try {
                    final List<AbstractMappingItem> mappings = attrUtil.getMappingItems(resource, MappingPurpose.BOTH);

                    final ConnectorObject connectorObject;

                    if (externalResources.containsKey(resource.getName())) {
                        connectorObject = externalResources.get(resource.getName());
                    } else {
                        LOG.debug("Perform connection to {}", resource.getName());
                        final String accountId = attrUtil.getAccountIdItem(resource) == null
                                ? null
                                : MappingUtil.getAccountIdValue(
                                owner, resource, attrUtil.getAccountIdItem(resource));

                        if (StringUtils.isBlank(accountId)) {
                            throw new IllegalArgumentException("No AccountId found for " + resource.getName());
                        }

                        final Connector connector = connFactory.getConnector(resource);

                        final OperationOptions oo =
                                connector.getOperationOptions(MappingUtil.getMatchingMappingItems(mappings, type));

                        connectorObject = connector.getObject(fromAttributable(owner), new Uid(accountId), oo);
                        externalResources.put(resource.getName(), connectorObject);
                    }

                    if (connectorObject != null) {
                        // ask for searched virtual attribute value
                        final List<AbstractMappingItem> virAttrMappings =
                                MappingUtil.getMatchingMappingItems(mappings, schemaName, type);

                        // the same virtual attribute could be mapped with one or more external attribute
                        for (AbstractMappingItem mapping : virAttrMappings) {
                            final Attribute attribute = connectorObject.getAttributeByName(mapping.getExtAttrName());

                            if (attribute != null && attribute.getValue() != null) {
                                for (Object obj : attribute.getValue()) {
                                    if (obj != null) {
                                        virAttr.addValue(obj.toString());
View Full Code Here

        String taskExecutionMessage = null;

        // Flag to state whether any propagation has been attempted
        Set<String> propagationAttempted = new HashSet<String>();

        ConnectorObject before = null;
        ConnectorObject after = null;

        try {
            final ConnectorFacadeProxy connector = connLoader.getConnector(task.getResource());
            if (connector == null) {
                throw new NoSuchBeanDefinitionException(String.format(
View Full Code Here

            // non cached ...
            LOG.debug("Need one or more remote connections");
            for (ExternalResource resource : getTargetResource(virAttr, type)) {
                LOG.debug("Seach values into {}", resource.getName());
                try {
                    final ConnectorObject connectorObject;

                    if (externalResources.containsKey(resource.getName())) {
                        connectorObject = externalResources.get(resource.getName());
                    } else {
                        LOG.debug("Perform connection to {}", resource.getName());
                        final String accountId = SchemaMappingUtil.getAccountIdValue(
                                owner, SchemaMappingUtil.getAccountIdMapping(resource.getMappings()));

                        if (StringUtils.isBlank(accountId)) {
                            throw new IllegalArgumentException("No AccountId found for " + resource.getName());
                        }

                        final Set<String> extAttrNames =
                                SchemaMappingUtil.getExtAttrNames(resource.getMappings(), type);

                        LOG.debug("External attribute ({}) names to get '{}'", type, extAttrNames);

                        final OperationOptionsBuilder oob = new OperationOptionsBuilder();
                        oob.setAttributesToGet(extAttrNames);

                        final ConnectorFacadeProxy connector = connInstanceLoader.getConnector(resource);
                        connectorObject = connector.getObject(ObjectClass.ACCOUNT, new Uid(accountId), oob.build());
                        externalResources.put(resource.getName(), connectorObject);
                    }


                    if (connectorObject != null) {
                        final Set<SchemaMapping> mappings = resource.getMappings(schemaName, type);

                        // the same virtual attribute could be mapped with one or more external attribute
                        for (SchemaMapping mapping : mappings) {
                            final Attribute attribute =
                                    connectorObject.getAttributeByName(SchemaMappingUtil.getExtAttrName(mapping));

                            if (attribute != null && attribute.getValue() != null) {
                                for (Object obj : attribute.getValue()) {
                                    if (obj != null) {
                                        virAttr.addValue(obj.toString());
View Full Code Here

                MappingUtil.getAccountIdValue(attributable, resource, attrUtil.getAccountIdItem(resource));

        final ObjectClass objectClass = AttributableType.USER == type ? ObjectClass.ACCOUNT : ObjectClass.GROUP;

        final Connector connector = connFactory.getConnector(resource);
        final ConnectorObject connectorObject = connector.getObject(objectClass, new Uid(accountIdValue),
                connector.getOperationOptions(attrUtil.getMappingItems(resource, MappingPurpose.BOTH)));
        if (connectorObject == null) {
            throw new NotFoundException("Object " + accountIdValue + " with class " + objectClass
                    + "not found on resource " + resourceName);
        }

        final Set<Attribute> attributes = connectorObject.getAttributes();
        if (AttributeUtil.find(Uid.NAME, attributes) == null) {
            attributes.add(connectorObject.getUid());
        }
        if (AttributeUtil.find(Name.NAME, attributes) == null) {
            attributes.add(connectorObject.getName());
        }

        return connObjectUtil.getConnObjectTO(connectorObject);
    }
View Full Code Here

TOP

Related Classes of org.identityconnectors.framework.common.objects.ConnectorObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.