18 #define PERSISTENCYSVC_PERSISTENCYSVC_CPP
37 #define ON_DEBUG if (UNLIKELY(outputLevel() <= MSG::DEBUG))
38 #define ON_VERBOSE if (UNLIKELY(outputLevel() <= MSG::VERBOSE))
40 #define DEBMSG ON_DEBUG debug()
41 #define VERMSG ON_VERBOSE verbose()
71 if ( 0 != pAddress ) {
72 long svc_type = pAddress->
svcType();
75 return BAD_STORAGE_TYPE;
79 return INVALID_ADDRESS;
88 status = svc->
createObj(pAddress, pObject);
94 status = svc->
updateObj(pAddress, pObject);
100 status = svc->
createRep(pObject, pAddress);
106 status = svc->
updateRep(pAddress, pObject);
170 return (*it).second.addrCreator();
176 return (*it).second.addrCreator();
183 (*i).second.conversionSvc()->setDataProvider(
m_dataSvc).ignore();
211 if ( 0 != pConverter ) {
217 return BAD_STORAGE_TYPE;
227 iret = (*i).second.conversionSvc()->removeConverter(clid);
228 if ( iret.isSuccess() ) {
242 Gaudi::Utils::TypeNameString tn(nam);
245 if ( (*it).second.service()->name() == tn.name() ) {
256 info() <<
"Cannot access Conversion service:" << nam <<
endmsg;
267 return (*it).second.conversionSvc();
271 for ( SvcNames::const_iterator
i = theNames.begin();
i != theNames.end();
i++ ) {
274 long typ = svc->repSvcType();
294 if ( type == def_typ ) {
297 if ( cnv_svc != servc ) {
304 if ( 0 != cnv_svc ) {
310 info() <<
"Added successfully Conversion service:" << isvc->
name() <<
endmsg;
316 info() <<
"Cannot add Conversion service of type " << isvc->
name() <<
endmsg;
323 info() <<
"Cannot add Conversion service of type " << type <<
endmsg;
330 return BAD_STORAGE_TYPE;
337 (*it).second.service()->release();
338 (*it).second.addrCreator()->release();
342 return BAD_STORAGE_TYPE;
377 const unsigned long* ipars,
383 status = svc->
createAddress(svc_type, clid, pars, ipars, refpAddress);
397 if ( 0 != pAddress ) {
398 svc_type = pAddress->
svcType();
399 clid = pAddress->
clID();
411 refAddress += address;
425 long new_svc_type = 0;
428 decodeAddrHdr(refAddress, new_svc_type, new_clid, address_trailer);
432 status = svc->
createAddress( new_svc_type, new_clid, address_trailer, refpAddress);
445 int svctyp = service_type;
446 stream <<
"<address_header service_type=\"" << svctyp <<
"\" clid=\"" << clid <<
"\" /> ";
447 address = stream.
str();
460 address_trailer =
"";
463 size_t pos = address.find(
"<address_header");
464 if (std::string::npos != pos) {
466 pos = address.find(
"service_type=\"");
467 if (std::string::npos != pos) {
469 size_t end = address.find(
'"', pos);
470 if (std::string::npos != end) {
474 pos = address.find(
"clid=\"");
475 if (std::string::npos != pos) {
477 end = address.find(
'\"', pos);
478 if (std::string::npos != end) {
480 str.str(address.substr(pos, end-pos));
483 pos = address.find(
'>');
484 if (pos < (address.size()-2)) {
486 address_trailer = address.substr(pos+1);
511 refpSvc =
service(service_type);
517 const char* imp = service_type.c_str();
518 long len = service_type.length();
519 if ( ::strncasecmp(imp,
"SICB", len) == 0 )
521 else if ( ::strncasecmp(imp,
"ZEBRA", len) == 0 )
523 else if ( ::strncasecmp(imp,
"MS Access", len) == 0 )
525 else if ( ::strncasecmp(imp,
"Microsoft Access", strlen(
"Microsoft Access")) == 0 )
527 else if ( ::strncasecmp(imp,
"SQL Server", len) == 0 )
529 else if ( ::strncasecmp(imp,
"Microsoft ODBC for Oracle", len) == 0 )
531 else if ( ::strncasecmp(imp,
"Oracle ODBC", strlen(
"Oracle ODBC")) == 0 )
533 else if ( ::strncasecmp(imp,
"Oracle OCI", strlen(
"Oracle OCI")) == 0 )
535 else if ( ::strncasecmp(imp,
"MySQL", len) == 0 )
537 else if ( ::strncasecmp(imp,
"ROOT", len) == 0 )
539 else if ( ::strncasecmp(imp,
"OBJY", len) == 0 )
541 else if ( ::strncasecmp(imp,
"OBJYECTI", 7) == 0 )
543 else if ( ::strncasecmp(imp,
"POOL_ROOTKEY", 12) == 0 )
545 else if ( ::strncasecmp(imp,
"POOL_ROOTTREE", 12) == 0 )
547 else if ( ::strncasecmp(imp,
"POOL_ROOT", 9) == 0 )
549 else if ( ::strncasecmp(imp,
"POOL_MySQL", 8) == 0 )
551 else if ( ::strncasecmp(imp,
"POOL_ORACLE", 8) == 0 )
553 else if ( ::strncasecmp(imp,
"POOL_ACCESS", 8) == 0 )
555 else if ( ::strncasecmp(imp,
"POOL", 4) == 0 )
562 if ( svc->name() == service_type ) {
576 Gaudi::Utils::TypeNameString
itm(*
i);
577 if ( itm.name() == service_type || itm.type() == service_type ) {
599 error() <<
"Error initializing Service base class." <<
endmsg;