use of iso.std.iso_iec._24727.tech.schema.TerminateResponse in project open-ecard by ecsec.
the class SelectorSAL method terminate.
@Override
public TerminateResponse terminate(Terminate terminate) {
TerminateResponse response = WSHelper.makeResponse(TerminateResponse.class, WSHelper.makeResultOK());
// only terminate if initialized
if (!initializedSals.isEmpty()) {
boolean errorHit = false;
for (SAL next : initializedSals) {
try {
TerminateResponse res = next.terminate(terminate);
WSHelper.checkResult(res);
} catch (WSHelper.WSException ex) {
// in case of an error, take the error code from the first SAL
if (!errorHit) {
response.setResult(ex.getResult());
}
}
}
initializedSals.clear();
}
return response;
}
use of iso.std.iso_iec._24727.tech.schema.TerminateResponse in project open-ecard by ecsec.
the class TinySALTest method testTerminate.
/**
* Test of terminate method, of class TinySAL.
*/
@Test(enabled = TESTS_ENABLED)
public void testTerminate() {
System.out.println("terminate");
Terminate parameters = new Terminate();
TerminateResponse result = instance.terminate(parameters);
assertEquals(ECardConstants.Major.ERROR, result.getResult().getResultMajor());
}
use of iso.std.iso_iec._24727.tech.schema.TerminateResponse in project open-ecard by ecsec.
the class MiddlewareSAL method terminate.
@Override
public TerminateResponse terminate(Terminate parameters) {
TerminateResponse resp = WSHelper.makeResponse(TerminateResponse.class, WSHelper.makeResultOK());
try {
eventMan.terminate();
mwModule.destroy();
} catch (FinalizationException ex) {
String msg = "Failed to terminate Middleware.";
LOG.error(msg, ex);
resp.setResult(WSHelper.makeResultError(ECardConstants.Minor.Disp.COMM_ERROR, msg));
}
return resp;
}
Aggregations