Search in sources :

Example 11 with ServiceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType in project UVMS-ExchangeModule-APP by UnionVMS.

the class RegistryBusEventListener method onMessage.

@Override
public void onMessage(Message message) {
    TextMessage textMessage = (TextMessage) message;
    ServiceType settings = null;
    try {
        ExchangeRegistryBaseRequest request = JAXBMarshaller.unmarshallTextMessage(textMessage, ExchangeRegistryBaseRequest.class);
        LOG.info("Eventbus listener for Exchange Registry (ExchangeModelConstants.EXCHANGE_REGISTER_SERVICE): {} {}", ExchangeModelConstants.EXCHANGE_REGISTER_SERVICE, request);
        switch(request.getMethod()) {
            case REGISTER_SERVICE:
                RegisterServiceRequest regReq = JAXBMarshaller.unmarshallTextMessage(textMessage, RegisterServiceRequest.class);
                settings = regReq.getService();
                registerServiceEvent.fire(new PluginMessageEvent(textMessage));
                break;
            case UNREGISTER_SERVICE:
                UnregisterServiceRequest unRegReq = JAXBMarshaller.unmarshallTextMessage(textMessage, UnregisterServiceRequest.class);
                settings = unRegReq.getService();
                unregisterServiceEvent.fire(new PluginMessageEvent(textMessage));
                break;
            default:
                LOG.error("[ Not implemented method consumed: {} ]", request.getMethod());
                throw new ExchangeMessageException("[ Not implemented method consumed: " + request.getMethod() + " ]");
        }
    } catch (ExchangeMessageException | ExchangeModelMarshallException | NullPointerException e) {
        LOG.error("[ Error when receiving message on topic in exchange: {}] {}", message, e);
        errorEvent.fire(new PluginMessageEvent(textMessage, settings, ExchangePluginResponseMapper.mapToPluginFaultResponse(FaultCode.EXCHANGE_TOPIC_MESSAGE.getCode(), "Error when receiving message in exchange " + e.getMessage())));
    }
}
Also used : ExchangeModelMarshallException(eu.europa.ec.fisheries.uvms.exchange.model.exception.ExchangeModelMarshallException) ServiceType(eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceType) UnregisterServiceRequest(eu.europa.ec.fisheries.schema.exchange.registry.v1.UnregisterServiceRequest) RegisterServiceRequest(eu.europa.ec.fisheries.schema.exchange.registry.v1.RegisterServiceRequest) ExchangeMessageException(eu.europa.ec.fisheries.uvms.exchange.message.exception.ExchangeMessageException) PluginMessageEvent(eu.europa.ec.fisheries.uvms.exchange.message.event.carrier.PluginMessageEvent) TextMessage(javax.jms.TextMessage) ExchangeRegistryBaseRequest(eu.europa.ec.fisheries.schema.exchange.registry.v1.ExchangeRegistryBaseRequest)

Example 12 with ServiceType

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

the class SqaleRepoSearchTest method test916SearchByOidPrefixStartsWith.

