View Javadoc
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  package org.openehealth.ipf.commons.audit.codes;
17  
18  import lombok.Getter;
19  import org.openehealth.ipf.commons.audit.types.AuditSource;
20  import org.openehealth.ipf.commons.audit.types.EnumeratedCodedValue;
21  import org.openehealth.ipf.commons.audit.types.EnumeratedValueSet;
22  
23  /**
24   * Audit Source Type Codes as originally specified in https://tools.ietf.org/html/rfc3881#section-5.4
25   * and now maintained in http://dicom.nema.org/medical/dicom/current/output/html/part15.html#sect_A.5.1.2
26   * This value set is a literal part of the audit schema, ie.e. no other codes may be used.
27   *
28   * @author Christian Ohr
29   * @since 3.5
30   */
31  public enum AuditSourceType implements EnumeratedCodedValue<AuditSource>, AuditSource {
32  
33      EndUserInterface("1", "End-user interface"),
34      DataAcquisitionDevice("2", "Data acquisition device or instrument"),
35      WebServerProcess("3", "Web Server Process or Thread"),
36      ApplicationServerProcess("4", "Application Server Process or Thread"),
37      DatabaseServerProcess("5", "Database Server Process or Thread"),
38      SecurityServer("6", "Security Server"),
39      NetworkComponent("7", "Network Component"),
40      OperatingSoftware("8", "Operating Software"),
41      Other("9", "Other");
42  
43      @Getter
44      private AuditSource value;
45  
46      AuditSourceType(String code, String displayName) {
47          this.value = AuditSource.of(code, "DCM", displayName);
48      }
49  
50      public static AuditSourceType enumForCode(String code) {
51          return EnumeratedValueSet.enumForCode(AuditSourceType.class, code);
52      }
53  }