Search in sources :

Example 11 with EntryType

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

the class EnvironmentalPerformanceInformation method toMappingsStatisticsType.

private MappingsStatisticsType toMappingsStatisticsType() {
    final MappingsStatisticsType rv = new MappingsStatisticsType();
    if (mappingsData == null) {
        return rv;
    }
    final Map<String, Integer> entriesPerType = new HashMap<>();
    for (MappingsStatisticsKey key : mappingsData.keySet()) {
        Integer current = entriesPerType.get(key.getObjectType());
        entriesPerType.put(key.getObjectType(), current != null ? current + 1 : 1);
    }
    for (Map.Entry<MappingsStatisticsKey, GenericStatisticsData> entry : mappingsData.entrySet()) {
        final MappingsStatisticsKey key = entry.getKey();
        final String targetEntryName;
        if (entriesPerType.get(key.getObjectType()) < AGGREGATION_THRESHOLD) {
            targetEntryName = key.getObjectName();
        } else {
            targetEntryName = key.getObjectType() + " (aggregated)";
        }
        MappingsStatisticsEntryType entryType = findMappingsEntryType(rv.getEntry(), targetEntryName);
        if (entryType == null) {
            entryType = new MappingsStatisticsEntryType();
            entryType.setObject(targetEntryName);
            rv.getEntry().add(entryType);
        }
        setValueMapping(entryType, entry.getValue().getCount(), entry.getValue().getMinDuration(), entry.getValue().getMaxDuration(), entry.getValue().getTotalDuration());
    }
    return rv;
}
Also used : MappingsStatisticsType(com.evolveum.midpoint.xml.ns._public.common.common_3.MappingsStatisticsType) HashMap(java.util.HashMap) MappingsStatisticsEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.MappingsStatisticsEntryType) HashMap(java.util.HashMap) Map(java.util.Map)

Example 12 with EntryType

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

the class EnvironmentalPerformanceInformation method toNotificationsStatisticsType.

private NotificationsStatisticsType toNotificationsStatisticsType() {
    NotificationsStatisticsType rv = new NotificationsStatisticsType();
    if (notificationsData == null) {
        return rv;
    }
    for (Map.Entry<NotificationsStatisticsKey, GenericStatisticsData> entry : notificationsData.entrySet()) {
        NotificationsStatisticsKey key = entry.getKey();
        String transport = key.getTransport();
        NotificationsStatisticsEntryType entryType = findNotificationsEntryType(rv.getEntry(), transport);
        if (entryType == null) {
            entryType = new NotificationsStatisticsEntryType();
            entryType.setTransport(transport);
            rv.getEntry().add(entryType);
        }
        setValueNotifications(entryType, key.isSuccess(), entry.getValue().getCount(), entry.getValue().getMinDuration(), entry.getValue().getMaxDuration(), entry.getValue().getTotalDuration());
    }
    return rv;
}
Also used : NotificationsStatisticsEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsEntryType) NotificationsStatisticsType(com.evolveum.midpoint.xml.ns._public.common.common_3.NotificationsStatisticsType) HashMap(java.util.HashMap) Map(java.util.Map)

Example 13 with EntryType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType in project tesb-rt-se by Talend.

the class LocatorRestServiceTest method registerEndpointExpectedLocatorException.

@Test(expected = WebApplicationException.class)
public void registerEndpointExpectedLocatorException() throws ServiceLocatorException, InterruptedException {
    sl.register(endpoint(), EasyMock.eq(true));
    EasyMock.expectLastCall().andStubThrow(new ServiceLocatorException("test"));
    replayAll();
    RegisterEndpointRequest req = new RegisterEndpointRequest();
    EntryType entryType = new EntryType();
    entryType.setKey("test");
    entryType.getValue().add("test");
    req.getEntryType().add(entryType);
    req.setEndpointURL(ENDPOINTURL);
    req.setServiceName(SERVICE_NAME.toString());
    lps.registerEndpoint(req);
}
Also used : RegisterEndpointRequest(org.talend.schemas.esb.locator.rest._2011._11.RegisterEndpointRequest) EntryType(org.talend.schemas.esb.locator.rest._2011._11.EntryType) ServiceLocatorException(org.talend.esb.servicelocator.client.ServiceLocatorException) Test(org.junit.Test)

Example 14 with EntryType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType in project tesb-rt-se by Talend.

the class LocatorSoapServiceImpl method registerEndpoint.

/**
 * Register the endpoint for given service.
 *
 * @param input
 *            RegisterEndpointRequestType encapsulate name of service and
 *            endpointURL. Must not be <code>null</code>
 */
