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())));
}
}
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");
}
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");
}
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");
}
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");
}
Aggregations