Skip to content

Commit 4150489

Browse files
committed
save
1 parent 175007c commit 4150489

1 file changed

Lines changed: 45 additions & 47 deletions

File tree

‎README.md‎

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# DatabunkerPro Java Client
22

3-
A Java client library for interacting with the DatabunkerPro API.
3+
A Java client library for interacting with the DatabunkerPro API. DatabunkerPro is a secure, privacy-focused data vault that helps organizations manage and protect sensitive user data.
44

55
## Features
66

7+
- Complete implementation of the DatabunkerPro API
78
- User management (create, get, update, delete)
8-
- User request management
99
- App data management
1010
- Legal basis and agreement management
11-
- Processing activity management
1211
- Connector management
1312
- Group and role management
1413
- Policy management
@@ -18,7 +17,6 @@ A Java client library for interacting with the DatabunkerPro API.
1817
- Session management
1918
- System configuration
2019
- Bulk operations
21-
- Easy to use Java API
2220
- Thread-safe implementation
2321
- Comprehensive test suite
2422

@@ -33,7 +31,7 @@ Add the following dependency to your `pom.xml`:
3331

3432
```xml
3533
<dependency>
36-
<groupId>org.databunkerpro</groupId>
34+
<groupId>org.databunker</groupId>
3735
<artifactId>databunkerpro-java</artifactId>
3836
<version>1.0.0-SNAPSHOT</version>
3937
</dependency>
@@ -44,74 +42,67 @@ Add the following dependency to your `pom.xml`:
4442
### Basic Setup
4543

4644
```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-
}
45+
import org.databunker.DatabunkerproApi;
46+
47+
// Initialize the API client
48+
String apiUrl = "https://pro.databunker.org";
49+
String apiToken = "your-api-token";
50+
String tenantName = "your-tenant-name";
51+
52+
try (DatabunkerproApi api = new DatabunkerproApi(apiUrl, apiToken, tenantName)) {
53+
// Use the API client
6354
}
6455
```
6556

6657
### User Management
6758

68-
#### Creating a User
69-
7059
```java
60+
// Create a user
7161
Map<String, Object> profile = new HashMap<>();
7262
profile.put("email", "user@example.com");
7363
profile.put("name", "John Doe");
7464
profile.put("phone", "+1234567890");
7565

76-
Map<String, Object> options = new HashMap<>();
77-
options.put("groupname", "users");
78-
options.put("rolename", "member");
66+
Map<String, Object> result = api.createUser(profile, null, null);
67+
System.out.println("Created user with token: " + result.get("token"));
7968

80-
Map<String, Object> result = api.createUser(profile, options, null);
81-
```
69+
// Get a user
70+
Map<String, Object> user = api.getUser("email", "user@example.com", null);
71+
System.out.println("User profile: " + user.get("profile"));
8272

83-
#### Getting a User
73+
// Update a user
74+
Map<String, Object> updates = new HashMap<>();
75+
updates.put("name", "John Smith");
76+
api.updateUser("email", "user@example.com", updates, null);
8477

85-
```java
86-
Map<String, Object> user = api.getUser("email", "user@example.com", null);
78+
// Delete a user
79+
api.deleteUser("email", "user@example.com", null);
8780
```
8881

89-
#### Updating a User
82+
### App Data Management
9083

9184
```java
92-
Map<String, Object> updateProfile = new HashMap<>();
93-
updateProfile.put("name", "John Smith");
94-
updateProfile.put("phone", "+9876543210");
85+
// Create app data
86+
Map<String, Object> data = new HashMap<>();
87+
data.put("key", "value");
88+
api.createAppData("email", "user@example.com", "appname", data, null);
9589

96-
Map<String, Object> result = api.updateUser("email", "user@example.com", updateProfile, null);
90+
// Get app data
91+
Map<String, Object> appData = api.getAppData("email", "user@example.com", "appname", null);
9792
```
9893

99-
#### Deleting a User
94+
### System Configuration
10095

10196
```java
102-
Map<String, Object> result = api.deleteUser("email", "user@example.com", null);
97+
// Get system statistics
98+
Map<String, Object> stats = api.getSystemStats(null);
99+
System.out.println("System statistics: " + stats.get("stats"));
103100
```
104101

105-
## Testing
106-
107-
To run the tests, you need to set the following environment variables:
108102

109-
```bash
110-
export DATABUNKER_TENANT=your-tenant-name
111-
export DATABUNKER_TOKEN=your-api-token
112-
```
103+
## Testing
113104

114-
Then run:
105+
To run the tests use the following command:
115106

116107
```bash
117108
mvn test
@@ -120,11 +111,18 @@ mvn test
120111
## Contributing
121112

122113
1. Fork the repository
123-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
114+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
124115
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
125116
4. Push to the branch (`git push origin feature/amazing-feature`)
126117
5. Open a Pull Request
127118

128119
## License
129120

130121
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
122+
123+
## Support
124+
125+
For support, please contact us at:
126+
- Email: hello@databunker.org
127+
- Website: https://databunker.org
128+
- GitHub Issues: https://github.com/securitybunker/databunkerpro-java/issues

0 commit comments

Comments
 (0)