Personify
  • Introduction
  • Architecture
  • Model
    • Identity vault
    • Provisioning
    • Authentication and authorization
    • Gateway
  • Concepts
    • Entitlements
      • Internal entitlements
      • Custom entitlements
    • Workflows
    • Joiner - Mover - Leaver
    • Self service
    • Entitlement expiration
    • Toxic entitlements
    • (Re)Certification
    • Birth rights
    • Notifications
    • Entitlement prerequisites
    • Connectors
      • File connector
      • Database connector
      • SCIM Connector
      • LDAP connector
      • REST connector
      • Microsoft Graph connector
    • Auditing
    • Authorization
    • Gateway
    • API Based
    • Delegation
  • Usage
    • Get started
    • Configuration
  • Development
    • Customizations
      • PropertyProviders
      • AccountIdGenerators
      • RequestHandlers
      • Connectors
      • Workflows
      • Schedulers
    • REST API
    • JAVA SDK
    • Git
    • Issues
Powered by GitBook
On this page
  1. Development

JAVA SDK

There is also a SDK available to expose the CRUD functions of the domain model of the specific modules.

Following dependency has to be introduced in the pom.xml file of your java maven project.

<dependency>
	<groupId>be.personify.iam</groupId>
	<artifactId>personify-client-api</artifactId>
	<version>${project.version}</version>
</dependency>

Then the factories can be used like this:

@Autowired
private APIFactory apiFactory;
	
@Autowired
private MapComposer mapComposer;
	
	
/**
 * Performs a get for a user with id for the given targetsystem
 * @param targetsystem
 * @param id
 * @return
 */
@GetMapping(path="/provisionmap/{id}", produces = "application/json; charset=UTF-8")
public ResponseEntity<String> get(@PathVariable String id) {
		
	Query query = new Query(new Criterium("id", id));
		
	PagedModel<EntityModel<Identity>> result = apiFactory.getIdentityAPI().getIdentities(0, 1, null, query);
		
	if ( result.getContent().size() == 1) {
		CollectionModel<EntityModel<Transformer>> allTransformers = apiFactory.getTransformerAPI().getTransformers(0, 0, null, null);
		Map<String, Object> map = (Map)mapComposer.composeProvisonMap(result.getContent().iterator().next(), allTransformers);
		System.out.println(pretty(map));
		return new ResponseEntity<String>(pretty(map), HttpStatus.FOUND);
	}
	
	return new ResponseEntity<String>(HttpStatus.NOT_FOUND);
}

PreviousREST APINextGit

Last updated 2 years ago