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);
}

Last updated