Package org.platformlayer

Examples of org.platformlayer.PlatformLayerClientException


  private <V> Iterable<V> doListConcatenation(Iterable<ChildClient> childClients, HostFunction<Iterable<V>> function)
      throws PlatformLayerClientException {
    try {
      return ListConcatentation.joinLists(forkJoinPool, childClients, function);
    } catch (ExecutionException e) {
      throw new PlatformLayerClientException("Error while building item list", e);
    }
  }
View Full Code Here


  private UntypedItemCollection doListConcatenationUntyped(Iterable<ChildClient> childClients,
      HostFunction<UntypedItemCollection> function) throws PlatformLayerClientException {
    try {
      return ListConcatentation.joinListsUntypedItems(forkJoinPool, childClients, function);
    } catch (ExecutionException e) {
      throw new PlatformLayerClientException("Error while building item list", e);
    }
  }
View Full Code Here

  private <T> List<T> doListConcatenationTyped(Iterable<ChildClient> childClients,
      HostFunction<? extends Iterable<T>> function) throws PlatformLayerClientException {
    try {
      return ListConcatentation.joinListsTypedItems(forkJoinPool, childClients, function);
    } catch (ExecutionException e) {
      throw new PlatformLayerClientException("Error while building item list", e);
    }
  }
View Full Code Here

  private JobDataList doListConcatenationJobs(Iterable<ChildClient> childClients, HostFunction<JobDataList> function)
      throws PlatformLayerClientException {
    try {
      return ListConcatentation.joinListsJobs(forkJoinPool, childClients, function);
    } catch (ExecutionException e) {
      throw new PlatformLayerClientException("Error while building item list", e);
    }
  }
View Full Code Here

    int count = 0;
    for (T i : iterable) {
      if (count == 0) {
        item = i;
      } else {
        throw new PlatformLayerClientException("Expected exactly one matching item");
      }
    }
    return item;
  }
View Full Code Here

        if (type.equals(itemType)) {
          return service.serviceType;
        }
      }
    }
    throw new PlatformLayerClientException("Cannot find service for item: " + itemType);
  }
View Full Code Here

    @Override
    public List<T> apply(final ChildClient child) throws PlatformLayerClientException {
      try {
        return child.client.listItems(clazz);
      } catch (OpsException e) {
        throw new PlatformLayerClientException("Error listing items", e);
      }
    }
View Full Code Here

  @Override
  public JobData deleteItem(PlatformLayerKey key) throws PlatformLayerClientException {
    try {
      return itemService.deleteItem(auth, key);
    } catch (OpsException e) {
      throw new PlatformLayerClientException("Error deleting item", e);
    }
  }
View Full Code Here

    ModelClass<?> modelClass = getModelClass(key.getServiceType(), key.getItemType());

    try {
      return itemRepository.changeTags(modelClass, getProject(), key.getItemId(), tagChanges, ifVersion);
    } catch (RepositoryException e) {
      throw new PlatformLayerClientException("Error changing tags", e);
    }
  }
View Full Code Here

  protected ModelClass<?> getModelClass(ServiceType serviceType, ItemType itemType)
      throws PlatformLayerClientException {
    ServiceProvider serviceProvider = getServiceProvider(serviceType);
    if (serviceProvider == null) {
      log.warn("Unknown serviceType: " + serviceType);
      throw new PlatformLayerClientException("Service type not recognized: " + serviceType.getKey());
    }
    ModelClass<?> modelClass = serviceProvider.getModels().find(itemType);
    if (modelClass == null) {
      log.warn("Unknown itemtype: " + itemType);
      throw new PlatformLayerClientException("Item type not recognized: " + itemType.getKey());
    }

    return modelClass;
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.PlatformLayerClientException

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.