24 */
25
26 package com.sun.jndi.ldap;
27
28 import javax.naming.ldap.UnsolicitedNotification;
29 import javax.naming.NamingException;
30 import javax.naming.ldap.Control;
31 import java.util.Vector;
32
33 /**
34 * A concrete implementation of an UnsolicitedNotification.
35 * @author Rosanna Lee
36 */
37 final class UnsolicitedResponseImpl implements UnsolicitedNotification {
38 private String oid;
39 private String[] referrals;
40 private byte[] extensionValue;
41 private NamingException exception;
42 private Control[] controls;
43
44 UnsolicitedResponseImpl(String oid, byte[] berVal, Vector ref,
45 int status, String msg, String matchedDN, Control[] controls) {
46 this.oid = oid;
47 this.extensionValue = berVal;
48
49 if (ref != null && ref.size() > 0) {
50 int len = ref.size();
51 referrals = new String[len];
52 for (int i = 0; i < len; i++) {
53 referrals[i] = (String)ref.elementAt(i);
54 }
55 }
56 exception = LdapCtx.mapErrorCode(status, msg);
57 // matchedDN ignored for now; could be used to set resolvedName
58 // exception.setResolvedName(new CompositeName().add(matchedDN));
59
60 this.controls = controls;
61 }
62
63 /**
64 * Retrieves the object identifier of the response.
|
24 */
25
26 package com.sun.jndi.ldap;
27
28 import javax.naming.ldap.UnsolicitedNotification;
29 import javax.naming.NamingException;
30 import javax.naming.ldap.Control;
31 import java.util.Vector;
32
33 /**
34 * A concrete implementation of an UnsolicitedNotification.
35 * @author Rosanna Lee
36 */
37 final class UnsolicitedResponseImpl implements UnsolicitedNotification {
38 private String oid;
39 private String[] referrals;
40 private byte[] extensionValue;
41 private NamingException exception;
42 private Control[] controls;
43
44 UnsolicitedResponseImpl(String oid, byte[] berVal, Vector<Object> ref,
45 int status, String msg, String matchedDN, Control[] controls) {
46 this.oid = oid;
47 this.extensionValue = berVal;
48
49 if (ref != null && ref.size() > 0) {
50 int len = ref.size();
51 referrals = new String[len];
52 for (int i = 0; i < len; i++) {
53 referrals[i] = (String)ref.elementAt(i);
54 }
55 }
56 exception = LdapCtx.mapErrorCode(status, msg);
57 // matchedDN ignored for now; could be used to set resolvedName
58 // exception.setResolvedName(new CompositeName().add(matchedDN));
59
60 this.controls = controls;
61 }
62
63 /**
64 * Retrieves the object identifier of the response.
|