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 org.apache.harmony.jndi.provider.ldap;
19:
20: import javax.naming.NamingException;
21: import javax.naming.ldap.Control;
22: import javax.naming.ldap.UnsolicitedNotification;
23:
24: import org.apache.harmony.jndi.provider.ldap.asn1.ASN1Decodable;
25: import org.apache.harmony.jndi.provider.ldap.asn1.Utils;
26:
27: public class UnsolicitedNotificationImpl implements
28: UnsolicitedNotification, ASN1Decodable {
29:
30: private static final long serialVersionUID = 3063973693971731355L;
31:
32: private LdapResult result;
33:
34: private String oid;
35:
36: private byte[] encodedValue;
37:
38: private Control[] controls;
39:
40: public void decodeValues(Object[] values) {
41: result = new LdapResult();
42: result.decodeValues(values);
43: oid = Utils.getString(values[4]);
44: if (values[5] != null) {
45: encodedValue = (byte[]) values[5];
46: }
47: }
48:
49: public NamingException getException() {
50: return LdapUtils.getExceptionFromResult(result);
51: }
52:
53: public String[] getReferrals() {
54: return result.getReferrals();
55: }
56:
57: public byte[] getEncodedValue() {
58: return encodedValue;
59: }
60:
61: public String getID() {
62: return oid;
63: }
64:
65: public Control[] getControls() throws NamingException {
66: return controls;
67: }
68:
69: public void setControls(Control[] controls) {
70: this.controls = controls;
71: }
72:
73: }
|