001/* 002 * Copyright 2012-2019 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2015-2019 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.NotExtensible; 026import com.unboundid.util.NotMutable; 027import com.unboundid.util.ThreadSafety; 028import com.unboundid.util.ThreadSafetyLevel; 029 030 031 032/** 033 * This class provides a data structure that holds information about a log 034 * message that may appear in the Directory Server access log about a the 035 * beginning of an entry rebalancing operation. 036 * <BR> 037 * <BLOCKQUOTE> 038 * <B>NOTE:</B> This class, and other classes within the 039 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 040 * supported for use against Ping Identity, UnboundID, and 041 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 042 * for proprietary functionality or for external specifications that are not 043 * considered stable or mature enough to be guaranteed to work in an 044 * interoperable way with other types of LDAP servers. 045 * </BLOCKQUOTE> 046 */ 047@NotMutable() 048@NotExtensible() 049@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 050public class EntryRebalancingRequestAccessLogMessage 051 extends AccessLogMessage 052{ 053 /** 054 * The serial version UID for this serializable class. 055 */ 056 private static final long serialVersionUID = -7183383454122018479L; 057 058 059 060 // The maximum number of entries to include in the subtree move. 061 private final Integer sizeLimit; 062 063 // The unique identifier assigned to the entry rebalancing operation. 064 private final Long rebalancingOperationID; 065 066 // The connection ID of the client connection that performed an operation to 067 // trigger the entry rebalancing operation. 068 private final Long triggeringConnectionID; 069 070 // The operation ID of the operation that triggered the entry rebalancing 071 // operation. 072 private final Long triggeringOperationID; 073 074 // The name of the backend set containing the subtree to move. 075 private final String sourceBackendSetName; 076 077 // The address and port of the server in the source backend set from which 078 // the entries are being migrated. 079 private final String sourceBackendServer; 080 081 // The base DN of the subtree being moved from one backend set to another. 082 private final String subtreeBaseDN; 083 084 // The name of the backend set into which the subtree will be migrated. 085 private final String targetBackendSetName; 086 087 // The address and port of the server of the server in the target backend set 088 // into which the entries are being migrated. 089 private final String targetBackendServer; 090 091 092 093 /** 094 * Creates a new entry rebalancing request access log message from the 095 * provided message string. 096 * 097 * @param s The string to be parsed as an entry rebalancing request access 098 * log message. 099 * 100 * @throws LogException If the provided string cannot be parsed as a valid 101 * log message. 102 */ 103 public EntryRebalancingRequestAccessLogMessage(final String s) 104 throws LogException 105 { 106 this(new LogMessage(s)); 107 } 108 109 110 111 /** 112 * Creates a new entry rebalancing request access log message from the 113 * provided log message. 114 * 115 * @param m The log message to be parsed as an entry rebalancing request 116 * access log message. 117 */ 118 public EntryRebalancingRequestAccessLogMessage(final LogMessage m) 119 { 120 super(m); 121 122 rebalancingOperationID = getNamedValueAsLong("rebalancingOp"); 123 sizeLimit = getNamedValueAsInteger("sizeLimit"); 124 sourceBackendServer = getNamedValue("sourceServer"); 125 sourceBackendSetName = getNamedValue("sourceBackendSet"); 126 subtreeBaseDN = getNamedValue("base"); 127 targetBackendServer = getNamedValue("targetServer"); 128 targetBackendSetName = getNamedValue("targetBackendSet"); 129 triggeringConnectionID = getNamedValueAsLong("triggeredByConn"); 130 triggeringOperationID = getNamedValueAsLong("triggeredByOp"); 131 } 132 133 134 135 /** 136 * Retrieves the unique identifier assigned to the entry rebalancing 137 * operation. 138 * 139 * @return The unique identifier assigned to the entry rebalancing operation, 140 * or {@code null} if it is not included in the log message. 141 */ 142 public final Long getRebalancingOperationID() 143 { 144 return rebalancingOperationID; 145 } 146 147 148 149 /** 150 * Retrieves the connection ID for the connection that performed an operation 151 * to trigger the entry rebalancing operation. 152 * 153 * @return Retrieves the connection ID for the connection that performed an 154 * operation to trigger the entry rebalancing operation, or 155 * {@code null} if it is not included in the log message. 156 */ 157 public final Long getTriggeringConnectionID() 158 { 159 return triggeringConnectionID; 160 } 161 162 163 164 /** 165 * Retrieves the operation ID for the operation that triggered the entry 166 * rebalancing operation. 167 * 168 * @return Retrieves the operation ID for the operation that triggered the 169 * entry rebalancing operation, or {@code null} if it is not included 170 * in the log message. 171 */ 172 public final Long getTriggeringOperationID() 173 { 174 return triggeringOperationID; 175 } 176 177 178 179 /** 180 * Retrieves the base DN of the subtree that will be migrated during the entry 181 * rebalancing operation. 182 * 183 * @return The base DN of the subtree that will be migrated during the entry 184 * rebalancing operation, or {@code null} if it is not included in 185 * the log message. 186 */ 187 public final String getSubtreeBaseDN() 188 { 189 return subtreeBaseDN; 190 } 191 192 193 194 /** 195 * Retrieves the maximum number of entries that may be contained in the 196 * subtree for it to be successfully migrated. 197 * 198 * @return The maximum number of entries that may be contained in the subtree 199 * for it to be successfully migrated, or {@code null} if it is not 200 * included in the log message. 201 */ 202 public final Integer getSizeLimit() 203 { 204 return sizeLimit; 205 } 206 207 208 209 /** 210 * Retrieves the name of the backend set containing the subtree to be 211 * migrated. 212 * 213 * @return The name of the backend set containing the subtree to be migrated, 214 * or {@code null} if it is not included in the log message. 215 */ 216 public final String getSourceBackendSetName() 217 { 218 return sourceBackendSetName; 219 } 220 221 222 223 /** 224 * The address and port of the backend server from which the subtree will be 225 * migrated. 226 * 227 * @return The address and port of the backend server from which the subtree 228 * will be migrated, or {@code null} if it is not included in the log 229 * message. 230 */ 231 public final String getSourceBackendServer() 232 { 233 return sourceBackendServer; 234 } 235 236 237 238 /** 239 * Retrieves the name of the backend set to which the subtree will be 240 * migrated. 241 * 242 * @return The name of the backend set ot which the subtree will be migrated, 243 * or {@code null} if it is not included in the log message. 244 */ 245 public final String getTargetBackendSetName() 246 { 247 return targetBackendSetName; 248 } 249 250 251 252 /** 253 * Retrieves the address and port of the backend server to which the subtree 254 * will be migrated. 255 * 256 * @return The address and port of the backend server to which the subtree 257 * will be migrated, or {@code null} if it is not included in the log 258 * message. 259 */ 260 public final String getTargetBackendServer() 261 { 262 return targetBackendServer; 263 } 264 265 266 267 /** 268 * {@inheritDoc} 269 */ 270 @Override() 271 public AccessLogMessageType getMessageType() 272 { 273 return AccessLogMessageType.ENTRY_REBALANCING_REQUEST; 274 } 275}