Package org.talend.esb.servicelocator.client

Examples of org.talend.esb.servicelocator.client.SLEndpoint


     */
    private W3CEndpointReference buildEndpoint(QName serviceName, String adress) {
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        // builder.serviceName(serviceName);
        builder.address(adress);
        SLEndpoint endpoint = null;
        try {
            endpoint = locatorClient.getEndpoint(serviceName, adress);
        } catch (ServiceLocatorException e) {
            throw new WebApplicationException(Response
                    .status(Status.INTERNAL_SERVER_ERROR)
                    .entity(e.getMessage()).build());
        } catch (InterruptedException e) {
            throw new WebApplicationException(Response
                    .status(Status.INTERNAL_SERVER_ERROR)
                    .entity(e.getMessage()).build());
        }
        if (endpoint != null) {
            SLProperties properties = endpoint.getProperties();
            if (properties != null && !properties.getPropertyNames().isEmpty()) {
                EndpointTransformerImpl transformer = new EndpointTransformerImpl();

                DOMResult result = new DOMResult();
                transformer.writePropertiesTo(properties, result);
View Full Code Here


    private W3CEndpointReference buildEndpoint(QName serviceName, String adress)
            throws ServiceLocatorFault, InterruptedExceptionFault {
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        // builder.serviceName(serviceName);
        builder.address(adress);
        SLEndpoint endpoint = null;
        try {
            endpoint = locatorClient.getEndpoint(serviceName, adress);
        } 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);
        }
        if (endpoint != null) {
            SLProperties properties = endpoint.getProperties();
            if (properties != null && !properties.getPropertyNames().isEmpty()) {
                EndpointTransformerImpl transformer = new EndpointTransformerImpl();

                DOMResult result = new DOMResult();
                transformer.writePropertiesTo(properties, result);
View Full Code Here

        serviceNode.ensureExists();

        EndpointNode endpointNode = serviceNode.getEndPoint(endpoint);
        if (endpointNode.exists()) {
            byte[] content = endpointNode.getContent();
            SLEndpoint oldEndpoint = transformer.toSLEndpoint(serviceName, content, false);
            lastTimeStopped = oldEndpoint.getLastTimeStopped();
        }

        byte[] content = createContent(epProvider, lastTimeStarted, lastTimeStopped);
       
        endpointNode.ensureExists(content);
View Full Code Here

        EndpointNode endpointNode = serviceNode.getEndPoint(endpoint);

            if (endpointNode.exists()) {
               
                byte[] oldContent = endpointNode.getContent();
                SLEndpoint oldEndpoint = transformer.toSLEndpoint(serviceName, oldContent, false);
                lastTimeStarted = oldEndpoint.getLastTimeStarted();

                endpointNode.setOffline();

                byte[] content = createContent(epProvider, lastTimeStarted, lastTimeStopped);
                endpointNode.setContent(content);
View Full Code Here

           
            List<SLEndpoint> slEndpoints = new ArrayList<SLEndpoint>(endpointNodes.size());
            for (EndpointNode endpointNode : endpointNodes ) {
                byte[] content = endpointNode.getContent();
                final boolean isLive = endpointNode.isLive();
                SLEndpoint slEndpoint = transformer.toSLEndpoint(serviceName, content, isLive);
                slEndpoints.add(slEndpoint);
            }
            return slEndpoints;
        } else {
            return Collections.emptyList();
View Full Code Here

    
            for (EndpointNode endpointNode : endpointNodes) {

                if (endpointNode.isLive()) {
                    byte[] content = endpointNode.getContent();
                    SLEndpoint endpoint = transformer.toSLEndpoint(serviceName, content, true);
                    SLProperties props = endpoint.getProperties();

                    if (LOG.isLoggable(Level.INFO)) {
                        StringBuilder sb = new StringBuilder();
                        for (String prop: props.getPropertyNames()) {
                            sb.append(prop + " : ");
View Full Code Here

        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);

        List<SLEndpoint> endpoints = slc.getEndpoints(SERVICE_QNAME_1);

        SLEndpoint endpoint = endpoints.get(0);
        assertTrue(endpoint.isLive());
        verifyAll();
    }
View Full Code Here

        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);

        List<SLEndpoint> endpoints = slc.getEndpoints(SERVICE_QNAME_1);

        SLEndpoint endpoint = endpoints.get(0);
        assertFalse(endpoint.isLive());
        verifyAll();
    }
View Full Code Here

        replayAll();
       
        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);

        SLEndpoint endpoint = slc.getEndpoint(SERVICE_QNAME_1, ENDPOINT_1);

        assertFalse(endpoint.isLive());
        assertEquals(SERVICE_QNAME_1, endpoint.forService());
        assertEquals(LAST_TIME_STARTED, endpoint.getLastTimeStarted());
        verifyAll();
    }
View Full Code Here

        replayAll();

        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);

        SLEndpoint endpoint = slc.getEndpoint(SERVICE_QNAME_1, ENDPOINT_1);

        assertNull(endpoint);
        verifyAll();
    }
View Full Code Here

TOP

Related Classes of org.talend.esb.servicelocator.client.SLEndpoint

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.