1 /* 2 * Copyright 2017 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.openehealth.ipf.commons.audit.protocol; 18 19 import org.openehealth.ipf.commons.audit.AuditContext; 20 21 /** 22 * Implementations of this interface transmit the serialized {@link org.openehealth.ipf.commons.audit.model.AuditMessage AuditMessage} 23 * to an AuditRepository using IP protocols like TCP or UDP, usually wrapped into a carrier protocol (such as SYSLOG). 24 * 25 * @author Christian Ohr 26 * @since 3.5 27 */ 28 public interface AuditTransmissionProtocol { 29 30 String JAVAX_NET_DEBUG = "javax.net.debug"; 31 String JAVAX_NET_SSL_TRUSTSTORE = "javax.net.ssl.trustStore"; 32 String JAVAX_NET_SSL_TRUSTSTORE_TYPE = "javax.net.ssl.trustStoretype"; 33 String JAVAX_NET_SSL_TRUSTSTORE_PASSWORD = "javax.net.ssl.trustStorePassword"; 34 String JAVAX_NET_SSL_KEYSTORE = "javax.net.ssl.keyStore"; 35 String JAVAX_NET_SSL_KEYSTORE_TYPE = "javax.net.ssl.keyStoreType"; 36 String JAVAX_NET_SSL_KEYSTORE_PASSWORD = "javax.net.ssl.keyStorePassword"; 37 String HTTPS_CIPHERSUITES = "https.ciphersuites"; 38 String JDK_TLS_CLIENT_PROTOCOLS = "jdk.tls.client.protocols"; 39 40 /** 41 * Transmits the message 42 * 43 * @param auditContext audit context that e.g. contains the destination 44 * @param auditMessages audit message strings 45 * @throws Exception thrown if sending the messages has failed 46 */ 47 void send(AuditContext auditContext, String... auditMessages) throws Exception; 48 49 /** 50 * May be imüplemented to clean up instances on shut down 51 */ 52 void shutdown(); 53 54 /** 55 * @return name of the AuditTransmissionProtocol 56 */ 57 String getTransportName(); 58 59 }