28 if (m_token!=iovToken) {
45 return iEnd->wrapperToken();
62 std::pair<cond::Time_t, cond::Time_t>
71 since=iter->sinceTime();
74 till = iter->sinceTime()-1;
79 return std::pair<cond::Time_t, cond::Time_t>(since,till);
87 std::string payloadtokstr=iov.
iovs().
front().wrapperToken();
88 std::pair<std::string,int> oidData =
parseToken( payloadtokstr );
100 while ( it.
next() ) {
102 std::string tokenStr;
107 for(payloadIt=payloadItBegin;payloadIt!=payloadItEnd;++payloadIt){
108 tokenStr=payloadIt->wrapperToken();
109 m_dbSess.deleteObject( tokenStr );
119 const std::string& iovToken){
126 std::string newPToken = destDB.
importObject( m_dbSess, it->wrapperToken());
127 newiov->add(it->sinceTime(),newPToken);
147 const std::string& iovToken,
148 const std::string& destToken,
161 if( isecondTill!=iov.
iovs().
end() ) isecondTill++;
163 if (ifirstTill==isecondTill)
164 throw cond::Exception(
"IOVServiceImpl::exportIOVRangeWithPayload Error: empty input range");
169 boost::shared_ptr<cond::IOVSequence> newiovref;
171 std::string dToken = destToken;
172 if (dToken.empty()) {
178 if (newiovref->iovs().empty()) ;
179 else if (outOfOrder) {
181 it!=isecondTill; ++it)
182 if (newiovref->exist(it->sinceTime()))
183 throw cond::Exception(
"IOVServiceImpl::exportIOVRangeWithPayload Error: since time already exists");
184 }
else if (since <= newiovref->iovs().
back().sinceTime())
185 throw cond::Exception(
"IOVServiceImpl::exportIOVRangeWithPayload Error: since time out of range, below last since");
191 it!=isecondTill; ++it, lsince=it->sinceTime()){
194 std::string newPtoken = destDB.
importObject( m_dbSess,it->wrapperToken());
195 newiovref->add(lsince, newPtoken);
IOVService(cond::DbSession &dbSess)
cond::Time_t lastTill() const
std::string const & metadataToken() const
std::pair< std::string, int > parseToken(const std::string &objectId)
const_iterator find(cond::Time_t time) const
std::string exportIOVWithPayload(cond::DbSession &destDB, const std::string &iovToken)
boost::shared_ptr< T > get()
cond::Time_t firstSince() const
Container const & iovs() const
IOVEditor * newIOVEditor(const std::string &token="")
void deleteAll(bool withPayload=false)
Container::const_iterator const_iterator
std::string payloadToken(const std::string &iovToken, cond::Time_t currenttime)
unsigned long long Time_t
const T & max(const T &a, const T &b)
Container containerHandle(const std::string &name)
std::pair< cond::Time_t, cond::Time_t > validity(const std::string &iovToken, cond::Time_t currenttime)
bool isValid(const std::string &iovToken, cond::Time_t currenttime)
std::string payloadContainerName(const std::string &iovtoken)
cond::TimeType timeType(const std::string &iovToken)
std::string storeObject(const T *object, const std::string &containerName)
std::string exportIOVRangeWithPayload(cond::DbSession &destDB, const std::string &iovToken, const std::string &destToken, cond::Time_t since, cond::Time_t till, bool outOfOrder)
std::string importObject(cond::DbSession &fromDatabase, const std::string &objectId)
static std::string container()
bool updateObject(const T *object, const std::string &objectId)
cond::IOVSequence const & iovSeq(const std::string &iovToken)
ContainerIterator iterator()
boost::shared_ptr< T > getTypedObject(const std::string &objectId)
cond::TimeType timeType() const