Classes | Public Member Functions | Static Protected Member Functions

com.cosylab.cdb.jdal.JNDIXMLContext Class Reference

Inheritance diagram for com.cosylab.cdb.jdal.JNDIXMLContext:
com.cosylab.cdb.jdal.JNDIContext

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 ()

Detailed Description

Author:
dvitas

Constructor & Destructor Documentation

com.cosylab.cdb.jdal.JNDIXMLContext.JNDIXMLContext ( String  name,
String  elements,
String  xml,
Logger  logger 
)
com.cosylab.cdb.jdal.JNDIXMLContext.JNDIXMLContext ( XMLTreeNode  node,
Logger  logger 
)

Member Function Documentation

static void com.cosylab.cdb.jdal.JNDIXMLContext.initParser (  )  [static, protected]
NamingEnumeration com.cosylab.cdb.jdal.JNDIXMLContext.list ( Name  name  )  throws NamingException
Object com.cosylab.cdb.jdal.JNDIXMLContext.lookup ( Name  name  )  throws NamingException
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(), com.cosylab.cdb.jdal.JNDIXMLContext.JNDIXMLContext(), com.cosylab.cdb.jdal.JNDIContext.logger, and com.cosylab.cdb.jdal.JNDIContext.name.

Referenced by com.cosylab.cdb.jdal.JNDIXMLContext.list().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties