001: package com.flexive.war.webdav;
002:
003: /*
004: * JBoss, the OpenSource J2EE webOS
005: *
006: * Distributable under LGPL license.
007: * See terms of license at gnu.org.
008: */
009:
010: import javax.naming.Context;
011: import javax.naming.NameParser;
012: import javax.naming.NamingEnumeration;
013: import javax.naming.NamingException;
014: import javax.naming.directory.Attributes;
015: import javax.naming.directory.DirContext;
016: import javax.naming.directory.ModificationItem;
017: import javax.naming.directory.SearchControls;
018:
019: /**
020: * An abstract implementation of DirContext that simply takes every DirContext
021: * method that accepts the String form of a Name and invokes the corresponding
022: * method that accecpts a Name.
023: *
024: * @author Scott_Stark@displayscape.com
025: * @version $Id: DirContextStringImpl.java,v 1.1.24.1 2005/04/06 21:25:10 starksm Exp $
026: */
027: public abstract class DirContextStringImpl implements DirContext {
028: private NameParser nameParser;
029:
030: /**
031: * Creates new DirContextStringImpl
032: */
033: public DirContextStringImpl(NameParser nameParser) {
034: this .nameParser = nameParser;
035: }
036:
037: public DirContextStringImpl() {
038: this (DefaultName.getNameParser());
039: }
040:
041: // --- Begin DirContext interface methods that accept a String name
042: public void bind(java.lang.String name, Object obj)
043: throws NamingException {
044: bind(nameParser.parse(name), obj);
045: }
046:
047: public String composeName(String name, String name1)
048: throws NamingException {
049: return null;
050: }
051:
052: public Context createSubcontext(java.lang.String name)
053: throws NamingException {
054: return createSubcontext(nameParser.parse(name));
055: }
056:
057: public void destroySubcontext(java.lang.String name)
058: throws NamingException {
059: destroySubcontext(nameParser.parse(name));
060: }
061:
062: public NameParser getNameParser(java.lang.String name)
063: throws NamingException {
064: return getNameParser(nameParser.parse(name));
065: }
066:
067: public NamingEnumeration list(java.lang.String name)
068: throws NamingException {
069: return list(nameParser.parse(name));
070: }
071:
072: public NamingEnumeration listBindings(java.lang.String name)
073: throws NamingException {
074: return listBindings(nameParser.parse(name));
075: }
076:
077: public java.lang.Object lookup(String name) throws NamingException {
078: return lookup(nameParser.parse(name));
079: }
080:
081: public java.lang.Object lookupLink(String name)
082: throws NamingException {
083: return lookupLink(nameParser.parse(name));
084: }
085:
086: public void rebind(String name, Object obj) throws NamingException {
087: rebind(nameParser.parse(name), obj);
088: }
089:
090: public void rename(String name, String name1)
091: throws NamingException {
092: rename(nameParser.parse(name), nameParser.parse(name1));
093: }
094:
095: public void unbind(String name) throws NamingException {
096: unbind(nameParser.parse(name));
097: }
098:
099: public void bind(String name, Object obj, Attributes attributes)
100: throws NamingException {
101: bind(nameParser.parse(name), obj, attributes);
102: }
103:
104: public DirContext createSubcontext(String name,
105: Attributes attributes) throws NamingException {
106: return createSubcontext(nameParser.parse(name), attributes);
107: }
108:
109: public Attributes getAttributes(String name) throws NamingException {
110: return getAttributes(nameParser.parse(name));
111: }
112:
113: public Attributes getAttributes(String name, String[] attrNames)
114: throws NamingException {
115: return getAttributes(nameParser.parse(name), attrNames);
116: }
117:
118: public DirContext getSchema(String name) throws NamingException {
119: return getSchema(nameParser.parse(name));
120: }
121:
122: public DirContext getSchemaClassDefinition(String name)
123: throws NamingException {
124: return getSchemaClassDefinition(nameParser.parse(name));
125: }
126:
127: public void modifyAttributes(String name,
128: ModificationItem[] modificationItem) throws NamingException {
129: modifyAttributes(nameParser.parse(name), modificationItem);
130: }
131:
132: public void modifyAttributes(String name, int index,
133: Attributes attributes) throws NamingException {
134: modifyAttributes(nameParser.parse(name), index, attributes);
135: }
136:
137: public void rebind(String name, Object obj, Attributes attributes)
138: throws NamingException {
139: rebind(nameParser.parse(name), obj, attributes);
140: }
141:
142: public NamingEnumeration search(String name, Attributes attributes)
143: throws NamingException {
144: return search(nameParser.parse(name), attributes);
145: }
146:
147: public NamingEnumeration search(String name, String name1,
148: SearchControls searchControls) throws NamingException {
149: return search(nameParser.parse(name), name1, searchControls);
150: }
151:
152: public NamingEnumeration search(String name, Attributes attributes,
153: String[] str2) throws NamingException {
154: return search(nameParser.parse(name), attributes, str2);
155: }
156:
157: public NamingEnumeration search(String name, String name1,
158: Object[] obj, SearchControls searchControls)
159: throws NamingException {
160: return null;
161: }
162:
163: // --- End DirContext interface methods
164:
165: }
|