Page tree

Versions Compared

Key

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

...

The Java REST client library is composed from the library interface and implementation. The applications should only access the library interface, allowing several implementations on the client library. This may be very useful during evolution of the client library for several reasons. Firstly the underlying technology will evolve. Initial implementation is a simple one based on JAXB. But later on when prism is fully separated from midPoint we will switch the implementation to prism-based one. Secondly, there may be several implementations of the API at the same time. E.g. an implementation that will access the REST service using HTTP and an implementation that will go directly to the Java local IDM Model Interface. Therefore the same application code can be deployed remotely and also co-located with midPoint in the same web application.

 


Structure and overall approach of the client library quite closely follows the structure of web resources in midPoint REST API.

...

Code Block
languagejava
{
  ...
  operation = rest.users().oid("123");
  invokeGet(operation);
  ...
}

T invokeGet(operation) {
   try {
       return operation.get();
   } catch (Exception e) {
       // log and process exceptions here
   }
}

 


Object References

TODO: redirects (e.g. add user)

...

There are synchronous and asynchronous operations in the library interface:


 OperationsReturn Values
Synchronousget(), post(), delete()original return value (e.g. UserType, String, ...)
Asynchronousapost(), adelete()Future (TaskFuture)

 


TODO

Code Block
languagejava
TaskFuture<Void> future = rest.users().oid("123").modification().item("assignment").add(roleOneAssignment).apost();
if (!future.isDone()) {
    ObjectReference<TaskType> taskRef = future.getTaskRef()
    ...
}

...

TODO: thread safety

Implementation

Source Code

Source code is on github: https://github.com/Evolveum/midpoint-client-java

Evolution and compatibility

...

When prism library gets separated from midPoint we can switch this REST client library implementation to use Prism instead of JAXB. This will provide much better handling of schema definitions, object extensions, support for JSON/YAML and so on.

 


Note
titlePlanned feature
Implementation of phase 2 and 3 is roughly planned for the future.

However, there is currently no specific plan when it will be implemented because there is no funding for this development yet. In case that you are interested in supporting development of this feature, please consider activating midPoint Platform subscription.

 


Phase 3

Stabilization, final release, full compatibility.

...