|
1 | | -# Description [](https://github.com/SAP/cf-java-client-sap/actions/workflows/main.yml) [](https://api.reuse.software/info/github.com/SAP/cf-java-client-sap) |
| 1 | +# Project Status: Archived |
2 | 2 |
|
3 | | -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). |
| 3 | +⚠️ **This project has been archived** ⚠️ |
4 | 4 |
|
5 | | -# Introduction |
| 5 | +The **cf-java-client-sap** repository is no longer actively maintained. |
| 6 | +It was previously a facade/wrapper around the [cf-java-client](https://github.com/cloudfoundry/cf-java-client). |
| 7 | +The code has now been merged into another [project](https://github.com/cloudfoundry/multiapps-controller) for internal use only. |
6 | 8 |
|
7 | | -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](https://docs.cloudfoundry.org/concepts/architecture/cloud-controller.html) 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). |
| 9 | +--- |
8 | 10 |
|
9 | | -# Requirements |
10 | | -* Installed Java 17 |
11 | | -* Installer and configured [Apache Maven](http://maven.apache.org/) |
12 | | -* Access to [SAP Business Technology Platform Cloud Foundry environment](https://sap.com/products/business-technology-platform.html) or other Cloud Foundry instance |
| 11 | +## Guidance for Users |
13 | 12 |
|
14 | | -# Download and Installation |
| 13 | +If you are currently using **cf-java-client-sap**, |
| 14 | +➡️ the recommended path forward is to **use the official [cf-java-client](https://github.com/cloudfoundry/cf-java-client) directly**. |
15 | 15 |
|
16 | | -In order to use this client in your application, you need to include the following dependency in your `pom.xml`: |
| 16 | +This ensures you are always up to date with the latest features, fixes, and improvements from the Cloud Foundry community. |
17 | 17 |
|
18 | | -```xml |
19 | | -<dependency> |
20 | | - <groupId>com.sap.cloud.lm.sl</groupId> |
21 | | - <artifactId>cloudfoundry-client-facade</artifactId> |
22 | | - <version>...</version> |
23 | | -</dependency> |
24 | | -``` |
25 | | -The latest version can always be found in Maven Central: https://mvnrepository.com/artifact/com.sap.cloud.lm.sl/cloudfoundry-client-facade |
| 18 | +--- |
26 | 19 |
|
27 | | -# Usage |
| 20 | +## Why was this change made? |
28 | 21 |
|
29 | | -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. |
| 22 | +- Maintaining a custom facade added unnecessary complexity. |
| 23 | +- The functionality has been consolidated into a project that depends on it internally. |
| 24 | +- For external consumers, using the pure **cf-java-client** is simpler and future-proof. |
30 | 25 |
|
31 | | -```java |
32 | | -import java.net.MalformedURLException; |
33 | | -import java.net.URI; |
34 | | -import java.net.URL; |
| 26 | +--- |
35 | 27 |
|
36 | | -import com.sap.cloudfoundry.client.facade.domain.CloudApplication; |
37 | | -import com.sap.cloudfoundry.client.facade.domain.CloudServiceInstance; |
38 | | -import com.sap.cloudfoundry.client.facade.domain.CloudSpace; |
39 | | - |
40 | | -public final class JavaSample { |
41 | | - |
42 | | - public static void main(String[] args) { |
43 | | - String target = args[0]; |
44 | | - String username = args[1]; |
45 | | - String password = args[2]; |
46 | | - |
47 | | - CloudCredentials credentials = new CloudCredentials(username, password); |
48 | | - CloudControllerClient client = new CloudControllerClientImpl(getTargetURL(target), credentials); |
49 | | - client.login(); |
50 | | - |
51 | | - System.out.printf("%nSpaces:%n"); |
52 | | - for (CloudSpace space : client.getSpaces()) { |
53 | | - System.out.printf(" %s\t(%s)%n", space.getName(), space.getOrganization() |
54 | | - .getName()); |
55 | | - } |
56 | | - |
57 | | - System.out.printf("%nApplications:%n"); |
58 | | - for (CloudApplication application : client.getApplications()) { |
59 | | - System.out.printf(" %s%n", application.getName()); |
60 | | - } |
61 | | - |
62 | | - System.out.printf("%nServices%n"); |
63 | | - for (CloudServiceInstance service : client.getServiceInstances()) { |
64 | | - System.out.printf(" %s\t(%s)%n", service.getName(), service.getLabel()); |
65 | | - } |
66 | | - } |
67 | | - |
68 | | - private static URL getTargetURL(String target) { |
69 | | - try { |
70 | | - return URI.create(target) |
71 | | - .toURL(); |
72 | | - } catch (MalformedURLException e) { |
73 | | - throw new IllegalArgumentException("The target URL is not valid: " + e.getMessage()); |
74 | | - } |
75 | | - } |
76 | | - |
77 | | -} |
78 | | -``` |
79 | | - |
80 | | -# Compiling and Packaging |
81 | | - |
82 | | -The project is built using Java 17 and [Apache Maven](http://maven.apache.org/) and you can use the following command to do so: |
83 | | - |
84 | | -```shell |
85 | | -mvn clean install |
86 | | -``` |
87 | | - |
88 | | -Additionally, the project uses [Immutables](https://immutables.github.io/) 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](https://immutables.github.io/apt.html) for instructions on how to configure your IDE. |
89 | | - |
90 | | -# Support |
91 | | -Check how to obtain support by opening an [issue](CONTRIBUTING.md#report-an-issue). |
92 | | - |
93 | | -# License |
94 | | -Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. |
95 | | -This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the [LICENSE](LICENSE) file. |
| 28 | +🙏 We thank all contributors and users of **cf-java-client-sap** for their support! |
0 commit comments