com::cosylab::cdb::jdal::WDALImpl Class Reference

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

List of all members.

Classes

class  WriteXMLHandler

Public Member Functions

 WDALImpl (String[] args, ORB orb, POA poa, Logger logger)
WDAO get_WDAO_Servant (String curl) throws CDBXMLErrorEx, CDBRecordDoesNotExistEx, CDBRecordIsReadOnlyEx
void add_node (String curl, String xml) throws CDBRecordAlreadyExistsEx, CDBXMLErrorEx, CDBExceptionEx
void remove_node (String curl) throws CDBRecordDoesNotExistEx, CDBRecordIsReadOnlyEx
void set_DAO (String curl, String xml) throws CDBRecordDoesNotExistEx, CDBFieldDoesNotExistEx, CDBRecordIsReadOnlyEx, CDBXMLErrorEx, CDBExceptionEx
boolean nodeExists (String curl)
File getNodeFile (String curl)
void saveChanges (String curl, Map propertyMap) throws AcsJCDBXMLErrorEx, AcsJCDBExceptionEx, AcsJCDBFieldDoesNotExistEx
void validateXML (String xml) throws AcsJCDBXMLErrorEx

Package Functions

DALImpl getDALImplDelegate ()

Private Member Functions

void parseXML (String xml, XMLHandler xmlSolver) throws CDBXMLErrorEx
synchronized void writeXmlData (String curl, String xmlData) throws AcsJCDBExceptionEx
void checkforChanges (String name, XMLTreeNode node, Map map, DAOImpl dao) throws AcsJCDBFieldDoesNotExistEx, AcsJCDBXMLErrorEx

Private Attributes

POA poa = null
HashMap wdaoMap = new HashMap()

Detailed Description

Implementation of Writable Data Access Layer (WDAL) interface. Enables adding, removing and modifying nodes in ConfigurationDataBase (CDB). Nodes are xml files organized in directories so that directory has a xml file named exactly as directory. For example node /alma/LAMP1 is valid CDB node if there is file /alma/LAMP1/LAMP1.xml. It is implemented as wraper around DAL.

Author:
dvitas

Constructor & Destructor Documentation

com::cosylab::cdb::jdal::WDALImpl::WDALImpl ( String[]  args,
ORB  orb,
POA  poa,
Logger  logger 
) [inline]

Constructor as it is for DAL

Parameters:
args 
orb 
poa 

Member Function Documentation

void com::cosylab::cdb::jdal::WDALImpl::add_node ( String  curl,
String  xml 
) throws CDBRecordAlreadyExistsEx, CDBXMLErrorEx, CDBExceptionEx [inline]
void com::cosylab::cdb::jdal::WDALImpl::checkforChanges ( String  name,
XMLTreeNode  node,
Map  map,
DAOImpl  dao 
) throws AcsJCDBFieldDoesNotExistEx, AcsJCDBXMLErrorEx [inline, private]

Recursively scans nodes and check every property with current xml

Parameters:
name 
node 
map 
dao 
Exceptions:
AcsJCDBFieldDoesNotExistEx 
AcsJCDBXMLErrorEx 

References com::cosylab::cdb::jdal::XMLTreeNode::isMapNode(), and com::cosylab::cdb::jdal::XMLTreeNode::m_fieldMap.

Referenced by set_DAO().

WDAO com::cosylab::cdb::jdal::WDALImpl::get_WDAO_Servant ( String  curl  )  throws CDBXMLErrorEx, CDBRecordDoesNotExistEx, CDBRecordIsReadOnlyEx [inline]
DALImpl com::cosylab::cdb::jdal::WDALImpl::getDALImplDelegate (  )  [inline, package]
File com::cosylab::cdb::jdal::WDALImpl::getNodeFile ( String  curl  )  [inline]

Returns File object for given curl

Parameters:
curl uri of the CDB node
Returns:
File object for CDB node

References com::cosylab::cdb::jdal::WDALBaseImpl::dalImpl, com::cosylab::cdb::jdal::DALImpl::getRecordPath(), and com::cosylab::cdb::jdal::WDALBaseImpl::logger.

Referenced by add_node(), nodeExists(), remove_node(), saveChanges(), set_DAO(), and writeXmlData().

boolean com::cosylab::cdb::jdal::WDALImpl::nodeExists ( String  curl  )  [inline]

Returns true if node specified with curl exists

Parameters:
curl uri of the CDB node
Returns:
true if node exists false otherwise

References getNodeFile().

Referenced by add_node(), remove_node(), saveChanges(), and set_DAO().

void com::cosylab::cdb::jdal::WDALImpl::parseXML ( String  xml,
XMLHandler  xmlSolver 
) throws CDBXMLErrorEx [inline, private]
void com::cosylab::cdb::jdal::WDALImpl::remove_node ( String  curl  )  throws CDBRecordDoesNotExistEx, CDBRecordIsReadOnlyEx [inline]