@Test
public void test916SearchByOidPrefixStartsWith() throws SchemaException {
    when("searching for objects with OID prefix starting with");
    OperationResult operationResult = createOperationResult();
    SearchResultList<ServiceType> result = repositorySearchObjects(ServiceType.class, prismContext.queryFor(ServiceType.class).item(ServiceType.F_COST_CENTER).eq("OIDTEST").and().item(PrismConstants.T_ID).startsWith("11").build(), operationResult);
    then("user with OID starting with the specified prefix are returned");
    assertThatOperationResult(operationResult).isSuccess();
    assertThat(result).extracting(o -> o.getOid()).containsExactlyInAnyOrder("11000000-0000-0000-0000-000000000000", "11000000-1000-0000-0000-100000000000", "11000000-1000-0000-0000-100000000001", "11ffffff-ffff-ffff-ffff-fffffffffffe", "11ffffff-ffff-ffff-ffff-ffffffffffff");
}
Also used : QFocus(com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus) XmlTypeConverter.createXMLGregorianCalendar(com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) T_PARENT(com.evolveum.midpoint.prism.PrismConstants.T_PARENT) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest) F_VALID_FROM(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_FROM) OperationResultStatus(com.evolveum.midpoint.schema.result.OperationResultStatus) BigDecimal(java.math.BigDecimal) DOMUtil(com.evolveum.midpoint.util.DOMUtil) Assert(org.testng.Assert) F_ACTIVATION(com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType.F_ACTIVATION) ObjectTypeUtil(com.evolveum.midpoint.schema.util.ObjectTypeUtil) TestUtil(com.evolveum.midpoint.test.util.TestUtil) Assertions(org.assertj.core.api.Assertions) BigInteger(java.math.BigInteger) RepositoryService(com.evolveum.midpoint.repo.api.RepositoryService) MObjectType(com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) QAssignmentHolder(com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder) QObject(com.evolveum.midpoint.repo.sqale.qmodel.object.QObject) BeforeClass(org.testng.annotations.BeforeClass) ORG_DEFAULT(com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT) MiscUtil(com.evolveum.midpoint.util.MiscUtil) UUID(java.util.UUID) F_VALID_TO(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_TO) Instant(java.time.Instant) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) MiscUtil.asXMLGregorianCalendar(com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar) PolyStringItemFilterProcessor(com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor) List(java.util.List) ItemName(com.evolveum.midpoint.prism.path.ItemName) SchemaService(com.evolveum.midpoint.schema.SchemaService) SearchResultList(com.evolveum.midpoint.schema.SearchResultList) F_ASSIGNMENT(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType.F_ASSIGNMENT) SystemException(com.evolveum.midpoint.util.exception.SystemException) MObject(com.evolveum.midpoint.repo.sqale.qmodel.object.MObject) T_OBJECT_REFERENCE(com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE) QName(javax.xml.namespace.QName) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Example 13 with ServiceType

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

the class SqaleRepoSearchTest method test913SearchByOidGoe.

@Test
public void test913SearchByOidGoe() throws SchemaException {
    when("searching for objects with OID greater than or equal");
    OperationResult operationResult = createOperationResult();
    SearchResultList<ServiceType> result = repositorySearchObjects(ServiceType.class, prismContext.queryFor(ServiceType.class).item(ServiceType.F_COST_CENTER).eq("OIDTEST").and().item(PrismConstants.T_ID).ge("ffffffff-ffff-ffff-ffff-ffffffffffff").build(), operationResult);
    then("user with OID greater than or equal to specified are returned");
    assertThatOperationResult(operationResult).isSuccess();
    assertThat(result).extracting(o -> o.getOid()).containsExactlyInAnyOrder("ffffffff-ffff-ffff-ffff-ffffffffffff");
}
Also used : QFocus(com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus) XmlTypeConverter.createXMLGregorianCalendar(com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) T_PARENT(com.evolveum.midpoint.prism.PrismConstants.T_PARENT) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest) F_VALID_FROM(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_FROM) OperationResultStatus(com.evolveum.midpoint.schema.result.OperationResultStatus) BigDecimal(java.math.BigDecimal) DOMUtil(com.evolveum.midpoint.util.DOMUtil) Assert(org.testng.Assert) F_ACTIVATION(com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType.F_ACTIVATION) ObjectTypeUtil(com.evolveum.midpoint.schema.util.ObjectTypeUtil) TestUtil(com.evolveum.midpoint.test.util.TestUtil) Assertions(org.assertj.core.api.Assertions) BigInteger(java.math.BigInteger) RepositoryService(com.evolveum.midpoint.repo.api.RepositoryService) MObjectType(com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) QAssignmentHolder(com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder) QObject(com.evolveum.midpoint.repo.sqale.qmodel.object.QObject) BeforeClass(org.testng.annotations.BeforeClass) ORG_DEFAULT(com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT) MiscUtil(com.evolveum.midpoint.util.MiscUtil) UUID(java.util.UUID) F_VALID_TO(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_TO) Instant(java.time.Instant) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) MiscUtil.asXMLGregorianCalendar(com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar) PolyStringItemFilterProcessor(com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor) List(java.util.List) ItemName(com.evolveum.midpoint.prism.path.ItemName) SchemaService(com.evolveum.midpoint.schema.SchemaService) SearchResultList(com.evolveum.midpoint.schema.SearchResultList) F_ASSIGNMENT(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType.F_ASSIGNMENT) SystemException(com.evolveum.midpoint.util.exception.SystemException) MObject(com.evolveum.midpoint.repo.sqale.qmodel.object.MObject) T_OBJECT_REFERENCE(com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE) QName(javax.xml.namespace.QName) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Example 14 with ServiceType

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

