001/* 002 * Copyright 2009-2018 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2015-2018 Ping Identity Corporation 007 * 008 * This program is free software; you can redistribute it and/or modify 009 * it under the terms of the GNU General Public License (GPLv2 only) 010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 011 * as published by the Free Software Foundation. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Public License for more details. 017 * 018 * You should have received a copy of the GNU General Public License 019 * along with this program; if not, see <http://www.gnu.org/licenses>. 020 */ 021package com.unboundid.ldap.sdk.unboundidds.logs; 022 023 024 025import com.unboundid.util.ThreadSafety; 026import com.unboundid.util.ThreadSafetyLevel; 027 028 029 030/** 031 * This enum defines the set of access log operation types. 032 * <BR> 033 * <BLOCKQUOTE> 034 * <B>NOTE:</B> This class, and other classes within the 035 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 036 * supported for use against Ping Identity, UnboundID, and 037 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 038 * for proprietary functionality or for external specifications that are not 039 * considered stable or mature enough to be guaranteed to work in an 040 * interoperable way with other types of LDAP servers. 041 * </BLOCKQUOTE> 042 */ 043@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 044public enum AccessLogOperationType 045{ 046 /** 047 * The operation type that will be used for messages about abandon operations. 048 */ 049 ABANDON("ABANDON"), 050 051 052 053 /** 054 * The operation type that will be used for messages about add operations. 055 */ 056 ADD("ADD"), 057 058 059 060 /** 061 * The operation type that will be used for messages about bind operations. 062 */ 063 BIND("BIND"), 064 065 066 067 /** 068 * The operation type that will be used for messages about compare operations. 069 */ 070 COMPARE("COMPARE"), 071 072 073 074 /** 075 * The operation type that will be used for messages about delete operations. 076 */ 077 DELETE("DELETE"), 078 079 080 081 /** 082 * The operation type that will be used for messages about extended 083 * operations. 084 */ 085 EXTENDED("EXTENDED"), 086 087 088 089 /** 090 * The operation type that will be used for messages about modify operations. 091 */ 092 MODIFY("MODIFY"), 093 094 095 096 /** 097 * The operation type that will be used for messages about modify DN 098 * operations. 099 */ 100 MODDN("MODDN"), 101 102 103 104 /** 105 * The operation type that will be used for messages about search operations. 106 */ 107 SEARCH("SEARCH"), 108 109 110 111 /** 112 * The operation type that will be used for messages about unbind operations. 113 */ 114 UNBIND("UNBIND"); 115 116 117 118 // The string that will be used to identify this message type in log files. 119 private final String logIdentifier; 120 121 122 123 /** 124 * Creates a new access log operation type with the provided information. 125 * 126 * @param logIdentifier The string that will be used to identify this 127 * operation type in log files. 128 */ 129 AccessLogOperationType(final String logIdentifier) 130 { 131 this.logIdentifier = logIdentifier; 132 } 133 134 135 136 /** 137 * Retrieves the string that will be used to identify this operation type in 138 * log files. 139 * 140 * @return The string that will be used to identify this operation type in 141 * log files. 142 */ 143 public String getLogIdentifier() 144 { 145 return logIdentifier; 146 } 147 148 149 150 /** 151 * Retrieves the access log operation type with the provided identifier. 152 * 153 * @param logIdentifier The identifier string for which to retrieve the 154 * corresponding access log operation type. 155 * 156 * @return The appropriate operation type, or {@code null} if there is no 157 * operation type associated with the provided identifier. 158 */ 159 public static AccessLogOperationType forName(final String logIdentifier) 160 { 161 for (final AccessLogOperationType t : values()) 162 { 163 if (t.logIdentifier.equals(logIdentifier)) 164 { 165 return t; 166 } 167 } 168 169 return null; 170 } 171}