

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() |
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.
| com::cosylab::cdb::jdal::WDALImpl::WDALImpl | ( | String[] | args, | |
| ORB | orb, | |||
| POA | poa, | |||
| Logger | logger | |||
| ) | [inline] |
Constructor as it is for DAL
| args | ||
| orb | ||
| poa |
| void com::cosylab::cdb::jdal::WDALImpl::add_node | ( | String | curl, | |
| String | xml | |||
| ) | throws CDBRecordAlreadyExistsEx, CDBXMLErrorEx, CDBExceptionEx [inline] |
Adds a new node specified by curl to the CDB initially filed with
| curl | uri for the CDB node | |
| xml |
| CDBRecordAlreadyExistsEx | ||
| CDBXMLErrorEx | ||
| CDBExceptionEx |
References com::cosylab::cdb::jdal::WDALBaseImpl::dalImpl, getNodeFile(), alma::acs::exceptions::AcsJException::log(), com::cosylab::cdb::jdal::WDALBaseImpl::logger, nodeExists(), alma::cdbErrType::wrappers::AcsJCDBRecordAlreadyExistsEx::setCurl(), alma::cdbErrType::wrappers::AcsJCDBExceptionEx::toCDBExceptionEx(), alma::cdbErrType::wrappers::AcsJCDBRecordAlreadyExistsEx::toCDBRecordAlreadyExistsEx(), alma::cdbErrType::wrappers::AcsJCDBXMLErrorEx::toCDBXMLErrorEx(), com::cosylab::cdb::jdal::DALImpl::totalDALInvocationCounter, validateXML(), and writeXmlData().
| 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
| name | ||
| node | ||
| map | ||
| dao |
| 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] |
References com::cosylab::cdb::jdal::WDALBaseImpl::dalImpl.
Referenced by com::cosylab::cdb::jdal::Server::run().
| File com::cosylab::cdb::jdal::WDALImpl::getNodeFile | ( | String | curl | ) | [inline] |
Returns File object for given curl
| curl | uri of the 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
| curl | uri of the CDB node |
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] |
References com::cosylab::cdb::jdal::WDALBaseImpl::logger.
Referenced by set_DAO().
| 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.
| curl | uri for the CDB node |
| 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
| curl | ||
| propertyMap |
| 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.
| curl | uri for the CDB node | |
| xml |
| 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.
| xml |
| 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
| curl | uri for the CDB node | |
| xmlData | xml to write |
| 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().
POA com::cosylab::cdb::jdal::WDALImpl::poa = null [private] |
Referenced by get_WDAO_Servant(), and set_DAO().
HashMap com::cosylab::cdb::jdal::WDALImpl::wdaoMap = new HashMap() [private] |
Referenced by get_WDAO_Servant().
1.6.2