com::cosylab::cdb::jdal::JNDIXMLContext Class Reference

Inheritance diagram for com::cosylab::cdb::jdal::JNDIXMLContext:
Inheritance graph
[legend]
Collaboration diagram for com::cosylab::cdb::jdal::JNDIXMLContext:
Collaboration graph
[legend]

List of all members.

Classes

class  JNDIXMLNodesEnumeration

Public Member Functions

 JNDIXMLContext (String name, String elements, String xml, Logger logger)
 JNDIXMLContext (XMLTreeNode node, Logger logger)
NamingEnumeration list (Name name) throws NamingException
Object lookup (Name name) throws NamingException

Static Protected Member Functions

static void initParser ()

Private Attributes

XMLTreeNode node
Hashtable nestedElements

Static Private Attributes

static boolean parserInited = false
static SAXParserFactory factory
static SAXParser saxParser

Detailed Description

Author:
dvitas

Constructor & Destructor Documentation

com::cosylab::cdb::jdal::JNDIXMLContext::JNDIXMLContext ( String  name,
String  elements,
String  xml,
Logger  logger 
) [inline]
com::cosylab::cdb::jdal::JNDIXMLContext::JNDIXMLContext ( XMLTreeNode  node,
Logger  logger 
) [inline]

Member Function Documentation

static void com::cosylab::cdb::jdal::JNDIXMLContext::initParser (  )  [inline, static, protected]

References factory, parserInited, and saxParser.

Referenced by JNDIXMLContext().

NamingEnumeration com::cosylab::cdb::jdal::JNDIXMLContext::list ( Name  name  )  throws NamingException [inline]
See also:
Context::list(Name)

Reimplemented from com::cosylab::cdb::jdal::JNDIContext.

References lookup(), com::cosylab::cdb::jdal::JNDIContext::name, and node.

Object com::cosylab::cdb::jdal::JNDIXMLContext::lookup ( Name  name  )  throws NamingException [inline]
See also:
Context::lookup(Name) THIS IS OLD CDB implementation public Object lookup(Name name) throws NamingException { System.out.println("CDBContext lookup on " + this.name + " for " + name.toString()); String nameToLookup = this.name + "/" + name; String recordName = nameToLookup.substring(nameToLookup.lastIndexOf('/')+1); get list from the server String elements = dal.list_nodes(nameToLookup); try { if (elements.indexOf(recordName + ".xml") != -1) { String xml = dal.get_DAO(nameToLookup); return new JNDIXMLContext(nameToLookup, elements, xml); } else { if (elements.length() == 0 ) { // inside a XML? int slashIndex = nameToLookup.lastIndexOf('/'); String newName; while( slashIndex != -1 ) { newName = nameToLookup.substring(0,slashIndex); recordName = newName.substring(newName.lastIndexOf('/')+1); elements = dal.list_nodes(newName); if (elements.indexOf(recordName + ".xml") != -1) { String xml = dal.get_DAO(newName); recordName = nameToLookup.substring(slashIndex+1); return new JNDIXMLContext(newName, elements, xml).lookup(recordName); } slashIndex = newName.lastIndexOf('/'); } throw new NamingException("No name " + nameToLookup ); } return new JNDIContext(nameToLookup, elements); } } catch (CDBRecordDoesNotExistEx e) { if it does not exists then it is just a context return new JNDIContext(nameToLookup, elements); } catch (CDBXMLErrorEx e) { AcsJCDBXMLErrorEx acse = new AcsJCDBXMLErrorEx(e); throw new NamingException(acse.getFilename()); } } This methos returns either a new JNDI_Context or a new JNDI_XMLContxt obj.

Reimplemented from com::cosylab::cdb::jdal::JNDIContext.

References com::cosylab::cdb::jdal::XMLTreeNode::getFieldMap(), com::cosylab::cdb::jdal::XMLTreeNode::getNodesMap(), JNDIXMLContext(), com::cosylab::cdb::jdal::JNDIContext::logger, com::cosylab::cdb::jdal::JNDIContext::name, nestedElements, and node.

Referenced by list().


Member Data Documentation

SAXParserFactory com::cosylab::cdb::jdal::JNDIXMLContext::factory [static, private]

Referenced by initParser().

Referenced by lookup().

Referenced by JNDIXMLContext(), list(), and lookup().

boolean com::cosylab::cdb::jdal::JNDIXMLContext::parserInited = false [static, private]

Referenced by initParser().

Referenced by initParser(), and JNDIXMLContext().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2