Removes node identified by curl by deleting its file and directory if empty.

Parameters:
curl uri for the CDB node
Exceptions:
CDBRecordDoesNotExistEx 
CDBRecordIsReadOnlyEx 

References com::cosylab::cdb::jdal::WDALBaseImpl::clear_cache(), com::cosylab::cdb::jdal::WDALBaseImpl::dalImpl, getNodeFile(), com::cosylab::cdb::jdal::WDALBaseImpl::logger, nodeExists(), and com::cosylab::cdb::jdal::DALImpl::totalDALInvocationCounter.

void com::cosylab::cdb::jdal::WDALImpl::saveChanges ( String  curl,
Map  propertyMap 
) throws AcsJCDBXMLErrorEx, AcsJCDBExceptionEx, AcsJCDBFieldDoesNotExistEx [inline]

Save changes given by map to the node identified by curl

Parameters:
curl 
propertyMap 
Exceptions:
CDBXMLErrorEx 
CDBExceptionEx 
CDBFieldDoesNotExistEx 

References getNodeFile(), com::cosylab::cdb::jdal::WDALBaseImpl::logger, nodeExists(), alma::cdbErrType::wrappers::AcsJCDBXMLErrorEx::setCurl(), validateXML(), com::cosylab::cdb::jdal::WDALImpl::WriteXMLHandler::writeXML(), and writeXmlData().

Referenced by set_DAO(), and com::cosylab::cdb::jdal::WDAOImpl::setField().

void com::cosylab::cdb::jdal::WDALImpl::set_DAO ( String  curl,
String  xml 
) throws CDBRecordDoesNotExistEx, CDBFieldDoesNotExistEx, CDBRecordIsReadOnlyEx, CDBXMLErrorEx, CDBExceptionEx [inline]

Change content of a node identified by curl so given xml is scanned for differences which are applied. This function can be invoked with full expanded version of the existing xml with some changes or it can be invoked by small xml with only changes to be applied. For example to change parameter 'Timeot' in Manager we can pass as xml

 
     <?xml version="1.0" encoding="ISO-8859-1"?>
  <Manager timeout="50.0">
 
 

and new value will be saved in the xml file.

Parameters:
curl uri for the CDB node
xml 
Exceptions:
CDBRecordDoesNotExistEx 
CDBFieldDoesNotExistEx 
CDBRecordIsReadOnlyEx 
CDBXMLErrorEx 
CDBExceptionEx 

References checkforChanges(), com::cosylab::cdb::jdal::WDALBaseImpl::dalImpl, com::cosylab::cdb::jdal::DALImpl::get_DAO(), getNodeFile(), com::cosylab::cdb::jdal::WDALBaseImpl::logger, com::cosylab::cdb::jdal::XMLHandler::m_rootNode, nodeExists(), parseXML(), poa, saveChanges(), alma::cdbErrType::wrappers::AcsJCDBExceptionEx::toCDBExceptionEx(), alma::cdbErrType::wrappers::AcsJCDBFieldDoesNotExistEx::toCDBFieldDoesNotExistEx(), alma::cdbErrType::wrappers::AcsJCDBXMLErrorEx::toCDBXMLErrorEx(), and com::cosylab::cdb::jdal::DALImpl::totalDALInvocationCounter.

void com::cosylab::cdb::jdal::WDALImpl::validateXML ( String  xml  )  throws AcsJCDBXMLErrorEx [inline]

Check that everything conforms to the schema in given xml. This check will be done by parser used in DAL.

Parameters:
xml 
Exceptions:
AcsJCDBXMLErrorEx 

References com::cosylab::cdb::jdal::WDALBaseImpl::dalImpl, com::cosylab::cdb::jdal::DALImpl::getSaxParser(), com::cosylab::cdb::jdal::WDALBaseImpl::logger, com::cosylab::cdb::jdal::XMLHandler::m_errorString, and alma::cdbErrType::wrappers::AcsJCDBXMLErrorEx::setErrorString().

Referenced by add_node(), and saveChanges().

synchronized void com::cosylab::cdb::jdal::WDALImpl::writeXmlData ( String  curl,
String  xmlData 
) throws AcsJCDBExceptionEx [inline, private]

Writes given xml to disk overwriting eventualy existing file

Parameters:
curl uri for the CDB node
xmlData xml to write
Exceptions:
CDBExceptionEx general CDB exception if something goes wrong while saving

References com::cosylab::cdb::jdal::WDALBaseImpl::clear_cache(), and getNodeFile().

Referenced by add_node(), and saveChanges().


Member Data Documentation

Referenced by get_WDAO_Servant(), and set_DAO().

HashMap com::cosylab::cdb::jdal::WDALImpl::wdaoMap = new HashMap() [private]

Referenced by get_WDAO_Servant().


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

Generated by  doxygen 1.6.2