Search in sources :

Example 6 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class RConnector method toJAXB.

@Override
public ConnectorType toJAXB(PrismContext prismContext, Collection<SelectorOptions<GetOperationOptions>> options) throws DtoTranslationException {
    ConnectorType object = new ConnectorType();
    RUtil.revive(object, prismContext);
    RConnector.copyToJAXB(this, object, prismContext, options);
    return object;
}
Also used : ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType)

Example 7 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class TestWSSanity method test015SearchLdapConnector.

// TODO: fetch&parse schema http://..?WSDL
@Test
public void test015SearchLdapConnector() throws Exception {
    final String TEST_NAME = "test015SearchLdapConnector";
    displayTestTitle(TEST_NAME);
    QueryType query = new QueryType();
    query.setFilter(ModelClientUtil.parseSearchFilterType("<equal xmlns='http://prism.evolveum.com/xml/ns/public/query-3' xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3' >" + "<path>c:connectorType</path>" + "<value>" + CONNECTOR_LDAP_TYPE + "</value>" + "</equal>"));
    Holder<ObjectListType> objectListHolder = new Holder<>();
    Holder<OperationResultType> resultHolder = new Holder<>();
    // WHEN
    modelPort.searchObjects(ModelClientUtil.getTypeQName(ConnectorType.class), query, null, objectListHolder, resultHolder);
    // THEN
    assertSuccess(resultHolder);
    ObjectListType objectList = objectListHolder.value;
    assertEquals("Unexpected number of LDAP connectors", 1, objectList.getObject().size());
    ConnectorType ldapConnector = (ConnectorType) objectList.getObject().get(0);
    assertNotNull("Null LDAP connector", ldapConnector);
    connectorLdapOid = ldapConnector.getOid();
    assertNotNull("Null LDAP connector OID", connectorLdapOid);
}
Also used : ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) Holder(javax.xml.ws.Holder) ObjectListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType) QueryType(com.evolveum.prism.xml.ns._public.query_3.QueryType) Test(org.testng.annotations.Test)

Example 8 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class ConnIdNameMapper method objectClassToIcf.

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);
}
Also used : ResourceAttributeContainerDefinition(com.evolveum.midpoint.schema.processor.ResourceAttributeContainerDefinition) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) QName(javax.xml.namespace.QName) ResourceAttributeContainer(com.evolveum.midpoint.schema.processor.ResourceAttributeContainer)

Example 9 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class ConnectorFactoryConnIdImpl method getConnectorInfo.

/**
	 * Get contect informations
	 * 
	 * @param connectorType
	 * @return
	 * @throws ObjectNotFoundException
	 */
private ConnectorInfo getConnectorInfo(ConnectorType connectorType) throws ObjectNotFoundException {
    if (!SchemaConstants.ICF_FRAMEWORK_URI.equals(connectorType.getFramework())) {
        throw new ObjectNotFoundException("Requested connector for framework " + connectorType.getFramework() + " cannot be found in framework " + SchemaConstants.ICF_FRAMEWORK_URI);
    }
    ConnectorKey key = getConnectorKey(connectorType);
    if (connectorType.getConnectorHost() == null && connectorType.getConnectorHostRef() == null) {
        // Local connector
        return getLocalConnectorInfoManager().findConnectorInfo(key);
    }
    ConnectorHostType host = connectorType.getConnectorHost();
    if (host == null) {
        throw new ObjectNotFoundException("Attempt to use remote connector without ConnectorHostType resolved (there is only ConnectorHostRef");
    }
    return getRemoteConnectorInfoManager(host).findConnectorInfo(key);
}
Also used : ConnectorHostType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType) ConnectorKey(org.identityconnectors.framework.api.ConnectorKey) ObjectNotFoundException(com.evolveum.midpoint.util.exception.ObjectNotFoundException)

Example 10 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class DiscoverConnectorsExecutor method rebindConnectors.

private void rebindConnectors(Set<ConnectorType> newConnectors, ExecutionContext context, OperationResult result) throws ScriptExecutionException {
    Map<String, String> rebindMap = new HashMap<>();
    for (ConnectorType connectorType : newConnectors) {
        determineConnectorMappings(rebindMap, connectorType, context, result);
    }
    LOGGER.trace("Connector rebind map: {}", rebindMap);
    rebindResources(rebindMap, context, result);
}
Also used : ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType)

Aggregations

ConnectorType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType)39 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)21 Test (org.testng.annotations.Test)17 PrismObject (com.evolveum.midpoint.prism.PrismObject)13 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)13 Task (com.evolveum.midpoint.task.api.Task)12 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)12 PrismSchema (com.evolveum.midpoint.prism.schema.PrismSchema)8 AbstractIntegrationTest (com.evolveum.midpoint.test.AbstractIntegrationTest)8 SystemException (com.evolveum.midpoint.util.exception.SystemException)8 QName (javax.xml.namespace.QName)7 CommunicationException (com.evolveum.midpoint.util.exception.CommunicationException)6 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)6 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)4 SchemaRegistry (com.evolveum.midpoint.prism.schema.SchemaRegistry)4 ConnectorConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorConfigurationType)4 ConnectorHostType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType)4 XmlSchemaType (com.evolveum.midpoint.xml.ns._public.common.common_3.XmlSchemaType)4 Element (org.w3c.dom.Element)4 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)3