Commit 362508d3 authored by Steven Murray's avatar Steven Murray
Browse files

json includes and library are now json-c. Added .str() to streams on the RHS of <<

parent 56d354e2
......@@ -29,7 +29,7 @@
#include <ctime>
#include <cxxabi.h>
#include <unistd.h>
#include <json/json.h>
#include <json-c/json.h>
cta::objectstore::Agent::Agent(Backend & os):
ObjectOps<serializers::Agent>(os), m_nextId(0) {}
......
......@@ -19,7 +19,7 @@
#include "AgentRegister.hpp"
#include "ProtocolBuffersAlgorithms.hpp"
#include "GenericObject.hpp"
#include <json/json_object.h>
#include <json-c/json_object.h>
cta::objectstore::AgentRegister::AgentRegister(Backend & os):
ObjectOps<serializers::AgentRegister>(os) {}
......@@ -130,4 +130,4 @@ std::string cta::objectstore::AgentRegister::dump() {
ret << json_object_to_json_string_ext(jo, JSON_C_TO_STRING_PRETTY) << std::endl;
json_object_put(jo);
return ret.str();
}
\ No newline at end of file
}
......@@ -21,7 +21,7 @@
#include "CreationLog.hpp"
#include "TapePool.hpp"
#include "UserIdentity.hpp"
#include <json/json.h>
#include <json-c/json.h>
cta::objectstore::ArchiveToFileRequest::ArchiveToFileRequest(
const std::string& address, Backend& os):
......
......@@ -50,7 +50,7 @@ add_library (ctaobjectstore SHARED
GenericObject.cpp
GarbageCollector.cpp
SchedulerGlobalLock.cpp)
target_link_libraries(ctaobjectstore Utils rados json ctautils)
target_link_libraries(ctaobjectstore Utils rados json-c ctautils)
set_source_files_properties(BackendRados.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations)
install (TARGETS ctaobjectstore DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
......
......@@ -22,7 +22,7 @@
#include "RootEntry.hpp"
#include "common/DriveState.hpp"
#include <set>
#include <json/json.h>
#include <json-c/json.h>
#include <iostream>
cta::objectstore::DriveRegister::DriveRegister(const std::string & address, Backend & os):
......
......@@ -20,7 +20,7 @@
#include "GenericObject.hpp"
#include "CreationLog.hpp"
#include "objectstore/cta.pb.h"
#include <json/json.h>
#include <json-c/json.h>
cta::objectstore::RetrieveToFileRequest::RetrieveToFileRequest(
const std::string& address, Backend& os):
......
......@@ -25,7 +25,7 @@
#include "SchedulerGlobalLock.hpp"
#include <cxxabi.h>
#include "ProtocolBuffersAlgorithms.hpp"
#include <json/json.h>
#include <json-c/json.h>
// construtor, when the backend store exists.
// Checks the existence and correctness of the root entry
......
......@@ -19,7 +19,7 @@
#include "SchedulerGlobalLock.hpp"
#include "GenericObject.hpp"
#include "RootEntry.hpp"
#include <json/json.h>
#include <json-c/json.h>
namespace cta { namespace objectstore {
......@@ -103,4 +103,4 @@ std::string SchedulerGlobalLock::dump() {
return ret.str();
}
}}
\ No newline at end of file
}}
......@@ -19,7 +19,7 @@
#include "Tape.hpp"
#include "GenericObject.hpp"
#include "CreationLog.hpp"
#include <json/json.h>
#include <json-c/json.h>
cta::objectstore::Tape::Tape(const std::string& address, Backend& os):
ObjectOps<serializers::Tape>(os, address) { }
......
......@@ -22,7 +22,7 @@
#include "CreationLog.hpp"
#include "Tape.hpp"
#include "RootEntry.hpp"
#include <json/json.h>
#include <json-c/json.h>
cta::objectstore::TapePool::TapePool(const std::string& address, Backend& os):
ObjectOps<serializers::TapePool>(os, address) { }
......
......@@ -265,7 +265,7 @@ protected:
ex.getMessage() <<
"Reply from rmcd contains too many ERR_MSG messages"
": maxERR_MSG=" << maxERR_MSG << " rmcErrorStream=" <<
rmcErrorStream;
rmcErrorStream.str();
throw ex;
}
......
......@@ -45,7 +45,7 @@ castor::mediachanger::LibrarySlot *castor::mediachanger::LibrarySlotParser::
} catch(castor::exception::Exception &ne) {
castor::exception::Exception ex;
ex.getMessage() << "Failed to parse library slot from string"
" representation: " << ne.getMessage();
" representation: " << ne.getMessage().str();
throw ex;
}
}
......
......@@ -70,7 +70,7 @@ void castor::tape::reactor::ZMQReactor::registerHandler(
std::ostringstream socketInHex;
socketInHex << std::hex << item.socket;
log::Param params[] = {log::Param("fd", item.fd),
log::Param("socket", socketInHex)};
log::Param("socket", socketInHex.str())};
m_log(LOG_DEBUG, "ZMQReactor registering a new handler", params);
checkDoubleRegistration(item);
......
......@@ -48,13 +48,13 @@ namespace SCSI {
w << ": " << sense->getSenseKeyString();
} catch (Exception &ex) {
w << ": In addition, failed to get Sense Key string: "
<< ex.getMessage();
<< ex.getMessage().str();
}
try {
w << ": " << sense->getACSString();
} catch (Exception &ex) {
w << ": In addition, failed to get ACS string: "
<< ex.getMessage();
<< ex.getMessage().str();
}
}
setWhat(w.str());
......
......@@ -215,7 +215,7 @@ const castor::tape::tapeserver::daemon::CatalogueDrive
if(NULL == itor->second) {
// Should never get here
castor::exception::Exception ex;
ex.getMessage() << "Failed to " << task <<
ex.getMessage() << "Failed to " << task.str() <<
": Pointer to drive entry is unexpectedly NULL";
throw ex;
}
......@@ -227,7 +227,7 @@ const castor::tape::tapeserver::daemon::CatalogueDrive
if(unitName != driveConfig.getUnitName()) {
// Should never get here
castor::exception::Exception ex;
ex.getMessage() << "Failed to " << task <<
ex.getMessage() << "Failed to " << task.str() <<
": Found inconsistent entry in tape-drive catalogue"
": Unit name mismatch: actual=" << driveConfig.getUnitName();
throw ex;
......@@ -255,7 +255,7 @@ castor::tape::tapeserver::daemon::CatalogueDrive
if(NULL == itor->second) {
// Should never get here
castor::exception::Exception ex;
ex.getMessage() << "Failed to " << task <<
ex.getMessage() << "Failed to " << task.str() <<
": Pointer to drive entry is unexpectedly NULL";
throw ex;
}
......@@ -267,7 +267,7 @@ castor::tape::tapeserver::daemon::CatalogueDrive
if(unitName != driveConfig.getUnitName()) {
// This should never happen
castor::exception::Exception ex;
ex.getMessage() << "Failed to " << task <<
ex.getMessage() << "Failed to " << task.str() <<
": Found inconsistent entry in tape-drive catalogue"
": Unit name mismatch: expected=" << unitName <<
" actual=" << driveConfig.getUnitName();
......
......@@ -121,7 +121,7 @@ bool castor::tape::tapeserver::daemon::CatalogueTransferSession::
idempotentKill(m_pid, SIGKILL);
m_state = WAIT_TIMEOUT_KILL;
} catch(castor::exception::Exception &ex) {
params.push_back(log::Param("message", ex.getMessage()));
params.push_back(log::Param("message", ex.getMessage().str()));
m_log(LOG_ERR, "Failed to kill data-transfer session", params);
}
}
......@@ -173,7 +173,7 @@ bool castor::tape::tapeserver::daemon::CatalogueTransferSession::
idempotentKill(m_pid, SIGKILL);
m_state = WAIT_TIMEOUT_KILL;
} catch(castor::exception::Exception &ex) {
params.push_back(log::Param("message", ex.getMessage()));
params.push_back(log::Param("message", ex.getMessage().str()));
m_log(LOG_ERR, "Failed to kill data-transfer session", params);
}
}
......@@ -206,7 +206,7 @@ bool castor::tape::tapeserver::daemon::CatalogueTransferSession::
idempotentKill(m_pid, SIGKILL);
m_state = WAIT_TIMEOUT_KILL;
} catch(castor::exception::Exception &ex) {
params.push_back(log::Param("message", ex.getMessage()));
params.push_back(log::Param("message", ex.getMessage().str()));
m_log(LOG_ERR, "Failed to kill data-transfer session", params);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment