com.unboundid.ldap.sdk.unboundidds.controls.AssuredReplicationRemoteLevel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unboundid-ldapsdk-commercial-edition Show documentation
Show all versions of unboundid-ldapsdk-commercial-edition Show documentation
The UnboundID LDAP SDK for Java is a fast, comprehensive, and easy-to-use
Java API for communicating with LDAP directory servers and performing
related tasks like reading and writing LDIF, encoding and decoding data
using base64 and ASN.1 BER, and performing secure communication. This
package contains the Commercial Edition of the LDAP SDK, which includes
all of the general-purpose functionality contained in the Standard
Edition, plus additional functionality specific to UnboundID server
products.
/*
* Copyright 2013-2016 UnboundID Corp.
* All Rights Reserved.
*/
/*
* Copyright (C) 2015-2016 UnboundID Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (GPLv2 only)
* or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see .
*/
package com.unboundid.ldap.sdk.unboundidds.controls;
import com.unboundid.util.ThreadSafety;
import com.unboundid.util.ThreadSafetyLevel;
/**
*
* NOTE: This class is part of the Commercial Edition of the UnboundID
* LDAP SDK for Java. It is not available for use in applications that
* include only the Standard Edition of the LDAP SDK, and is not supported for
* use in conjunction with non-UnboundID products.
*
* This enum defines an assurance level that may be used for servers in
* different locations from the server receiving the change.
*/
@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
public enum AssuredReplicationRemoteLevel
{
/**
* Indicates that no remote assurance is desired for the associated operation.
*/
NONE(0),
/**
* Indicates that the operation result should not be returned to the client
* until the change has been received by at least one replication server in a
* different location. Note that this level does not require the change to
* have already been processed by any other directory server, but merely
* requires that it exist in at least one remote replication server for the
* sake of redundancy. If the client interacts with another remote directory
* server immediately after receiving a result with this level of assurance,
* there is no guarantee that the associated change will be visible on that
* server.
*/
RECEIVED_ANY_REMOTE_LOCATION(1),
/**
* Indicates that the operation result should not be returned to the client
* until the change has been received by at least one replication server in
* each of the remote locations. Note that this level does not require the
* change to have already been processed by any other directory server, but
* merely requires that it exist in at least one remote replication server in
* each remote location for the sake of redundancy. If the client interacts
* with another remote directory server immediately after receiving a result
* with this level of assurance, there is no guarantee that the associated
* change will be visible on that server.
*/
RECEIVED_ALL_REMOTE_LOCATIONS(2),
/**
* Indicates that the operation result should not be returned to the client
* until the change has been processed by all available servers in all remote
* locations.
*/
PROCESSED_ALL_REMOTE_SERVERS(3);
// The integer value for this remote assurance level.
private final int intValue;
/**
* Creates a new remote assurance level with the provided integer value.
*
* @param intValue The integer value for this remote assurance level.
*/
AssuredReplicationRemoteLevel(final int intValue)
{
this.intValue = intValue;
}
/**
* Retrieves integer value for this remote assurance level.
*
* @return The integer value for this remote assurance level.
*/
public int intValue()
{
return intValue;
}
/**
* Retrieves the remote assurance level with the specified integer value.
*
* @param intValue The integer value for the remote assurance level to
* retrieve.
*
* @return The requested remote assurance level, or {@code null} if there is
* no remote assurance level with the specified integer value.
*/
public static AssuredReplicationRemoteLevel valueOf(final int intValue)
{
for (final AssuredReplicationRemoteLevel l : values())
{
if (l.intValue == intValue)
{
return l;
}
}
return null;
}
/**
* Retrieves the less strict of the two provided assured replication remote
* level values. If the two provided values are the same, then that value
* will be returned.
*
* @param l1 The first value to compare.
* @param l2 The second value to compare.
*
* @return The less strict of the two provided assured replication remote
* level values.
*/
public static AssuredReplicationRemoteLevel getLessStrict(
final AssuredReplicationRemoteLevel l1,
final AssuredReplicationRemoteLevel l2)
{
// At present, the integer values can be used to make the comparison. If
// any more enum values are added, this may need to be changed.
if (l1.intValue <= l2.intValue)
{
return l1;
}
else
{
return l2;
}
}
/**
* Retrieves the more strict of the two provided assured replication remote
* level values. If the two provided values are the same, then that value
* will be returned.
*
* @param l1 The first value to compare.
* @param l2 The second value to compare.
*
* @return The more strict of the two provided assured replication remote
* level values.
*/
public static AssuredReplicationRemoteLevel getMoreStrict(
final AssuredReplicationRemoteLevel l1,
final AssuredReplicationRemoteLevel l2)
{
// At present, the integer values can be used to make the comparison. If
// any more enum values are added, this may need to be changed.
if (l1.intValue >= l2.intValue)
{
return l1;
}
else
{
return l2;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy