package at.gv.egovernment.moa.spss.server.invoke;
import java.util.Collections;
import at.gv.egovernment.moa.spss.MOAException;
import at.gv.egovernment.moa.spss.api.Configurator;
import at.gv.egovernment.moa.spss.api.SignatureCreationService;
import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureRequest;
import at.gv.egovernment.moa.spss.api.xmlsign.CreateXMLSignatureResponse;
/**
* An implementation of the SignatureCreationService
, using
* the XMLSignatureCreationInvoker
.
*
* @author Patrick Peck
* @version $Id$
*/
public class SignatureCreationServiceImpl extends SignatureCreationService {
/**
* Create an XML signature.
*
* @param request The CreateXMLSignatureRequest
containing
* information about the signature(s) to create.
* @return The created signature(s).
* @throws MOAException An error occurred creating the signature(s).
*/
public CreateXMLSignatureResponse createXMLSignature(CreateXMLSignatureRequest request)
throws MOAException {
XMLSignatureCreationInvoker invoker =
XMLSignatureCreationInvoker.getInstance();
CreateXMLSignatureResponse response;
try {
Configurator.getInstance().init();
ServiceContextUtils.setUpContexts();
response = invoker.createXMLSignature(request, Collections.EMPTY_SET);
return response;
} finally {
ServiceContextUtils.tearDownContexts();
}
}
}