KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > dsmlv2 > reponse > BatchResponse


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  * http://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
21 package org.apache.directory.ldapstudio.dsmlv2.reponse;
22
23
24 import java.util.ArrayList JavaDoc;
25 import java.util.List JavaDoc;
26
27 import org.apache.directory.shared.ldap.codec.LdapResponse;
28
29
30 /**
31  * This class represents the Batch Response of a DSML Response
32  *
33  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
34  * @version $Rev$, $Date$
35  */

36 public class BatchResponse
37 {
38
39     /**
40      * The responses contained in the Batch Response
41      */

42     private List JavaDoc<LdapResponse> responses;
43
44     /**
45      * The ID of the response
46      */

47     private int requestID;
48
49
50     /**
51      * Creates a new instance of BatchResponse.
52      */

53     public BatchResponse()
54     {
55         responses = new ArrayList JavaDoc<LdapResponse>();
56     }
57
58
59     /**
60      * Adds a reponse
61      *
62      * @param response
63      * the response to add
64      * @return
65      * true (as per the general contract of the Collection.add method)
66      */

67     public boolean addResponse( LdapResponse response )
68     {
69         return responses.add( response );
70     }
71
72
73     /**
74      * Gets the current reponse
75      *
76      * @return
77      * the current response
78      */

79     public LdapResponse getCurrentResponse()
80     {
81         return responses.get( responses.size() - 1 );
82     }
83
84
85     /**
86      * Gets the ID of the response
87      * @return
88      * the ID of the response
89      */

90     public int getRequestID()
91     {
92         return requestID;
93     }
94
95
96     /**
97      * Sets the ID of the response
98      *
99      * @param requestID
100      * the ID to set
101      */

102     public void setRequestID( int requestID )
103     {
104         this.requestID = requestID;
105     }
106
107
108     /**
109      * Gets the List of all the reponses
110      *
111      * @return
112      * the List of all the responses
113      */

114     public List JavaDoc getResponses()
115     {
116         return responses;
117     }
118 }
119
Popular Tags