001/* 002 * Copyright 2012-2024 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright 2012-2024 Ping Identity Corporation 007 * 008 * Licensed under the Apache License, Version 2.0 (the "License"); 009 * you may not use this file except in compliance with the License. 010 * You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, software 015 * distributed under the License is distributed on an "AS IS" BASIS, 016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 017 * See the License for the specific language governing permissions and 018 * limitations under the License. 019 */ 020/* 021 * Copyright (C) 2012-2024 Ping Identity Corporation 022 * 023 * This program is free software; you can redistribute it and/or modify 024 * it under the terms of the GNU General Public License (GPLv2 only) 025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 026 * as published by the Free Software Foundation. 027 * 028 * This program is distributed in the hope that it will be useful, 029 * but WITHOUT ANY WARRANTY; without even the implied warranty of 030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 031 * GNU General Public License for more details. 032 * 033 * You should have received a copy of the GNU General Public License 034 * along with this program; if not, see <http://www.gnu.org/licenses>. 035 */ 036package com.unboundid.ldap.sdk.unboundidds.logs; 037 038 039 040import com.unboundid.util.NotExtensible; 041import com.unboundid.util.NotMutable; 042import com.unboundid.util.NotNull; 043import com.unboundid.util.Nullable; 044import com.unboundid.util.ThreadSafety; 045import com.unboundid.util.ThreadSafetyLevel; 046 047 048 049/** 050 * This class provides a data structure that holds information about a log 051 * message that may appear in the Directory Server access log about a the 052 * beginning of an entry rebalancing operation. 053 * <BR> 054 * <BLOCKQUOTE> 055 * <B>NOTE:</B> This class, and other classes within the 056 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 057 * supported for use against Ping Identity, UnboundID, and 058 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 059 * for proprietary functionality or for external specifications that are not 060 * considered stable or mature enough to be guaranteed to work in an 061 * interoperable way with other types of LDAP servers. 062 * </BLOCKQUOTE> 063 */ 064@NotMutable() 065@NotExtensible() 066@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 067public class EntryRebalancingRequestAccessLogMessage 068 extends AccessLogMessage 069{ 070 /** 071 * The serial version UID for this serializable class. 072 */ 073 private static final long serialVersionUID = -7183383454122018479L; 074 075 076 077 // The maximum number of entries to include in the subtree move. 078 @Nullable private final Integer sizeLimit; 079 080 // The unique identifier assigned to the entry rebalancing operation. 081 @Nullable private final Long rebalancingOperationID; 082 083 // The connection ID of the client connection that performed an operation to 084 // trigger the entry rebalancing operation. 085 @Nullable private final Long triggeringConnectionID; 086 087 // The operation ID of the operation that triggered the entry rebalancing 088 // operation. 089 @Nullable private final Long triggeringOperationID; 090 091 // The name of the backend set containing the subtree to move. 092 @Nullable private final String sourceBackendSetName; 093 094 // The address and port of the server in the source backend set from which 095 // the entries are being migrated. 096 @Nullable private final String sourceBackendServer; 097 098 // The base DN of the subtree being moved from one backend set to another. 099 @Nullable private final String subtreeBaseDN; 100 101 // The name of the backend set into which the subtree will be migrated. 102 @Nullable private final String targetBackendSetName; 103 104 // The address and port of the server of the server in the target backend set 105 // into which the entries are being migrated. 106 @Nullable private final String targetBackendServer; 107 108 109 110 /** 111 * Creates a new entry rebalancing request access log message from the 112 * provided message string. 113 * 114 * @param s The string to be parsed as an entry rebalancing request access 115 * log message. 116 * 117 * @throws LogException If the provided string cannot be parsed as a valid 118 * log message. 119 */ 120 public EntryRebalancingRequestAccessLogMessage(@NotNull final String s) 121 throws LogException 122 { 123 this(new LogMessage(s)); 124 } 125 126 127 128 /** 129 * Creates a new entry rebalancing request access log message from the 130 * provided log message. 131 * 132 * @param m The log message to be parsed as an entry rebalancing request 133 * access log message. 134 */ 135 public EntryRebalancingRequestAccessLogMessage(@NotNull final LogMessage m) 136 { 137 super(m); 138 139 rebalancingOperationID = getNamedValueAsLong("rebalancingOp"); 140 sizeLimit = getNamedValueAsInteger("sizeLimit"); 141 sourceBackendServer = getNamedValue("sourceServer"); 142 sourceBackendSetName = getNamedValue("sourceBackendSet"); 143 subtreeBaseDN = getNamedValue("base"); 144 targetBackendServer = getNamedValue("targetServer"); 145 targetBackendSetName = getNamedValue("targetBackendSet"); 146 triggeringConnectionID = getNamedValueAsLong("triggeredByConn"); 147 triggeringOperationID = getNamedValueAsLong("triggeredByOp"); 148 } 149 150 151 152 /** 153 * Retrieves the unique identifier assigned to the entry rebalancing 154 * operation. 155 * 156 * @return The unique identifier assigned to the entry rebalancing operation, 157 * or {@code null} if it is not included in the log message. 158 */ 159 @Nullable() 160 public final Long getRebalancingOperationID() 161 { 162 return rebalancingOperationID; 163 } 164 165 166 167 /** 168 * Retrieves the connection ID for the connection that performed an operation 169 * to trigger the entry rebalancing operation. 170 * 171 * @return Retrieves the connection ID for the connection that performed an 172 * operation to trigger the entry rebalancing operation, or 173 * {@code null} if it is not included in the log message. 174 */ 175 @Nullable() 176 public final Long getTriggeringConnectionID() 177 { 178 return triggeringConnectionID; 179 } 180 181 182 183 /** 184 * Retrieves the operation ID for the operation that triggered the entry 185 * rebalancing operation. 186 * 187 * @return Retrieves the operation ID for the operation that triggered the 188 * entry rebalancing operation, or {@code null} if it is not included 189 * in the log message. 190 */ 191 @Nullable() 192 public final Long getTriggeringOperationID() 193 { 194 return triggeringOperationID; 195 } 196 197 198 199 /** 200 * Retrieves the base DN of the subtree that will be migrated during the entry 201 * rebalancing operation. 202 * 203 * @return The base DN of the subtree that will be migrated during the entry 204 * rebalancing operation, or {@code null} if it is not included in 205 * the log message. 206 */ 207 @Nullable() 208 public final String getSubtreeBaseDN() 209 { 210 return subtreeBaseDN; 211 } 212 213 214 215 /** 216 * Retrieves the maximum number of entries that may be contained in the 217 * subtree for it to be successfully migrated. 218 * 219 * @return The maximum number of entries that may be contained in the subtree 220 * for it to be successfully migrated, or {@code null} if it is not 221 * included in the log message. 222 */ 223 @Nullable() 224 public final Integer getSizeLimit() 225 { 226 return sizeLimit; 227 } 228 229 230 231 /** 232 * Retrieves the name of the backend set containing the subtree to be 233 * migrated. 234 * 235 * @return The name of the backend set containing the subtree to be migrated, 236 * or {@code null} if it is not included in the log message. 237 */ 238 @Nullable() 239 public final String getSourceBackendSetName() 240 { 241 return sourceBackendSetName; 242 } 243 244 245 246 /** 247 * The address and port of the backend server from which the subtree will be 248 * migrated. 249 * 250 * @return The address and port of the backend server from which the subtree 251 * will be migrated, or {@code null} if it is not included in the log 252 * message. 253 */ 254 @Nullable() 255 public final String getSourceBackendServer() 256 { 257 return sourceBackendServer; 258 } 259 260 261 262 /** 263 * Retrieves the name of the backend set to which the subtree will be 264 * migrated. 265 * 266 * @return The name of the backend set ot which the subtree will be migrated, 267 * or {@code null} if it is not included in the log message. 268 */ 269 @Nullable() 270 public final String getTargetBackendSetName() 271 { 272 return targetBackendSetName; 273 } 274 275 276 277 /** 278 * Retrieves the address and port of the backend server to which the subtree 279 * will be migrated. 280 * 281 * @return The address and port of the backend server to which the subtree 282 * will be migrated, or {@code null} if it is not included in the log 283 * message. 284 */ 285 @Nullable() 286 public final String getTargetBackendServer() 287 { 288 return targetBackendServer; 289 } 290 291 292 293 /** 294 * {@inheritDoc} 295 */ 296 @Override() 297 @NotNull() 298 public AccessLogMessageType getMessageType() 299 { 300 return AccessLogMessageType.ENTRY_REBALANCING_REQUEST; 301 } 302}