Package com.cumulocity.sdk.client

Examples of com.cumulocity.sdk.client.SDKException


            if(result == null && lastException != null) {
                LOG.error("Timeout occured, last exception: " + lastException);
            }
            return result;
        } catch (InterruptedException e) {
            throw new SDKException("Error polling data", e);
        } finally {
            stop();
        }
    }
View Full Code Here


    }

    private String createChildDevicePath(ManagedObjectRepresentation managedObjectRepresentation) throws SDKException {
        if (managedObjectRepresentation == null || managedObjectRepresentation.getChildDevices() == null) {
            throw new SDKException("Unable to get the child device URL");
        }

        return managedObjectRepresentation.getChildDevices().getSelf();

    }
View Full Code Here

        return morr;
    }

    private String createChildAssetPath(ManagedObjectRepresentation managedObjectRepresentation) throws SDKException {
        if (managedObjectRepresentation == null || managedObjectRepresentation.getChildAssets() == null) {
            throw new SDKException("Unable to get the child device URL");
        }
        return managedObjectRepresentation.getChildAssets().getSelf();
    }
View Full Code Here

  }
 
  @Override
    public ManagedObject getManagedObjectApi(GId globalId) throws SDKException {
        if ((globalId == null) || (globalId.getValue() == null)) {
            throw new SDKException("Cannot determine the Global ID Value");
        }
        String url = getMOCollectionUrl() + "/" + globalId.getValue();
        return new ManagedObjectImpl(restConnector, url, pageSize);
    }
View Full Code Here

    }
   
    @Override
    public ExternalIDRepresentation getExternalId(ID extId) throws SDKException {
        if (extId == null || extId.getValue() == null || extId.getType() == null) {
            throw new SDKException("XtId without value/type or null");
        }

        Map<String, String> filter = new HashMap<String, String>();
        filter.put(TYPE, extId.getType());
        filter.put(EXTERNAL_ID, extId.getValue());
View Full Code Here

    }

    @Override
    public ExternalIDCollection getExternalIdsOfGlobalId(GId gid) throws SDKException {
        if (gid == null || gid.getValue() == null) {
            throw new SDKException("Cannot determine global id value");
        }

        Map<String, String> filter = new HashMap<String, String>();
        filter.put(GLOBAL_ID, gid.getValue());
        String uri = templateUrlParser.replacePlaceholdersWithParams(getIdentityRepresentation().getExternalIdsOfGlobalId(), filter);
View Full Code Here

    }

    @Override
    public ExternalIDRepresentation create(ExternalIDRepresentation representation) throws SDKException {
        if (representation == null || representation.getManagedObject() == null || representation.getManagedObject().getId() == null) {
            throw new SDKException("Cannot determine global id value");
        }

        Map<String, String> filter = new HashMap<String, String>();
        filter.put(GLOBAL_ID, representation.getManagedObject().getId().getValue());
        String path = templateUrlParser.replacePlaceholdersWithParams(getIdentityRepresentation().getExternalIdsOfGlobalId(), filter);
View Full Code Here

   
    @Test(expected = SDKException.class)
    public void shouldThrowException() {
        Future future = bufferRequestService.create(new BufferedRequest());
        Result result = new Result();
        result.setException(new SDKException(""));
        bufferRequestService.addResponse(REQUEST_ID, result);
       
        future.get();
    }
View Full Code Here

            @Override
            public boolean matchesSafely(Exception e) {
                if (!(e instanceof SDKException)) {
                    return false;
                }
                SDKException sdkE = (SDKException) e;
                return httpStatus == sdkE.getHttpStatus();
            }

            @Override
            public void describeTo(Description description) {
                description.appendText("an SDKException with status ").appendValue(httpStatus);
View Full Code Here

    private BayeuxClient openSession(final BayeuxClient bayeuxClient) throws SDKException {
        bayeuxClient.handshake();
        boolean handshake = bayeuxClient.waitFor(TimeUnit.SECONDS.toMillis(CONNECTED_STATE_TIMEOUT), State.CONNECTED);
        if (!handshake) {
            throw new SDKException("unable to connect to server");
        }
        return bayeuxClient;
    }
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.