diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-07-03 10:54:12 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-07-03 10:54:12 +0200 |
commit | 6a9c857e08b8bbb0181cb48f8e1db3eda675ba6f (patch) | |
tree | f63d22aeef9ebc2b6c11a46531c4f60d308faf3d /src/main/java/at | |
parent | 291f119244930c5ec6fa62167726eedf253a62d3 (diff) | |
download | moa-zs-6a9c857e08b8bbb0181cb48f8e1db3eda675ba6f.tar.gz moa-zs-6a9c857e08b8bbb0181cb48f8e1db3eda675ba6f.tar.bz2 moa-zs-6a9c857e08b8bbb0181cb48f8e1db3eda675ba6f.zip |
Minor Fix: Performance of Trace Logging Improved
...by checking if log level is active before converting byte[]
SOAPMessages into Strings.
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java b/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java index 4ebd2d0..ac3acc6 100644 --- a/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java +++ b/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java @@ -42,15 +42,20 @@ public class StoreSOAPBodyBinaryInRepositoryInterceptor extends AbstractPhaseInt try { byte[] content = messageUtils.copyContent(message); - log.trace("Interceptor received this SOAP message: {}. ", new String(content, StandardCharsets.UTF_8)); + if(log.isTraceEnabled()) { + log.trace("Interceptor received this SOAP message: {}. ", new String(content, StandardCharsets.UTF_8)); + } if(content.length > 0) { Element document = soapUtils.toDOM(content); byte[] status = soapUtils.unwrapSoapEnvelope(document); String appDeliveryID = soapUtils.getAppDeliveryIDFrom(document); repository.addSignedDeliveryRequestStatus(status, appDeliveryID); - log.trace("DeliveryRequestStatus with AppDeliveryID={} unwrapped and stored: {}. ", - appDeliveryID, new String(status, StandardCharsets.UTF_8)); + + if(log.isTraceEnabled()) { + log.trace("DeliveryRequestStatus with AppDeliveryID={} unwrapped and stored: {}. ", + appDeliveryID, new String(status, StandardCharsets.UTF_8)); + } } } catch (ParserConfigurationException | SAXException | IOException | NullPointerException e) { throw moaZSException("Could not extract signed data from message.", e); |