
br.com.esec.icpm.libs.signature.response.notify.SignatureNotifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of certillion-client-library Show documentation
Show all versions of certillion-client-library Show documentation
This library is used to make integration with Certillion server, so our Clients can easily ask for signatures or generate certificates.
package br.com.esec.icpm.libs.signature.response.notify;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
import br.com.esec.icpm.libs.Server;
import br.com.esec.icpm.libs.signature.response.Futures;
import br.com.esec.icpm.mss.ws.notification.BatchSignatureNotificationType;
import br.com.esec.icpm.mss.ws.notification.SignatureNotificationType;
public class SignatureNotifier {
private static Logger log = LoggerFactory.getLogger(SignatureNotifier.class);
private Server server;
public SignatureNotifier(Server server) {
this.server = server;
}
public void simple(SignatureNotificationType notify) {
log.info("Notificatifying batch signature of transaction " + notify.getTransactionId() + "...");
Long transactionId = notify.getTransactionId();
ListenableFuture future = Futures.get(server, transactionId);
((SettableFuture) future).set(notify);
Futures.remove(server, transactionId);
}
public void batch(BatchSignatureNotificationType notify) {
log.info("Notificatifying batch signature of transaction " + notify.getTransactionId() + "...");
Long transactionId = notify.getTransactionId();
ListenableFuture future = Futures.get(server, transactionId);
((SettableFuture) future).set(notify);
Futures.remove(server, transactionId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy