Package org.talend.esb.servicelocator.client

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


            boolean connected = connectionLatch.await(settings.getConnectionTimeout(),
                    TimeUnit.MILLISECONDS);

            if (!connected) {
                throw new ServiceLocatorException(
                        "Connection to Service Locator failed.");
            }

            postConnectAction.process(null);
View Full Code Here


        authentication = rootNode.isAuthenticationEnabled();
    }

    private void authenticate() throws ServiceLocatorException {
        if (settings.getUser() == null) {
            throw new ServiceLocatorException(
                    "Service Locator server requires authentication, but no user is defined.");
        }
        zk.addAuthInfo("sl", settings.getAuthInfo());
    }
View Full Code Here

            throws ServiceLocatorException {
        try {
            return new ZooKeeper(settings.getEndpoints(), settings.getSessionTimeout(),
                    new WatcherImpl(connectionLatch));
        } catch (IOException e) {
            throw new ServiceLocatorException(
                    "A network failure occured when connecting to the ZooKeeper server",
                    e);
        }
    }
View Full Code Here

    private ServiceLocatorException locatorException(Exception e) {
        if (LOG.isLoggable(Level.FINE)) {
            LOG.log(Level.FINE, "The service locator server signaled an error",
                    e);
        }
        return new ServiceLocatorException(
                "The service locator server signaled an error.", e);
    }
View Full Code Here

        }
    }

    public byte[] getAuthInfo() throws ServiceLocatorException {
        if (getUser() == null) {
            throw new ServiceLocatorException(
                    "Service Locator server requires authorization, but no user is defined.");
        }

        if (getPassword() == null) {
            throw new ServiceLocatorException(
                    "Service Locator server requires authorization, but no password is defined.");
        }

        return (getUser() + ":" + getPassword()).getBytes(UTF8_CHAR_SET);
    }
View Full Code Here

        } catch (JAXBException e) {
            if (LOG.isLoggable(Level.SEVERE)) {
                LOG.log(Level.SEVERE,
                        "Failed to serialize endpoint data", e);
            }
            throw new ServiceLocatorException("Failed to serialize endpoint data", e);
        }
        return outputStream.toByteArray();
    }
View Full Code Here

        verifyAll();
    }

    @Test
    public void connectFailing() throws Exception {
        expect(backend.connect()).andThrow(new ServiceLocatorException());

        replayAll();

        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);
View Full Code Here

    @Test
    public void failureWhenRegisteringService() throws Exception {
        expect(backend.connect()).andReturn(rootNode);
        expect(rootNode.getServiceNode(SERVICE_QNAME_1)).andReturn(serviceNode);
        serviceNode.ensureExists();
        expectLastCall().andThrow(new ServiceLocatorException());

        replayAll();

        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);
View Full Code Here

    public void removeEndpointFails() throws Exception {
        expect(backend.connect()).andReturn(rootNode);
        expect(rootNode.getServiceNode(SERVICE_QNAME_1)).andReturn(serviceNode);
        expect(serviceNode.getEndPoint(ENDPOINT_1)).andReturn(endpointNode);
        endpointNode.ensureRemoved();
        expectLastCall().andThrow(new ServiceLocatorException());
        replayAll();

        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);
        try {
View Full Code Here

    }

    @Test
    public void failureWhenGettingServices() throws Exception {
        expect(backend.connect()).andReturn(rootNode);
        expect(rootNode.getServiceNames()).andThrow(new ServiceLocatorException());
        replayAll();

        ServiceLocatorImpl slc = new ServiceLocatorImpl();
        slc.setBackend(backend);
View Full Code Here

TOP

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

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.