the class SqaleRepoSearchTest method test912SearchByOidLoe.

@Test
public void test912SearchByOidLoe() throws SchemaException {
    when("searching for objects with OID lower than or equal");
    OperationResult operationResult = createOperationResult();
    SearchResultList<ServiceType> result = repositorySearchObjects(ServiceType.class, prismContext.queryFor(ServiceType.class).item(ServiceType.F_COST_CENTER).eq("OIDTEST").and().item(PrismConstants.T_ID).le("00000000-1000-0000-0000-000000000001").build(), operationResult);
    then("user with OID lower than or equal to specified are returned");
    assertThatOperationResult(operationResult).isSuccess();
    assertThat(result).extracting(o -> o.getOid()).containsExactlyInAnyOrder("00000000-1000-0000-0000-000000000000", "00000000-1000-0000-0000-000000000001");
}
Also used : QFocus(com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus) XmlTypeConverter.createXMLGregorianCalendar(com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) T_PARENT(com.evolveum.midpoint.prism.PrismConstants.T_PARENT) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest) F_VALID_FROM(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_FROM) OperationResultStatus(com.evolveum.midpoint.schema.result.OperationResultStatus) BigDecimal(java.math.BigDecimal) DOMUtil(com.evolveum.midpoint.util.DOMUtil) Assert(org.testng.Assert) F_ACTIVATION(com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType.F_ACTIVATION) ObjectTypeUtil(com.evolveum.midpoint.schema.util.ObjectTypeUtil) TestUtil(com.evolveum.midpoint.test.util.TestUtil) Assertions(org.assertj.core.api.Assertions) BigInteger(java.math.BigInteger) RepositoryService(com.evolveum.midpoint.repo.api.RepositoryService) MObjectType(com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) QAssignmentHolder(com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder) QObject(com.evolveum.midpoint.repo.sqale.qmodel.object.QObject) BeforeClass(org.testng.annotations.BeforeClass) ORG_DEFAULT(com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT) MiscUtil(com.evolveum.midpoint.util.MiscUtil) UUID(java.util.UUID) F_VALID_TO(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_TO) Instant(java.time.Instant) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) MiscUtil.asXMLGregorianCalendar(com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar) PolyStringItemFilterProcessor(com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor) List(java.util.List) ItemName(com.evolveum.midpoint.prism.path.ItemName) SchemaService(com.evolveum.midpoint.schema.SchemaService) SearchResultList(com.evolveum.midpoint.schema.SearchResultList) F_ASSIGNMENT(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType.F_ASSIGNMENT) SystemException(com.evolveum.midpoint.util.exception.SystemException) MObject(com.evolveum.midpoint.repo.sqale.qmodel.object.MObject) T_OBJECT_REFERENCE(com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE) QName(javax.xml.namespace.QName) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Example 15 with ServiceType

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

the class SqaleRepoSearchTest method test914SearchByOidPrefixGoe.

