View Javadoc
1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    https://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.api.ldap.extras.extended.endTransaction;
21  
22  
23  import org.apache.directory.api.ldap.model.message.ExtendedRequest;
24  
25  
26  /**
27   * The EndTransactionRequest interface. This is for the RFC 5805 End Transaction Request,
28   * which grammar is :
29   * <pre>
30   * ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
31   *              requestName      [0] LDAPOID,
32   *              requestValue     [1] OCTET STRING OPTIONAL }
33   * </pre>
34   * 
35   * where 'requestName' is 1.3.6.1.1.21.3 and requestValue is a BER encoded value. The 
36   * syntax for this value is :
37   * 
38   * <pre>
39   * txnEndReq ::= SEQUENCE {
40   *         commit         BOOLEAN DEFAULT TRUE,
41   *         identifier     OCTET STRING }
42   * </pre>
43   *
44   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
45   */
46  public interface EndTransactionRequest extends ExtendedRequest
47  {
48      /** The OID for the EndTransaction extended operation request. */
49      String EXTENSION_OID = "1.3.6.1.1.21.3";
50      
51      /**
52       * @return <tt>true</tt> if the operation should be committed, <tt>false</tt> otherwise
53       */
54      boolean getCommit();
55      
56      
57      /**
58       * Set the Commit flag for this transaction.
59       * 
60       * @param commit <tt>true</tt> if the transaction should be committed, <tt>false</tt> if
61       * it should be rollbacked.
62       */
63      void setCommit( boolean commit );
64      
65      
66      /**
67       * @return The transaction ID 
68       */
69      byte[] getTransactionId();
70  
71      /**
72       * Set the transaction ID to commit or rollback
73       * 
74       * @param transactionId The transaction ID we got from the startTransaction response
75       */
76      void setTransactionId( byte[] transactionId );
77  }