01: package com.flexive.war.webdav;
02:
03: /*
04: * JBoss, the OpenSource J2EE webOS
05: *
06: * Distributable under LGPL license.
07: * See terms of license at gnu.org.
08: */
09:
10: import javax.naming.Binding;
11: import javax.naming.directory.Attributes;
12:
13: /**
14: * A subclass of Binding that adds support for Attributes. This class is used
15: * to pass a contexts raw bindings to NameBindingIterator.
16: *
17: * @author Scott_Stark@displayscape.com
18: * @version $Rev: 1 $
19: */
20: public class DirBinding extends Binding {
21: private static final long serialVersionUID = -8358283153577718942L;
22: private transient Attributes attributes;
23:
24: /**
25: * Constructs an instance of a Binding given its relative name, object,
26: * attributes and whether the name is relative.
27: *
28: * @param obj - The possibly null object bound to name.
29: * @param attributes - the attributes associated with obj
30: */
31: public DirBinding(String name, Object obj, Attributes attributes) {
32: this (name, null, obj, true, attributes);
33: }
34:
35: /**
36: * Constructs an instance of a Binding given its relative name, class name,
37: * object, attributes and whether the name is relative.
38: *
39: * @param name - The non-null string name of the object.
40: * @param className - The possibly null class name of the object bound to name.
41: * If null, the class name of obj is returned by getClassName(). If obj is
42: * also null, getClassName() will return null.
43: * @param obj - The possibly null object bound to name.
44: * @param attributes - the attributes associated with obj
45: */
46: public DirBinding(String name, String className, Object obj,
47: Attributes attributes) {
48: this (name, className, obj, true, attributes);
49: }
50:
51: /**
52: * Constructs an instance of a Binding given its name, object, attributes
53: * and whether the name is relative.
54: *
55: * @param name - The non-null string name of the object.
56: * @param obj - The possibly null object bound to name.
57: * @param isRelative - true if name is a name relative to the target context
58: * (which is named by the first parameter of the listBindings() method);
59: * false if name is a URL string.
60: * @param attributes - the attributes associated with obj
61: */
62: public DirBinding(String name, String className, Object obj,
63: boolean isRelative, Attributes attributes) {
64: super (name, className, obj, isRelative);
65: this .attributes = attributes;
66: }
67:
68: public Attributes getAttributes() {
69: return attributes;
70: }
71:
72: public void setAttributes(Attributes attributes) {
73: this.attributes = attributes;
74: }
75: }
|