Package com.cumulocity.sdk.client

Examples of com.cumulocity.sdk.client.SDKException


        super(options, httpClient);
        this.paramters = paramters;
        try {
            this.authentication = new BasicAuthentication(new PlatformPropertiesRealm(paramters));
        } catch (IOException e) {
            throw new SDKException("authentication failed", e);
        }
    }
View Full Code Here


        super.customize(exchange);
        exchange.addRequestHeader(RestConnector.X_CUMULOCITY_APPLICATION_KEY, paramters.getApplicationKey());
        try {
            authentication.setCredentials(exchange);
        } catch (IOException e) {
            throw new SDKException("authentication failed", e);
        }
    }
View Full Code Here

                if(!isSubscriptionToChannel(message)) return;
                if (isSuccessfulySubscribed(message)) {
                    session.getChannel(ClientSessionChannel.META_UNSUBSCRIBE).addListener(new UnsubscribeListener(subscription));
                    subscriptions.add(subscription);
                } else {
                    subscription.getListener().onError(listener.getSubscription(), new SDKException("unable to subscribe on Channel " + channel.getChannelId()
                            + " " + message.get(Message.ERROR_FIELD)));
                }
            } finally {
                metaSubscribeChannel.removeListener(this);
            }
View Full Code Here

            final HttpClient httpClient = new HttpClient();
            configureProxy(httpClient);
            configureAuthentication(httpClient);
            return httpClient;
        } catch (Exception ex) {
            throw new SDKException("unable to create httpclient ", ex);
        }
    }
View Full Code Here

    private void configureProxyAuthentication(HttpClient httpClient) throws SDKException {
        if (hasText(paramters.getProxyUserId()) && hasText(paramters.getProxyPassword())) {
            try {
                httpClient.setProxyAuthentication(new ProxyAuthorization(paramters.getProxyUserId(), paramters.getProxyPassword()));
            } catch (IOException e) {
                throw new SDKException("httpclient proxy configuration failed ", e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.cumulocity.sdk.client.SDKException

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.