@Test
public void test914SearchByOidPrefixGoe() throws SchemaException {
    when("searching for objects with OID prefix greater than or equal");
    OperationResult operationResult = createOperationResult();
    SearchResultList<ServiceType> result = repositorySearchObjects(ServiceType.class, prismContext.queryFor(ServiceType.class).item(ServiceType.F_COST_CENTER).eq("OIDTEST").and().item(PrismConstants.T_ID).ge("ff").build(), operationResult);
    then("user with OID greater than or equal to specified prefix are returned");
    assertThatOperationResult(operationResult).isSuccess();
    assertThat(result).extracting(o -> o.getOid()).containsExactlyInAnyOrder("ff000000-0000-0000-0000-000000000000", "ffffffff-ffff-ffff-ffff-ffffffffffff");
}
Also used : QFocus(com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus) XmlTypeConverter.createXMLGregorianCalendar(com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) T_PARENT(com.evolveum.midpoint.prism.PrismConstants.T_PARENT) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest) F_VALID_FROM(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_FROM) OperationResultStatus(com.evolveum.midpoint.schema.result.OperationResultStatus) BigDecimal(java.math.BigDecimal) DOMUtil(com.evolveum.midpoint.util.DOMUtil) Assert(org.testng.Assert) F_ACTIVATION(com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType.F_ACTIVATION) ObjectTypeUtil(com.evolveum.midpoint.schema.util.ObjectTypeUtil) TestUtil(com.evolveum.midpoint.test.util.TestUtil) Assertions(org.assertj.core.api.Assertions) BigInteger(java.math.BigInteger) RepositoryService(com.evolveum.midpoint.repo.api.RepositoryService) MObjectType(com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) QAssignmentHolder(com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder) QObject(com.evolveum.midpoint.repo.sqale.qmodel.object.QObject) BeforeClass(org.testng.annotations.BeforeClass) ORG_DEFAULT(com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT) MiscUtil(com.evolveum.midpoint.util.MiscUtil) UUID(java.util.UUID) F_VALID_TO(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_TO) Instant(java.time.Instant) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) MiscUtil.asXMLGregorianCalendar(com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar) PolyStringItemFilterProcessor(com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor) List(java.util.List) ItemName(com.evolveum.midpoint.prism.path.ItemName) SchemaService(com.evolveum.midpoint.schema.SchemaService) SearchResultList(com.evolveum.midpoint.schema.SearchResultList) F_ASSIGNMENT(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType.F_ASSIGNMENT) SystemException(com.evolveum.midpoint.util.exception.SystemException) MObject(com.evolveum.midpoint.repo.sqale.qmodel.object.MObject) T_OBJECT_REFERENCE(com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE) QName(javax.xml.namespace.QName) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Aggregations

ServiceType (eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceType)7 com.evolveum.midpoint.prism (com.evolveum.midpoint.prism)6 T_OBJECT_REFERENCE (com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE)6 T_PARENT (com.evolveum.midpoint.prism.PrismConstants.T_PARENT)6 ItemName (com.evolveum.midpoint.prism.path.ItemName)6 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)6 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)6 XmlTypeConverter.createXMLGregorianCalendar (com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar)6 RepositoryService (com.evolveum.midpoint.repo.api.RepositoryService)6 SqaleRepoBaseTest (com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)6 QFocus (com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus)6 MObject (com.evolveum.midpoint.repo.sqale.qmodel.object.MObject)6 MObjectType (com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType)6 QAssignmentHolder (com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder)6 QObject (com.evolveum.midpoint.repo.sqale.qmodel.object.QObject)6 PolyStringItemFilterProcessor (com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor)6 SchemaService (com.evolveum.midpoint.schema.SchemaService)6 SearchResultList (com.evolveum.midpoint.schema.SearchResultList)6 SchemaConstants (com.evolveum.midpoint.schema.constants.SchemaConstants)6 ORG_DEFAULT (com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT)6