GDPR SDK for integrating Java services with AGS (AccelByte Gaming Services) GDPR service.
This GDPR SDK could be used by participant services to integrate into AGS GDPR workflow. There are 3 GDPR workflow that this GDPR SDK supported:
- Right to data portability
- Right to erasure (right to be forgotten)
- Right to restrict processing
The participant services will hook their concrete GDPRHandler implementation (that contains 3 functionalities above) into this GDPR SDK.
Under the hood, this GDPR SDK was using gRPC protocol for communication with AGS GDPR service:
+---------------+ +-------------------+
| AGS | gRPC | Your Java Service |
| GDPR Service -+------------->| (gRPC Server) |
| (gRPC Client) | | |
+---------------+ +-------------------+
Minimum Java version: Java 1.8
dependencies {
implementation "net.accelbyte.gdpr:gdpr-sdk:1.0.0"
}<dependency>
<groupId>net.accelbyte.gdpr</groupId>
<artifactId>gdpr-sdk</artifactId>
<version>1.0.0</version>
</dependency>GDPR SDK jar downloads are available from Maven Central.
Create Concrete Implementation of GDPRHandler interface
Create new class to implement GDPRHandler interface:
public class MyGDPRHandler implements GDPRHandler {
@Override
public DataGenerationResult ProcessDataGeneration(String namespace, String userId, boolean isPublisherNamespace) {
log.info("collecting user data...");
// your implementation here...
// example result
DataGenerationResult result = new DataGenerationResult();
result.setData("module1", "{\"data\":\"lorem ipsum dolor sit amet\"}".getBytes());
result.setData("module2", "{\"key1\":\"lorem ipsum\",\"key2\":\"dolor sit amet\"}".getBytes());
return result;
}
@Override
public void ProcessDataDeletion(String namespace, String userId, boolean isPublisherNamespace) {
log.info("deleting user data...");
// your implementation here...
}
@Override
public void ProcessDataRestriction(String namespace, String userId, boolean restrict, boolean isPublisherNamespace) {
log.info("restrict processing user data...");
// your implementation here...
}
}Initialize gRPC Server with GDPRService class
In your main implementation, hook your Concrete Implementation of GDPRHandler into GDPRService class:
GDPRHandler myGDPRHandler = new MyGDPRHandler();
GDPRService.SetHandler(myGDPRHandler);Start gRPC Server with GDPRService class:
Server server = ServerBuilder
.forPort(8081)
.addService(new GDPRService()).build();
server.start();
server.awaitTermination();