Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Add “gdpr-api” library to pom.xml

  2. Implement IGDPRAnonymizer


pom.xml example:

Code Block
languagexml
<dependencies>
   	<dependency>
		 <dependency>
        <groupId>de.actonic</groupId>
		
        <artifactId>gdpr-api</artifactId>
		
        <version>1.0.0</version>
 	   </dependency>
</dependencies>
 
...
 
<Export-Package>
    	de.actonic.gdpr.api.*,
</Export-Package>
 
...
 
<DynamicImport-Package>
    	de.actonic.jira.gdpr.api.*;resolution:="optional",
</DynamicImport-Package>


Anonymization function implementation example:

Code Block
languagejava
package comde.otheractonic.testexample.testGDPRApiPlugin;
 
import java.util.*;
 
import com.atlassian.jira.component.*;
import de.actonic.gdpr.api.*;
import org.springframework.beans.factory.*;
import org.springframework.stereotype.*;
 
@Component
public class Anonymizer implements IGDPRAnonymizer, InitializingBean, DisposableBean {
    @Override
    public List<GDPRAnonymizeObject> search(String sourceUser) {
        // here you look for all the data on the incoming parameters and return the result
        return null;
    }
 
    @Override
    public List<GDPRAnonymizeObject> anonymize(String sourceUser, String targetUser) {
        // here you anonymize all data by incoming parameters and return the result
        return null;
    }
 
    @Override
    public void stop() {
        // here you interrupt the search/anonymization process
    }
 
    @Override
    public String getPluginName() {
        return "Plugin #2";
    }
 
    @Override
    public String getName() {
        return "User actions anonymizer";
    }
 
    @Override
    public void afterPropertiesSet() throws Exception {
        IGDPRAnonymizeService anonymizeService = ComponentAccessor.getOSGiComponentInstanceOfType(IGDPRAnonymizeService.class);
        if (anonymizeService != null) {
            anonymizeService.addAnonymizer(this);
        }
    }
 
    @Override
    public void destroy() throws Exception {
        IGDPRAnonymizeService anonymizeService = ComponentAccessor.getOSGiComponentInstanceOfType(IGDPRAnonymizeService.class);
        if (anonymizeService != null) {
            anonymizeService.removeAnonymizer(this);
        }
    }
}

...