@Override
public void registerEndpoint(QName serviceName, String endpointURL, org.talend.schemas.esb.locator._2011._11.BindingType binding, org.talend.schemas.esb.locator._2011._11.TransportType transport, SLPropertiesType properties) throws ServiceLocatorFault, InterruptedExceptionFault {
    if (LOG.isLoggable(Level.FINE)) {
        LOG.fine("Registering endpoint " + endpointURL + " for service " + serviceName + "...");
    }
    try {
        initLocator();
        BindingType bindingType = binding == null ? BindingType.SOAP11 : BindingType.valueOf(binding.value());
        TransportType transportType = transport == null ? TransportType.HTTP : TransportType.valueOf(transport.value());
        SLPropertiesImpl slProps = null;
        if (properties != null) {
            slProps = new SLPropertiesImpl();
            List<EntryType> entries = properties.getEntry();
            for (EntryType entry : entries) {
                slProps.addProperty(entry.getKey(), entry.getValue());
            }
        }
        SimpleEndpoint eprProvider = new SimpleEndpoint(serviceName, endpointURL, bindingType, transportType, slProps);
        locatorClient.register(eprProvider, true);
    } catch (ServiceLocatorException e) {
        ServiceLocatorFaultDetail serviceFaultDetail = new ServiceLocatorFaultDetail();
        serviceFaultDetail.setLocatorFaultDetail(serviceName.toString() + "throws ServiceLocatorFault");
        throw new ServiceLocatorFault(e.getMessage(), serviceFaultDetail);
    } catch (InterruptedException e) {
        InterruptionFaultDetail interruptionFaultDetail = new InterruptionFaultDetail();
        interruptionFaultDetail.setInterruptionDetail(serviceName.toString() + "throws InterruptionFault");
        throw new InterruptedExceptionFault(e.getMessage(), interruptionFaultDetail);
    }
}
Also used : EntryType(org.talend.schemas.esb.locator._2011._11.EntryType) SimpleEndpoint(org.talend.esb.servicelocator.client.SimpleEndpoint) InterruptionFaultDetail(org.talend.schemas.esb.locator._2011._11.InterruptionFaultDetail) BindingType(org.talend.esb.servicelocator.client.BindingType) ServiceLocatorException(org.talend.esb.servicelocator.client.ServiceLocatorException) SLPropertiesImpl(org.talend.esb.servicelocator.client.SLPropertiesImpl) TransportType(org.talend.esb.servicelocator.client.TransportType) ServiceLocatorFault(org.talend.services.esb.locator.v1.ServiceLocatorFault) InterruptedExceptionFault(org.talend.services.esb.locator.v1.InterruptedExceptionFault) ServiceLocatorFaultDetail(org.talend.schemas.esb.locator._2011._11.ServiceLocatorFaultDetail)

Example 15 with EntryType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType in project tesb-rt-se by Talend.

the class LocatorSoapServiceTest method registerEndpointWithOptionalParameter.

@Test
public void registerEndpointWithOptionalParameter() throws InterruptedExceptionFault, ServiceLocatorFault {
    LocatorSoapServiceImpl lps = new LocatorSoapServiceImpl();
    lps.setLocatorClient(sl);
    SLPropertiesType value = new SLPropertiesType();
    EntryType e = new EntryType();
    e.setKey(PROPERTY_KEY);
    e.getValue().add(PROPERTY_VALUE1);
    e.getValue().add(PROPERTY_VALUE2);
    value.getEntry().add(e);
    lps.registerEndpoint(SERVICE_NAME, ENDPOINTURL, null, null, value);
}
Also used : EntryType(org.talend.schemas.esb.locator._2011._11.EntryType) SLPropertiesType(org.talend.schemas.esb.locator._2011._11.SLPropertiesType) Test(org.junit.Test)

Aggregations

EntryType (com.evolveum.midpoint.xml.ns._public.common.common_3.EntryType)5 HashMap (java.util.HashMap)5 EntryType (org.talend.schemas.esb.locator.rest._2011._11.EntryType)5 Test (org.junit.Test)4 RegisterEndpointRequest (org.talend.schemas.esb.locator.rest._2011._11.RegisterEndpointRequest)4 Map (java.util.Map)3 ServiceLocatorException (org.talend.esb.servicelocator.client.ServiceLocatorException)3 UnknownJavaObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.UnknownJavaObjectType)2 RawType (com.evolveum.prism.xml.ns._public.types_3.RawType)2 RegistryClient (de.fzj.unicore.wsrflite.xmlbeans.client.RegistryClient)2 Serializable (java.io.Serializable)2 WebApplicationException (javax.ws.rs.WebApplicationException)2 JAXBElement (javax.xml.bind.JAXBElement)2 QName (javax.xml.namespace.QName)2 EntryType (org.oasisOpen.docs.wsrf.sg2.EntryType)2 BindingType (org.talend.esb.servicelocator.client.BindingType)2 SLPropertiesImpl (org.talend.esb.servicelocator.client.SLPropertiesImpl)2 SimpleEndpoint (org.talend.esb.servicelocator.client.SimpleEndpoint)2 TransportType (org.talend.esb.servicelocator.client.TransportType)2 EntryType (org.talend.schemas.esb.locator._2011._11.EntryType)2