summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/Makefile.am4
-rw-r--r--server/src/connection.cc2
-rw-r--r--server/src/environment.cc2
-rw-r--r--server/src/journal.cc (renamed from server/src/journalwriter.cc)24
-rw-r--r--server/src/journal.h (renamed from server/src/journalwriter.h)14
-rw-r--r--server/src/session.cc8
-rw-r--r--server/src/session.h6
-rw-r--r--server/src/sessionserialiser.cc16
-rw-r--r--server/src/transactionhandler.cc2
9 files changed, 39 insertions, 39 deletions
diff --git a/server/src/Makefile.am b/server/src/Makefile.am
index fdfeb42..23fa367 100644
--- a/server/src/Makefile.am
+++ b/server/src/Makefile.am
@@ -25,7 +25,7 @@ pracrod_SOURCES = \
httpd.cc \
inotify.cc \
journal_commit.cc \
- journalwriter.cc \
+ journal.cc \
log.cc \
luaquerymapper.cc \
luaresume.cc \
@@ -105,7 +105,7 @@ EXTRA_DIST = \
httpd.h \
inotify.h \
journal_commit.h \
- journalwriter.h \
+ journal.h \
log.h \
luaquerymapper.h \
luaresume.h \
diff --git a/server/src/connection.cc b/server/src/connection.cc
index 9c69a9b..dec3967 100644
--- a/server/src/connection.cc
+++ b/server/src/connection.cc
@@ -153,7 +153,7 @@ std::string Connection::getSessionID()
}
#ifdef TEST_CONNECTION
-//deps: debug.cc transactionparser.cc session.cc xml_encode_decode.cc saxparser.cc transactionhandler.cc journalwriter.cc mutex.cc templateparser.cc exception.cc configuration.cc macroparser.cc semaphore.cc entitylist.cc luaquerymapper.cc inotify.cc log.cc queryhandlerpentominos.cc widgetgenerator.cc queryhandlerpracro.cc resumeparser.cc journal_commit.cc versionstr.cc luaresume.cc luautil.cc artefact.cc environment.cc database.cc macrolist.cc templatelist.cc pracrodao.cc templateheaderparser.cc macroheaderparser.cc pracrodaotest.cc pracrodaopgsql.cc
+//deps: debug.cc transactionparser.cc session.cc xml_encode_decode.cc saxparser.cc transactionhandler.cc journal.cc mutex.cc templateparser.cc exception.cc configuration.cc macroparser.cc semaphore.cc entitylist.cc luaquerymapper.cc inotify.cc log.cc queryhandlerpentominos.cc widgetgenerator.cc queryhandlerpracro.cc resumeparser.cc journal_commit.cc versionstr.cc luaresume.cc luautil.cc artefact.cc environment.cc database.cc macrolist.cc templatelist.cc pracrodao.cc templateheaderparser.cc macroheaderparser.cc pracrodaotest.cc pracrodaopgsql.cc
//cflags: -DWITHOUT_DATABASE -DWITHOUT_ARTEFACT -I.. $(LUA_CFLAGS) $(EXPAT_CFLAGS) $(PTHREAD_CFLAGS) $(PQXX_CXXFLAGS)
//libs: $(LUA_LIBS) $(EXPAT_LIBS) $(PTHREAD_LIBS) $(PQXX_LIBS)
#include "test.h"
diff --git a/server/src/environment.cc b/server/src/environment.cc
index f1e035e..a2b7cb9 100644
--- a/server/src/environment.cc
+++ b/server/src/environment.cc
@@ -66,7 +66,7 @@ Environment::~Environment()
}
#ifdef TEST_ENVIRONMENT
-//deps: configuration.cc database.cc artefact.cc pracrodao.cc session.cc mutex.cc semaphore.cc debug.cc pracrodaotest.cc pracrodaopgsql.cc journalwriter.cc journal_commit.cc entitylist.cc inotify.cc exception.cc versionstr.cc tcpsocket.cc macrolist.cc templatelist.cc saxparser.cc log.cc macroheaderparser.cc templateheaderparser.cc
+//deps: configuration.cc database.cc artefact.cc pracrodao.cc session.cc mutex.cc semaphore.cc debug.cc pracrodaotest.cc pracrodaopgsql.cc journal.cc journal_commit.cc entitylist.cc inotify.cc exception.cc versionstr.cc tcpsocket.cc macrolist.cc templatelist.cc saxparser.cc log.cc macroheaderparser.cc templateheaderparser.cc
//cflags: -DWITHOUT_ARTEFACT -I.. $(PQXX_CXXFLAGS) $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS)
//libs: $(PQXX_LIBS) -lpthread $(EXPAT_LIBS) $(PTHREAD_LIBS)
#include "test.h"
diff --git a/server/src/journalwriter.cc b/server/src/journal.cc
index 5858de4..f8e0af4 100644
--- a/server/src/journalwriter.cc
+++ b/server/src/journal.cc
@@ -1,9 +1,9 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; coding: utf-8 -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set et sw=2 ts=2: */
/***************************************************************************
- * journalwriter.cc
+ * journal.cc
*
- * Tue Jan 5 15:52:54 CET 2010
+ * Mon Jun 21 12:42:15 CEST 2010
* Copyright 2010 Bent Bisballe Nyeng
* deva@aasimon.org
****************************************************************************/
@@ -25,7 +25,7 @@
* along with Pracro; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#include "journalwriter.h"
+#include "journal.h"
#include "debug.h"
#include "journal_commit.h"
@@ -154,13 +154,13 @@ static std::string addNewlines(const std::string &str, size_t width)
return output;
}
-JournalWriter::JournalWriter(std::string host, unsigned short int port)
+Journal::Journal(std::string host, unsigned short int port)
{
this->host = host;
this->port = port;
}
-void JournalWriter::addEntry(Transaction &transaction, Commit &commit,
+void Journal::addEntry(Transaction &transaction, Commit &commit,
std::string resume, Template *templ)
{
size_t index = 0;
@@ -214,7 +214,7 @@ void JournalWriter::addEntry(Transaction &transaction, Commit &commit,
addEntry(resume, commit.macro, index);
}
-void JournalWriter::addEntry(std::string resume, std::string macro, int index)
+void Journal::addEntry(std::string resume, std::string macro, int index)
{
// Strip trailing whitespace, and add newlines.
std::string r = resume;
@@ -226,7 +226,7 @@ void JournalWriter::addEntry(std::string resume, std::string macro, int index)
entrylist[index] = re;
}
-void JournalWriter::commit()
+void Journal::commit()
{
std::string resume;
@@ -247,7 +247,7 @@ void JournalWriter::commit()
resume.c_str(), resume.size());
}
-std::string JournalWriter::getEntry(std::string macro)
+std::string Journal::getEntry(std::string macro)
{
std::map< int, ResumeEntry >::iterator i = entrylist.begin();
while(i != entrylist.end()) {
@@ -257,7 +257,7 @@ std::string JournalWriter::getEntry(std::string macro)
return "";
}
-void JournalWriter::removeEntry(std::string macro)
+void Journal::removeEntry(std::string macro)
{
std::map< int, ResumeEntry >::iterator i = entrylist.begin();
while(i != entrylist.end()) {
@@ -270,7 +270,7 @@ void JournalWriter::removeEntry(std::string macro)
}
-#ifdef TEST_JOURNALWRITER
+#ifdef TEST_JOURNAL
//deps: debug.cc journal_commit.cc
//cflags: -I..
//libs:
@@ -370,4 +370,4 @@ TEST_EQUAL_STR(stripTrailingWhitepace(addNewlines("", 60)), "", "Test on empty i
TEST_END;
-#endif/*TEST_JOURNALWRITER*/
+#endif/*TEST_JOURNAL*/
diff --git a/server/src/journalwriter.h b/server/src/journal.h
index ea1b514..1ba258d 100644
--- a/server/src/journalwriter.h
+++ b/server/src/journal.h
@@ -1,9 +1,9 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set et sw=2 ts=2: */
/***************************************************************************
- * journalwriter.h
+ * journal.h
*
- * Tue Jan 5 15:52:54 CET 2010
+ * Mon Jun 21 12:42:15 CEST 2010
* Copyright 2010 Bent Bisballe Nyeng
* deva@aasimon.org
****************************************************************************/
@@ -25,8 +25,8 @@
* along with Pracro; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __PRACRO_JOURNALWRITER_H__
-#define __PRACRO_JOURNALWRITER_H__
+#ifndef __PRACRO_JOURNAL_H__
+#define __PRACRO_JOURNAL_H__
#include <string>
#include <map>
@@ -36,10 +36,10 @@
class SessionSerialiser;
-class JournalWriter {
+class Journal {
friend class SessionSerialiser;
public:
- JournalWriter(std::string host, unsigned short int port);
+ Journal(std::string host, unsigned short int port);
void addEntry(Transaction &transaction, Commit &commit,
std::string resume, Template *templ);
@@ -67,4 +67,4 @@ private:
std::map< int, ResumeEntry > entrylist;
};
-#endif/*__PRACRO_JOURNALWRITER_H__*/
+#endif/*__PRACRO_JOURNAL_H__*/
diff --git a/server/src/session.cc b/server/src/session.cc
index e53565b..31be81b 100644
--- a/server/src/session.cc
+++ b/server/src/session.cc
@@ -35,7 +35,7 @@
#include <unistd.h>
#include <errno.h>
-#include "journalwriter.h"
+#include "journal.h"
#include "database.h"
#include "configuration.h"
#include "connectionpool.h"
@@ -96,11 +96,11 @@ void Session::discard()
}
}
-JournalWriter *Session::journal()
+Journal *Session::journal()
{
if(_journal == NULL) {
_journal =
- new JournalWriter(Conf::journal_commit_addr, Conf::journal_commit_port);
+ new Journal(Conf::journal_commit_addr, Conf::journal_commit_port);
}
return _journal;
}
@@ -221,7 +221,7 @@ SessionAutolock::~SessionAutolock()
}
#ifdef TEST_SESSION
-//deps: configuration.cc journalwriter.cc journal_commit.cc mutex.cc debug.cc sessionserialiser.cc sessionparser.cc saxparser.cc
+//deps: configuration.cc journal.cc journal_commit.cc mutex.cc debug.cc sessionserialiser.cc sessionparser.cc saxparser.cc
//cflags: -I.. $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS)
//libs: $(PTHREAD_LIBS) $(EXPAT_LIBS)
#include <test.h>
diff --git a/server/src/session.h b/server/src/session.h
index cd13aa8..0540541 100644
--- a/server/src/session.h
+++ b/server/src/session.h
@@ -34,7 +34,7 @@
#include "mutex.h"
class Database;
-class JournalWriter;
+class Journal;
class Session {
public:
@@ -49,11 +49,11 @@ public:
void commit();
void discard();
- JournalWriter *journal();
+ Journal *journal();
Database *database();
private:
- JournalWriter *_journal;
+ Journal *_journal;
Database *_database;
std::string _id;
Mutex mutex;
diff --git a/server/src/sessionserialiser.cc b/server/src/sessionserialiser.cc
index 2c35d2a..9b5e393 100644
--- a/server/src/sessionserialiser.cc
+++ b/server/src/sessionserialiser.cc
@@ -27,7 +27,7 @@
*/
#include "sessionserialiser.h"
-#include "journalwriter.h"
+#include "journal.h"
#include "sessionparser.h"
#include "database.h"
@@ -66,7 +66,7 @@ void SessionSerialiser::loadStr(const std::string &xml)
SessionParser parser;
parser.parse(xml.data(), xml.length());
- JournalWriter *j = session->journal();
+ Journal *j = session->journal();
j->currentuser = XDEC(parser.userid);
j->currentcpr = XDEC(parser.patientid);
std::vector<SessionParser::Entry>::iterator i = parser.entries.begin();
@@ -88,12 +88,12 @@ std::string SessionSerialiser::saveStr()
xml += "<session timestamp=\""+itostr(time(NULL))+"\" "
"id=\""+session->id()+"\">\n";
- JournalWriter *journal = session->journal();
+ Journal *journal = session->journal();
xml += " <journal patientid=\"" + XENC(journal->currentcpr) +
"\" userid=\"" + XENC(journal->currentuser) + "\">\n";
- std::map< int, JournalWriter::ResumeEntry >::iterator i =
+ std::map< int, Journal::ResumeEntry >::iterator i =
journal->entrylist.begin();
while(i != journal->entrylist.end()) {
@@ -148,7 +148,7 @@ void SessionSerialiser::save()
}
#ifdef TEST_SESSIONSERIALISER
-//deps: session.cc journalwriter.cc debug.cc configuration.cc mutex.cc journal_commit.cc sessionparser.cc saxparser.cc
+//deps: session.cc journal.cc debug.cc configuration.cc mutex.cc journal_commit.cc sessionparser.cc saxparser.cc
//cflags: -I.. $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS)
//libs: $(PTHREAD_LIBS) $(EXPAT_LIBS)
#include "test.h"
@@ -162,7 +162,7 @@ std::string xml;
{
Session session(SID);
- JournalWriter *j = session.journal();
+ Journal *j = session.journal();
j->addEntry("some text", "macro1", 0);
j->addEntry("some more text", "macro2", 2);
j->addEntry("yet some more text", "macro3", 1);
@@ -175,7 +175,7 @@ std::string xml;
{
Session session(SID);
- JournalWriter *j = session.journal();
+ Journal *j = session.journal();
j->addEntry("some text", "macro1", 0);
j->addEntry("some more text", "macro2", 2);
j->addEntry("yet some more text", "macro3", 1);
@@ -193,7 +193,7 @@ std::string xml;
{
Session session(SID);
- JournalWriter *j = session.journal();
+ Journal *j = session.journal();
j->addEntry("some text", "macro1", 0);
j->addEntry("some more text", "macro2", 2);
j->addEntry("yet some more text", "macro3", 1);
diff --git a/server/src/transactionhandler.cc b/server/src/transactionhandler.cc
index 1658713..967b7e9 100644
--- a/server/src/transactionhandler.cc
+++ b/server/src/transactionhandler.cc
@@ -36,7 +36,7 @@
#include "queryhandlerpracro.h"
#include "xml_encode_decode.h"
#include "widgetgenerator.h"
-#include "journalwriter.h"
+#include "journal.h"
static std::string error_box(std::string message)
{