1.6. vitam-pooling-client

1.7. Utilisation

VitamPoolingClient offre la possibilité d’attendre la fin des processus asynchrone.

1.7.1. Paramètres

VitamPoolingClient accepte un seul paramètre dans son constructeur: C’est l’interface OperationStatusClient. Cette interface définie la méthode suivante:

RequestResponse<ItemStatus> getOperationProcessStatus(VitamContext vitamContext, String id) throws VitamClientException;

1.7.2. Le client

VitamPoolingClient implémente différentes méthodes « wait » avec différents paramètres qui offre la fonctionnalité pooling sur les différents processus asynchrone. Utiliser les méthodes « wait » pour mieux gérer le pooling côté serveur et remédier à l’asynchrone des certains opérations.

Les différentes méthodes « wait » du client VitamPoolingClient sont:

// Possibilité de faire plusieurs (nbTry) appel espacé d'un temps (timeWait) avant de répondre au client final
public boolean wait(int tenantId, String processId, ProcessState state, int nbTry, long timeWait, TimeUnit timeUnit) throws VitamException
public boolean wait(int tenantId, String processId, int nbTry, long timeout, TimeUnit timeUnit) throws VitamException
public boolean wait(int tenantId, String processId, ProcessState state) throws VitamException
public boolean wait(int tenantId, String processId) throws VitamException