|
1 | | -# casvisor-java-sdk |
| 1 | +# casvisor-java-sdk |
| 2 | + |
| 3 | +[](https://github.com/casvisor/casvisor-java-sdk/actions/workflows/maven-ci.yml) |
| 4 | +[](https://codebeat.co/projects/github-com-casvisor-casvisor-java-sdk-master) |
| 5 | +[](https://codecov.io/gh/casvisor/casvisor-java-sdk) |
| 6 | +[](https://mvnrepository.com/artifact/org.casbin/casvisor-java-sdk/latest) |
| 7 | +[](https://github.com/casvisor/casvisor-java-sdk/releases/latest) |
| 8 | +[](https://discord.gg/5rPsrAzK7S) |
| 9 | + |
| 10 | +Casvisor Java SDK is the official Java client for Casvisor, used to interact with Casvisor services. |
| 11 | + |
| 12 | +## Step1. Init Config |
| 13 | + |
| 14 | +Initialization requires 5 parameters, which are all string type: |
| 15 | + |
| 16 | +| Name (in order) | Must | Description | |
| 17 | +|------------------|------|-------------------------------------------------------| |
| 18 | +| endpoint | Yes | Casvisor server URL, such as `http://localhost:16001` | |
| 19 | +| clientId | Yes | Application.clientId | |
| 20 | +| clientSecret | Yes | Application.clientSecret | |
| 21 | +| organizationName | Yes | Organization name | |
| 22 | +| applicationName | Yes | Application name | |
| 23 | + |
| 24 | +### You can either initialize the SDK with global config |
| 25 | + |
| 26 | +```java |
| 27 | +CasvisorConfig config = new CasvisorConfig(endpoint, clientId, clientSecret, certificate, organizationName, applicationName); |
| 28 | +``` |
| 29 | + |
| 30 | +## Step2. Get Service and use |
| 31 | + |
| 32 | +Now provide service: ``RecordService`` |
| 33 | +You can create them like |
| 34 | +```java |
| 35 | +RecordService recordService = new RecordService(config); |
| 36 | +``` |
| 37 | +## RecordService |
| 38 | + |
| 39 | +``RecordService``support basic user operations, like: |
| 40 | +- ``getRecord(String name)``, get one record by record name. |
| 41 | +- ``getRecords()``, get all records. |
| 42 | +- ``updateRecord(Record record)/addRecord(Record record)/deleteRecord(Record record)``, write record to database. |
| 43 | + |
| 44 | +## Contribution |
| 45 | + |
| 46 | +We welcome any form of contribution, including but not limited to: |
| 47 | + |
| 48 | +1. Submit issues and suggestions |
| 49 | +2. Submit Pull Request |
| 50 | +3. Improve documentation |
| 51 | + |
| 52 | +## License |
| 53 | + |
| 54 | +This project is licensed under the [Apache 2.0 License](LICENSE). |
0 commit comments