View Javadoc
1   /*
2    * Copyright 2016 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  package org.openehealth.ipf.commons.ihe.core.atna;
17  
18  import lombok.Getter;
19  import org.openhealthtools.ihe.atna.auditor.events.AuditEventMessage;
20  import org.openhealthtools.ihe.atna.auditor.sender.AuditMessageSender;
21  
22  import java.net.InetAddress;
23  import java.util.ArrayList;
24  import java.util.Collections;
25  import java.util.List;
26  
27  /**
28   * @author Dmytro Rud
29   *
30   * @deprecated
31   */
32  abstract public class AbstractMockedAuditSender<AuditMessageType> implements AuditMessageSender {
33  
34      @Getter protected boolean needValidation;
35      @Getter protected List<AuditMessageType> messages = Collections.synchronizedList(new ArrayList<AuditMessageType>());
36  
37      protected AbstractMockedAuditSender(boolean needValidation) {
38          this.needValidation = needValidation;
39      }
40  
41      @Override
42      public void sendAuditEvent(AuditEventMessage[] msg, InetAddress destination, int port) throws Exception {
43          sendAuditEvent(msg);
44      }
45  }