Skip to content

Commit a6050d6

Browse files
committed
initial release
1 parent 463b470 commit a6050d6

12 files changed

Lines changed: 1082 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 130 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,130 @@
1-
# databunkerpro-java
2-
DatabunkerPro Java Client Library
1+
# DatabunkerPro Java Client
2+
3+
A Java client library for interacting with the DatabunkerPro API.
4+
5+
## Features
6+
7+
- User management (create, get, update, delete)
8+
- User request management
9+
- App data management
10+
- Legal basis and agreement management
11+
- Processing activity management
12+
- Connector management
13+
- Group and role management
14+
- Policy management
15+
- Token management
16+
- Audit management
17+
- Tenant management
18+
- Session management
19+
- System configuration
20+
- Bulk operations
21+
- Easy to use Java API
22+
- Thread-safe implementation
23+
- Comprehensive test suite
24+
25+
## Requirements
26+
27+
- Java 11 or higher
28+
- Maven 3.6 or higher
29+
30+
## Installation
31+
32+
Add the following dependency to your `pom.xml`:
33+
34+
```xml
35+
<dependency>
36+
<groupId>org.databunkerpro</groupId>
37+
<artifactId>databunkerpro-java</artifactId>
38+
<version>1.0.0-SNAPSHOT</version>
39+
</dependency>
40+
```
41+
42+
## Usage
43+
44+
### Basic Setup
45+
46+
```java
47+
import org.databunkerpro.DatabunkerproApi;
48+
import java.util.Map;
49+
import java.util.HashMap;
50+
51+
public class Example {
52+
public static void main(String[] args) {
53+
String baseURL = "https://pro.databunker.org";
54+
String xBunkerToken = "your-api-token";
55+
String xBunkerTenant = "your-tenant-name";
56+
57+
try (DatabunkerproApi api = new DatabunkerproApi(baseURL, xBunkerToken, xBunkerTenant)) {
58+
// Use the API here
59+
} catch (Exception e) {
60+
e.printStackTrace();
61+
}
62+
}
63+
}
64+
```
65+
66+
### User Management
67+
68+
#### Creating a User
69+
70+
```java
71+
Map<String, Object> profile = new HashMap<>();
72+
profile.put("email", "user@example.com");
73+
profile.put("name", "John Doe");
74+
profile.put("phone", "+1234567890");
75+
76+
Map<String, Object> options = new HashMap<>();
77+
options.put("groupname", "users");
78+
options.put("rolename", "member");
79+
80+
Map<String, Object> result = api.createUser(profile, options, null);
81+
```
82+
83+
#### Getting a User
84+
85+
```java
86+
Map<String, Object> user = api.getUser("email", "user@example.com", null);
87+
```
88+
89+
#### Updating a User
90+
91+
```java
92+
Map<String, Object> updateProfile = new HashMap<>();
93+
updateProfile.put("name", "John Smith");
94+
updateProfile.put("phone", "+9876543210");
95+
96+
Map<String, Object> result = api.updateUser("email", "user@example.com", updateProfile, null);
97+
```
98+
99+
#### Deleting a User
100+
101+
```java
102+
Map<String, Object> result = api.deleteUser("email", "user@example.com", null);
103+
```
104+
105+
## Testing
106+
107+
To run the tests, you need to set the following environment variables:
108+
109+
```bash
110+
export DATABUNKER_TENANT=your-tenant-name
111+
export DATABUNKER_TOKEN=your-api-token
112+
```
113+
114+
Then run:
115+
116+
```bash
117+
mvn test
118+
```
119+
120+
## Contributing
121+
122+
1. Fork the repository
123+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
124+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
125+
4. Push to the branch (`git push origin feature/amazing-feature`)
126+
5. Open a Pull Request
127+
128+
## License
129+
130+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

‎pom.xml‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.databunkerpro</groupId>
8+
<artifactId>databunkerpro-java</artifactId>
9+
<version>1.0.0-SNAPSHOT</version>
10+
<packaging>jar</packaging>
11+
12+
<name>DatabunkerPro Java Client</name>
13+
<description>Java client library for DatabunkerPro API</description>
14+
<url>https://github.com/databunkerpro/databunkerpro-java</url>
15+
16+
<properties>
17+
<maven.compiler.source>11</maven.compiler.source>
18+
<maven.compiler.target>11</maven.compiler.target>
19+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20+
</properties>
21+
22+
<dependencies>
23+
<!-- Apache HttpClient -->
24+
<dependency>
25+
<groupId>org.apache.httpcomponents</groupId>
26+
<artifactId>httpclient</artifactId>
27+
<version>4.5.13</version>
28+
</dependency>
29+
30+
<!-- Apache HttpCore -->
31+
<dependency>
32+
<groupId>org.apache.httpcomponents</groupId>
33+
<artifactId>httpcore</artifactId>
34+
<version>4.4.15</version>
35+
</dependency>
36+
37+
<!-- Jackson for JSON processing -->
38+
<dependency>
39+
<groupId>com.fasterxml.jackson.core</groupId>
40+
<artifactId>jackson-databind</artifactId>
41+
<version>2.13.4</version>
42+
</dependency>
43+
44+
<!-- JUnit for testing -->
45+
<dependency>
46+
<groupId>junit</groupId>
47+
<artifactId>junit</artifactId>
48+
<version>4.13.2</version>
49+
<scope>test</scope>
50+
</dependency>
51+
</dependencies>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-compiler-plugin</artifactId>
58+
<version>3.8.1</version>
59+
<configuration>
60+
<source>11</source>
61+
<target>11</target>
62+
</configuration>
63+
</plugin>
64+
<plugin>
65+
<groupId>org.apache.maven.plugins</groupId>
66+
<artifactId>maven-source-plugin</artifactId>
67+
<version>3.2.1</version>
68+
<executions>
69+
<execution>
70+
<id>attach-sources</id>
71+
<goals>
72+
<goal>jar-no-fork</goal>
73+
</goals>
74+
</execution>
75+
</executions>
76+
</plugin>
77+
<plugin>
78+
<groupId>org.apache.maven.plugins</groupId>
79+
<artifactId>maven-javadoc-plugin</artifactId>
80+
<version>3.3.2</version>
81+
<executions>
82+
<execution>
83+
<id>attach-javadocs</id>
84+
<goals>
85+
<goal>jar</goal>
86+
</goals>
87+
</execution>
88+
</executions>
89+
</plugin>
90+
</plugins>
91+
</build>
92+
</project>

0 commit comments

Comments
 (0)