All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.esec.icpm.libs.signature.response.notify.SignatureNotifier Maven / Gradle / Ivy

Go to download

This library is used to make integration with Certillion server, so our Clients can easily ask for signatures or generate certificates.

There is a newer version: 1.2.0
Show newest version
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