01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.naming.ldap;
19:
20: import java.io.IOException;
21:
22: import org.apache.harmony.jndi.internal.PagedResultSearchControlValue;
23:
24: /**
25: * TODO: JavaDoc
26: */
27: public final class PagedResultsResponseControl extends BasicControl {
28:
29: private static final long serialVersionUID = -8819778744844514666L;
30:
31: public static final String OID = "1.2.840.113556.1.4.319"; //$NON-NLS-1$
32:
33: private int resultSize;
34:
35: private byte[] cookie;
36:
37: public PagedResultsResponseControl(String id, boolean criticality,
38: byte[] value) throws IOException {
39: super (id, criticality, value);
40: PagedResultSearchControlValue pgscv = (PagedResultSearchControlValue) PagedResultsControl.ASN1_ENCODER
41: .decode(value);
42: resultSize = pgscv.getSize();
43: cookie = pgscv.getCookie();
44: }
45:
46: public byte[] getCookie() {
47: if (cookie.length == 0) {
48: return null;
49: }
50: return cookie;
51: }
52:
53: public int getResultSize() {
54: return resultSize;
55: }
56:
57: }
|