Cloud Foundry Java Client Facade

A facade of the official Cloud Foundry Java client

Лицензия

Лицензия

Категории

Категории

Java Языки программирования CLI Взаимодействие с пользователем
Группа

Группа

com.sap.cloud.lm.sl
Идентификатор

Идентификатор

cloudfoundry-java-client-facade
Последняя версия

Последняя версия

2.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Cloud Foundry Java Client Facade
A facade of the official Cloud Foundry Java client
Ссылка на сайт

Ссылка на сайт

https://github.com/SAP/cf-java-client-sap
Организация-разработчик

Организация-разработчик

SAP SE
Система контроля версий

Система контроля версий

https://github.com/SAP/cf-java-client-sap.git

Скачать cloudfoundry-java-client-facade

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.sap.cloud.lm.sl/cloudfoundry-java-client-facade/ -->
<dependency>
    <groupId>com.sap.cloud.lm.sl</groupId>
    <artifactId>cloudfoundry-java-client-facade</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.sap.cloud.lm.sl/cloudfoundry-java-client-facade/
implementation 'com.sap.cloud.lm.sl:cloudfoundry-java-client-facade:2.0.0'
// https://jarcasting.com/artifacts/com.sap.cloud.lm.sl/cloudfoundry-java-client-facade/
implementation ("com.sap.cloud.lm.sl:cloudfoundry-java-client-facade:2.0.0")
'com.sap.cloud.lm.sl:cloudfoundry-java-client-facade:jar:2.0.0'
<dependency org="com.sap.cloud.lm.sl" name="cloudfoundry-java-client-facade" rev="2.0.0">
  <artifact name="cloudfoundry-java-client-facade" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.sap.cloud.lm.sl', module='cloudfoundry-java-client-facade', version='2.0.0')
)
libraryDependencies += "com.sap.cloud.lm.sl" % "cloudfoundry-java-client-facade" % "2.0.0"
[com.sap.cloud.lm.sl/cloudfoundry-java-client-facade "2.0.0"]

Зависимости

compile (7)

Идентификатор библиотеки Тип Версия
org.springframework : spring-webflux jar 5.2.9.RELEASE
org.springframework.security.oauth : spring-security-oauth2 jar 2.5.0.RELEASE
commons-io : commons-io jar 2.8.0
com.fasterxml.jackson.core : jackson-core jar 2.11.3
com.fasterxml.jackson.core : jackson-databind jar 2.11.3
org.cloudfoundry : cloudfoundry-client-reactor jar 4.10.0.RELEASE
io.micrometer : micrometer-core jar 1.5.5

provided (1)

Идентификатор библиотеки Тип Версия
org.immutables : value jar 2.8.8

test (6)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter-api jar 5.7.0
org.junit.jupiter : junit-jupiter-params jar 5.7.0
org.junit.platform : junit-platform-launcher jar 1.7.0
org.junit.jupiter : junit-jupiter-engine jar 5.7.0
org.junit.vintage : junit-vintage-engine jar 5.7.0
org.mockito : mockito-core jar 3.5.13

Модули Проекта

Данный проект не имеет модулей.

cf-java-client Build Status REUSE status

This is a facade that hides the official Cloud Foundry Java client (https://github.com/cloudfoundry/cf-java-client) under a synchronous API similar to the one it had back in version 1.1.4.RELEASE (see https://github.com/cloudfoundry/cf-java-client/tree/v1.1.4.RELEASE).

Introduction

The cf-java-client project is a Java language binding for interacting with a Cloud Foundry instance. It provides similar functionality to the Cloud Foundry command line client (https://github.com/cloudfoundry/cli), such as creating services and applications, binding services to applications or even registering service brokers. It communicates with the Cloud Foundry Controller by making HTTP requests to the controller's REST API, which is documented at https://apidocs.cloudfoundry.org/ (V2) and https://v3-apidocs.cloudfoundry.org/ (V3).

Usage

In order to use this client in your application, you need to include the following dependency in your pom.xml:

<dependency>
    <groupId>com.sap.cloud.lm.sl</groupId>
    <artifactId>cloudfoundry-client-facade</artifactId>
    <version>...</version>
</dependency>

The latest version can always be found in Maven Central: https://mvnrepository.com/artifact/com.sap.cloud.lm.sl/cloudfoundry-client-facade

The following is a very simple sample application that connects to a Cloud Foundry instance, logs in, and displays some information about the Cloud Foundry account. When running the program, provide the Cloud Foundry target API endpoint, along with a valid user name and password as command-line parameters.

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;

import com.sap.cloudfoundry.client.facade.domain.CloudApplication;
import com.sap.cloudfoundry.client.facade.domain.CloudServiceInstance;
import com.sap.cloudfoundry.client.facade.domain.CloudSpace;

public final class JavaSample {

    public static void main(String[] args) {
        String target = args[0];
        String username = args[1];
        String password = args[2];

        CloudCredentials credentials = new CloudCredentials(username, password);
        CloudControllerClient client = new CloudControllerClientImpl(getTargetURL(target), credentials);
        client.login();

        System.out.printf("%nSpaces:%n");
        for (CloudSpace space : client.getSpaces()) {
            System.out.printf("  %s\t(%s)%n", space.getName(), space.getOrganization()
                                                                    .getName());
        }

        System.out.printf("%nApplications:%n");
        for (CloudApplication application : client.getApplications()) {
            System.out.printf("  %s%n", application.getName());
        }

        System.out.printf("%nServices%n");
        for (CloudServiceInstance service : client.getServiceInstances()) {
            System.out.printf("  %s\t(%s)%n", service.getName(), service.getLabel());
        }
    }

    private static URL getTargetURL(String target) {
        try {
            return URI.create(target)
                      .toURL();
        } catch (MalformedURLException e) {
            throw new IllegalArgumentException("The target URL is not valid: " + e.getMessage());
        }
    }

}

Compiling and Packaging

The project is built using Apache Maven and you can use the following command to do so:

mvn clean install

Additionally, the project uses Immutables to generate value objects. As a result, it won't compile in IDEs like Eclipse or IntelliJ unless you also have an enabled annotation processor. See this guide for instructions on how to configure your IDE.

com.sap.cloud.lm.sl

SAP

SAP SE, a global software company, is one of the largest vendors of ERP and other enterprise applications.

Версии библиотеки

Версия
2.0.0