mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
21.09.2015 a4e4a5b2d484486dc143ea9cd963168b0668d2c0
Fix checkstyle for TransactionIdControl class
1 files modified
49 ■■■■■ changed files
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/TransactionIdControl.java 49 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-core/src/main/java/org/forgerock/opendj/ldap/controls/TransactionIdControl.java
@@ -35,39 +35,33 @@
/**
 * Control to provide a transaction ID.
 * <p>
 * The transaction ID is related to Common Audit : it is used for tracking the
 * processing of a user-interaction as it passes through the Forgerock stack
 * The transaction ID is related to Common Audit : it is used for tracking the processing of a user-interaction as it
 * passes through the Forgerock stack
 * <p>
 * The control's value is the UTF-8 encoding of the transaction ID.
 */
public final class TransactionIdControl implements Control
{
public final class TransactionIdControl implements Control {
  /** OID for this control. */
  public static final String OID = "1.3.6.1.4.1.36733.2.1.5.1";
  /** A decoder which can be used for decoding the simple paged results control. */
  public static final ControlDecoder<TransactionIdControl> DECODER = new ControlDecoder<TransactionIdControl>()
  {
    public static final ControlDecoder<TransactionIdControl> DECODER = new ControlDecoder<TransactionIdControl>() {
    @Override
    public TransactionIdControl decodeControl(final Control control, final DecodeOptions options)
        throws DecodeException
    {
                throws DecodeException {
      Reject.ifNull(control);
      if (control instanceof TransactionIdControl)
      {
            if (control instanceof TransactionIdControl) {
        return (TransactionIdControl) control;
      }
      if (!control.getOID().equals(OID))
      {
            if (!control.getOID().equals(OID)) {
        throw DecodeException.error(ERR_TRANSACTION_ID_CONTROL_BAD_OID.get(control.getOID(), OID));
      }
      if (!control.hasValue())
      {
            if (!control.hasValue()) {
        // The control must always have a value.
        throw DecodeException.error(ERR_TRANSACTION_ID_CONTROL_DECODE_NULL.get());
      }
@@ -76,8 +70,7 @@
    }
    @Override
    public String getOID()
    {
        public String getOID() {
      return OID;
    }
  };
@@ -91,8 +84,7 @@
   * @throws NullPointerException
   *           If {@code transactionId} was {@code null}.
   */
  public static TransactionIdControl newControl(final String transactionId)
  {
    public static TransactionIdControl newControl(final String transactionId) {
    Reject.ifNull(transactionId);
    return new TransactionIdControl(transactionId);
  }
@@ -100,8 +92,7 @@
  /** The control value transactionId element. */
  private final String transactionId;
  private TransactionIdControl(final String transactionId)
  {
    private TransactionIdControl(final String transactionId) {
    this.transactionId = transactionId;
  }
@@ -110,39 +101,33 @@
   *
   * @return The transaction id.
   */
  public String getTransactionId()
  {
    public String getTransactionId() {
    return transactionId;
  }
  @Override
  public String getOID()
  {
    public String getOID() {
    return OID;
  }
  @Override
  public ByteString getValue()
  {
    public ByteString getValue() {
    return ByteString.valueOfUtf8(transactionId);
  }
  @Override
  public boolean hasValue()
  {
    public boolean hasValue() {
    return true;
  }
  @Override
  public boolean isCritical()
  {
    public boolean isCritical() {
    // This control is never critical.
    return false;
  }
  @Override
  public String toString()
  {
    public String toString() {
    final StringBuilder builder = new StringBuilder();
    builder.append("TransactionIdControl(oid=");
    builder.append(getOID());