changeset 810:401a9633e492

configuration into a namespace
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 May 2014 16:47:56 +0200
parents 8ce2f69436ca
children 78b9f64b6b7b
files OrthancServer/DicomProtocol/DicomServer.cpp OrthancServer/OrthancFindRequestHandler.cpp OrthancServer/OrthancInitialization.cpp OrthancServer/OrthancInitialization.h OrthancServer/OrthancMoveRequestHandler.cpp OrthancServer/OrthancRestApi/OrthancRestModalities.cpp OrthancServer/OrthancRestApi/OrthancRestSystem.cpp OrthancServer/ServerContext.cpp OrthancServer/ServerIndex.cpp OrthancServer/main.cpp UnitTestsSources/UnitTestsMain.cpp
diffstat 11 files changed, 111 insertions(+), 108 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/DicomProtocol/DicomServer.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/DicomProtocol/DicomServer.cpp	Wed May 07 16:47:56 2014 +0200
@@ -414,7 +414,7 @@
       return true;
     }
 
-    return Orthanc::IsSameAETitle(aet, GetApplicationEntityTitle());
+    return Configuration::IsSameAETitle(aet, GetApplicationEntityTitle());
   }
 
 }
--- a/OrthancServer/OrthancFindRequestHandler.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/OrthancFindRequestHandler.cpp	Wed May 07 16:47:56 2014 +0200
@@ -453,7 +453,7 @@
     {
       RemoteModalityParameters modality;
 
-      if (!LookupDicomModalityUsingAETitle(modality, callingAETitle))
+      if (!Configuration::LookupDicomModalityUsingAETitle(modality, callingAETitle))
       {
         throw OrthancException("Unknown modality");
       }
--- a/OrthancServer/OrthancInitialization.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/OrthancInitialization.cpp	Wed May 07 16:47:56 2014 +0200
@@ -194,8 +194,8 @@
 
 
 
-  std::string GetGlobalStringParameter(const std::string& parameter,
-                                       const std::string& defaultValue)
+  std::string Configuration::GetGlobalStringParameter(const std::string& parameter,
+                                                      const std::string& defaultValue)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -210,8 +210,8 @@
   }
 
 
-  int GetGlobalIntegerParameter(const std::string& parameter,
-                                int defaultValue)
+  int Configuration::GetGlobalIntegerParameter(const std::string& parameter,
+                                               int defaultValue)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -225,8 +225,9 @@
     }
   }
 
-  bool GetGlobalBoolParameter(const std::string& parameter,
-                              bool defaultValue)
+
+  bool Configuration::GetGlobalBoolParameter(const std::string& parameter,
+                                             bool defaultValue)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -241,10 +242,8 @@
   }
 
 
-
-
-  void GetDicomModalityUsingSymbolicName(RemoteModalityParameters& modality,
-                                         const std::string& name)
+  void Configuration::GetDicomModalityUsingSymbolicName(RemoteModalityParameters& modality,
+                                                        const std::string& name)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -274,8 +273,8 @@
 
 
 
-  void GetOrthancPeer(OrthancPeerParameters& peer,
-                      const std::string& name)
+  void Configuration::GetOrthancPeer(OrthancPeerParameters& peer,
+                                     const std::string& name)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -344,7 +343,7 @@
   }
 
 
-  void GetListOfDicomModalities(std::set<std::string>& target)
+  void Configuration::GetListOfDicomModalities(std::set<std::string>& target)
   {
     if (!ReadKeys(target, "DicomModalities", true))
     {
@@ -353,7 +352,7 @@
   }
 
 
-  void GetListOfOrthancPeers(std::set<std::string>& target)
+  void Configuration::GetListOfOrthancPeers(std::set<std::string>& target)
   {
     if (!ReadKeys(target, "OrthancPeers", true))
     {
@@ -363,7 +362,7 @@
 
 
 
-  void SetupRegisteredUsers(MongooseServer& httpServer)
+  void Configuration::SetupRegisteredUsers(MongooseServer& httpServer)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -390,8 +389,8 @@
   }
 
 
-  std::string InterpretRelativePath(const std::string& baseDirectory,
-                                    const std::string& relativePath)
+  std::string Configuration::InterpretRelativePath(const std::string& baseDirectory,
+                                                   const std::string& relativePath)
   {
     boost::filesystem::path base(baseDirectory);
     boost::filesystem::path relative(relativePath);
@@ -416,15 +415,15 @@
     }
   }
 
-  std::string InterpretStringParameterAsPath(const std::string& parameter)
+  std::string Configuration::InterpretStringParameterAsPath(const std::string& parameter)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
     return InterpretRelativePath(defaultDirectory_.string(), parameter);
   }
 
 
-  void GetGlobalListOfStringsParameter(std::list<std::string>& target,
-                                       const std::string& key)
+  void Configuration::GetGlobalListOfStringsParameter(std::list<std::string>& target,
+                                                      const std::string& key)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -449,8 +448,8 @@
   }
 
 
-  bool IsSameAETitle(const std::string& aet1,
-                     const std::string& aet2)
+  bool Configuration::IsSameAETitle(const std::string& aet1,
+                                    const std::string& aet2)
   {
     if (GetGlobalBoolParameter("StrictAetComparison", false))
     {
@@ -468,8 +467,8 @@
   }
 
 
-  bool LookupDicomModalityUsingAETitle(RemoteModalityParameters& modality,
-                                       const std::string& aet)
+  bool Configuration::LookupDicomModalityUsingAETitle(RemoteModalityParameters& modality,
+                                                      const std::string& aet)
   {
     std::set<std::string> modalities;
     GetListOfDicomModalities(modalities);
@@ -495,14 +494,14 @@
   }
 
 
-  bool IsKnownAETitle(const std::string& aet)
+  bool Configuration::IsKnownAETitle(const std::string& aet)
   {
     RemoteModalityParameters modality;
     return LookupDicomModalityUsingAETitle(modality, aet);
   }
 
 
-  RemoteModalityParameters GetModalityUsingSymbolicName(const std::string& name)
+  RemoteModalityParameters Configuration::GetModalityUsingSymbolicName(const std::string& name)
   {
     RemoteModalityParameters modality;
     GetDicomModalityUsingSymbolicName(modality, name);
@@ -511,7 +510,7 @@
   }
 
 
-  RemoteModalityParameters GetModalityUsingAet(const std::string& aet)
+  RemoteModalityParameters Configuration::GetModalityUsingAet(const std::string& aet)
   {
     RemoteModalityParameters modality;
 
@@ -526,7 +525,7 @@
   }
 
 
-  void UpdateModality(const RemoteModalityParameters& modality)
+  void Configuration::UpdateModality(const RemoteModalityParameters& modality)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -549,7 +548,7 @@
   }
   
 
-  void RemoveModality(const std::string& symbolicName)
+  void Configuration::RemoveModality(const std::string& symbolicName)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -568,7 +567,7 @@
   }
 
 
-  void UpdatePeer(const OrthancPeerParameters& peer)
+  void Configuration::UpdatePeer(const OrthancPeerParameters& peer)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
@@ -591,7 +590,7 @@
   }
   
 
-  void RemovePeer(const std::string& symbolicName)
+  void Configuration::RemovePeer(const std::string& symbolicName)
   {
     boost::mutex::scoped_lock lock(globalMutex_);
 
--- a/OrthancServer/OrthancInitialization.h	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/OrthancInitialization.h	Wed May 07 16:47:56 2014 +0200
@@ -47,52 +47,56 @@
 
   void OrthancFinalize();
 
-  std::string GetGlobalStringParameter(const std::string& parameter,
-                                       const std::string& defaultValue);
-
-  int GetGlobalIntegerParameter(const std::string& parameter,
-                                int defaultValue);
+  class Configuration
+  {
+  public:
+    static std::string GetGlobalStringParameter(const std::string& parameter,
+                                                const std::string& defaultValue);
 
-  bool GetGlobalBoolParameter(const std::string& parameter,
-                              bool defaultValue);
+    static int GetGlobalIntegerParameter(const std::string& parameter,
+                                         int defaultValue);
 
-  void GetDicomModalityUsingSymbolicName(RemoteModalityParameters& modality,
-                                         const std::string& name);
+    static bool GetGlobalBoolParameter(const std::string& parameter,
+                                       bool defaultValue);
 
-  bool LookupDicomModalityUsingAETitle(RemoteModalityParameters& modality,
-                                       const std::string& aet);
+    static void GetDicomModalityUsingSymbolicName(RemoteModalityParameters& modality,
+                                                  const std::string& name);
 
-  void GetOrthancPeer(OrthancPeerParameters& peer,
-                      const std::string& name);
+    static bool LookupDicomModalityUsingAETitle(RemoteModalityParameters& modality,
+                                                const std::string& aet);
 
-  void GetListOfDicomModalities(std::set<std::string>& target);
+    static void GetOrthancPeer(OrthancPeerParameters& peer,
+                               const std::string& name);
 
-  void GetListOfOrthancPeers(std::set<std::string>& target);
+    static void GetListOfDicomModalities(std::set<std::string>& target);
 
-  void SetupRegisteredUsers(MongooseServer& httpServer);
+    static void GetListOfOrthancPeers(std::set<std::string>& target);
+
+    static void SetupRegisteredUsers(MongooseServer& httpServer);
 
-  std::string InterpretRelativePath(const std::string& baseDirectory,
-                                    const std::string& relativePath);
+    static std::string InterpretRelativePath(const std::string& baseDirectory,
+                                             const std::string& relativePath);
 
-  std::string InterpretStringParameterAsPath(const std::string& parameter);
+    static std::string InterpretStringParameterAsPath(const std::string& parameter);
 
-  void GetGlobalListOfStringsParameter(std::list<std::string>& target,
-                                       const std::string& key);
+    static void GetGlobalListOfStringsParameter(std::list<std::string>& target,
+                                                const std::string& key);
 
-  bool IsKnownAETitle(const std::string& aet);
+    static bool IsKnownAETitle(const std::string& aet);
 
-  bool IsSameAETitle(const std::string& aet1,
-                     const std::string& aet2);
+    static bool IsSameAETitle(const std::string& aet1,
+                              const std::string& aet2);
 
-  RemoteModalityParameters GetModalityUsingSymbolicName(const std::string& name);
+    static RemoteModalityParameters GetModalityUsingSymbolicName(const std::string& name);
 
-  RemoteModalityParameters GetModalityUsingAet(const std::string& aet);
+    static RemoteModalityParameters GetModalityUsingAet(const std::string& aet);
 
-  void UpdateModality(const RemoteModalityParameters& modality);
+    static void UpdateModality(const RemoteModalityParameters& modality);
 
-  void RemoveModality(const std::string& symbolicName);
+    static void RemoveModality(const std::string& symbolicName);
+
+    static void UpdatePeer(const OrthancPeerParameters& peer);
 
-  void UpdatePeer(const OrthancPeerParameters& peer);
-
-  void RemovePeer(const std::string& symbolicName);
+    static void RemovePeer(const std::string& symbolicName);
+  };
 }
--- a/OrthancServer/OrthancMoveRequestHandler.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/OrthancMoveRequestHandler.cpp	Wed May 07 16:47:56 2014 +0200
@@ -67,7 +67,7 @@
           instances_.push_back(*it);
         }
 
-        remote_ = GetModalityUsingAet(aet);
+        remote_ = Configuration::GetModalityUsingAet(aet);
       }
 
       virtual unsigned int GetSubOperationCount() const
--- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Wed May 07 16:47:56 2014 +0200
@@ -75,7 +75,7 @@
       return;
     }
 
-    RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
+    RemoteModalityParameters remote = Configuration::GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
     ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote);
 
     DicomFindAnswers answers;
@@ -103,7 +103,7 @@
       return;
     }        
       
-    RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
+    RemoteModalityParameters remote = Configuration::GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
     ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote);
 
     DicomFindAnswers answers;
@@ -132,7 +132,7 @@
       return;
     }        
          
-    RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
+    RemoteModalityParameters remote = Configuration::GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
     ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote);
 
     DicomFindAnswers answers;
@@ -162,7 +162,7 @@
       return;
     }        
          
-    RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
+    RemoteModalityParameters remote = Configuration::GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
     ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote);
 
     DicomFindAnswers answers;
@@ -184,7 +184,7 @@
       return;
     }
  
-    RemoteModalityParameters remote = GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
+    RemoteModalityParameters remote = Configuration::GetModalityUsingSymbolicName(call.GetUriComponent("id", ""));
     ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), remote);
 
     DicomFindAnswers patients;
@@ -319,7 +319,7 @@
       return;
     }
 
-    RemoteModalityParameters p = GetModalityUsingSymbolicName(remote);
+    RemoteModalityParameters p = Configuration::GetModalityUsingSymbolicName(remote);
     ReusableDicomUserConnection::Locker locker(context.GetReusableDicomUserConnection(), p);
 
     for (std::list<std::string>::const_iterator 
@@ -347,7 +347,7 @@
   static void ListPeers(RestApi::GetCall& call)
   {
     OrthancRestApi::SetOfStrings peers;
-    GetListOfOrthancPeers(peers);
+    Configuration::GetListOfOrthancPeers(peers);
 
     Json::Value result = Json::arrayValue;
     for (OrthancRestApi::SetOfStrings::const_iterator 
@@ -362,7 +362,7 @@
   static void ListPeerOperations(RestApi::GetCall& call)
   {
     OrthancRestApi::SetOfStrings peers;
-    GetListOfOrthancPeers(peers);
+    Configuration::GetListOfOrthancPeers(peers);
 
     std::string id = call.GetUriComponent("id", "");
     if (IsExistingPeer(peers, id))
@@ -386,7 +386,7 @@
     }
 
     OrthancPeerParameters peer;
-    GetOrthancPeer(peer, remote);
+    Configuration::GetOrthancPeer(peer, remote);
 
     // Configure the HTTP client
     HttpClient client;
@@ -431,7 +431,7 @@
   static void ListModalities(RestApi::GetCall& call)
   {
     OrthancRestApi::SetOfStrings modalities;
-    GetListOfDicomModalities(modalities);
+    Configuration::GetListOfDicomModalities(modalities);
 
     Json::Value result = Json::arrayValue;
     for (OrthancRestApi::SetOfStrings::const_iterator 
@@ -447,7 +447,7 @@
   static void ListModalityOperations(RestApi::GetCall& call)
   {
     OrthancRestApi::SetOfStrings modalities;
-    GetListOfDicomModalities(modalities);
+    Configuration::GetListOfDicomModalities(modalities);
 
     std::string id = call.GetUriComponent("id", "");
     if (IsExistingModality(modalities, id))
@@ -473,14 +473,14 @@
       RemoteModalityParameters modality;
       modality.FromJson(json);
       modality.SetName(call.GetUriComponent("id", ""));
-      UpdateModality(modality);
+      Configuration::UpdateModality(modality);
     }
   }
 
 
   static void DeleteModality(RestApi::DeleteCall& call)
   {
-    RemoveModality(call.GetUriComponent("id", ""));
+    Configuration::RemoveModality(call.GetUriComponent("id", ""));
   }
 
 
@@ -493,14 +493,14 @@
       OrthancPeerParameters peer;
       peer.FromJson(json);
       peer.SetName(call.GetUriComponent("id", ""));
-      UpdatePeer(peer);
+      Configuration::UpdatePeer(peer);
     }
   }
 
 
   static void DeletePeer(RestApi::DeleteCall& call)
   {
-    RemovePeer(call.GetUriComponent("id", ""));
+    Configuration::RemovePeer(call.GetUriComponent("id", ""));
   }
 
 
--- a/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Wed May 07 16:47:56 2014 +0200
@@ -52,7 +52,7 @@
     Json::Value result = Json::objectValue;
 
     result["Version"] = ORTHANC_VERSION;
-    result["Name"] = GetGlobalStringParameter("Name", "");
+    result["Name"] = Configuration::GetGlobalStringParameter("Name", "");
 
     call.GetOutput().AnswerJson(result);
   }
--- a/OrthancServer/ServerContext.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/ServerContext.cpp	Wed May 07 16:47:56 2014 +0200
@@ -68,7 +68,7 @@
     provider_(*this),
     dicomCache_(provider_, DICOM_CACHE_SIZE)
   {
-    scu_.SetLocalApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "ORTHANC"));
+    scu_.SetLocalApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC"));
     //scu_.SetMillisecondsBeforeClose(1);  // The connection is always released
 
     lua_.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX);
--- a/OrthancServer/ServerIndex.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/ServerIndex.cpp	Wed May 07 16:47:56 2014 +0200
@@ -1497,7 +1497,7 @@
 
   void ServerIndex::UnstableResourcesMonitorThread(ServerIndex* that)
   {
-    int stableAge = GetGlobalIntegerParameter("StableAge", 60);
+    int stableAge = Configuration::GetGlobalIntegerParameter("StableAge", 60);
     if (stableAge <= 0)
     {
       stableAge = 60;
--- a/OrthancServer/main.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/OrthancServer/main.cpp	Wed May 07 16:47:56 2014 +0200
@@ -130,7 +130,7 @@
       return true;
     }
 
-    if (!IsKnownAETitle(callingAet))
+    if (!Configuration::IsKnownAETitle(callingAet))
     {
       LOG(ERROR) << "Unknown remote DICOM modality AET: \"" << callingAet << "\"";
       return false;
@@ -324,24 +324,24 @@
       OrthancInitialize();
     }
 
-    std::string storageDirectoryStr = GetGlobalStringParameter("StorageDirectory", "OrthancStorage");
-    boost::filesystem::path storageDirectory = InterpretStringParameterAsPath(storageDirectoryStr);
-    boost::filesystem::path indexDirectory = 
-      InterpretStringParameterAsPath(GetGlobalStringParameter("IndexDirectory", storageDirectoryStr));
+    std::string storageDirectoryStr = Configuration::GetGlobalStringParameter("StorageDirectory", "OrthancStorage");
+    boost::filesystem::path storageDirectory = Configuration::InterpretStringParameterAsPath(storageDirectoryStr);
+    boost::filesystem::path indexDirectory = Configuration::InterpretStringParameterAsPath(
+        Configuration::GetGlobalStringParameter("IndexDirectory", storageDirectoryStr));
     ServerContext context(storageDirectory, indexDirectory);
 
     LOG(WARNING) << "Storage directory: " << storageDirectory;
     LOG(WARNING) << "Index directory: " << indexDirectory;
 
-    context.SetCompressionEnabled(GetGlobalBoolParameter("StorageCompression", false));
-    context.SetStoreMD5ForAttachments(GetGlobalBoolParameter("StoreMD5ForAttachments", true));
+    context.SetCompressionEnabled(Configuration::GetGlobalBoolParameter("StorageCompression", false));
+    context.SetStoreMD5ForAttachments(Configuration::GetGlobalBoolParameter("StoreMD5ForAttachments", true));
 
     std::list<std::string> luaScripts;
-    GetGlobalListOfStringsParameter(luaScripts, "LuaScripts");
+    Configuration::GetGlobalListOfStringsParameter(luaScripts, "LuaScripts");
     for (std::list<std::string>::const_iterator
            it = luaScripts.begin(); it != luaScripts.end(); ++it)
     {
-      std::string path = InterpretStringParameterAsPath(*it);
+      std::string path = Configuration::InterpretStringParameterAsPath(*it);
       LOG(WARNING) << "Installing the Lua scripts from: " << path;
       std::string script;
       Toolbox::ReadFile(script, path);
@@ -351,7 +351,7 @@
 
     try
     {
-      context.GetIndex().SetMaximumPatientCount(GetGlobalIntegerParameter("MaximumPatientCount", 0));
+      context.GetIndex().SetMaximumPatientCount(Configuration::GetGlobalIntegerParameter("MaximumPatientCount", 0));
     }
     catch (...)
     {
@@ -360,7 +360,7 @@
 
     try
     {
-      uint64_t size = GetGlobalIntegerParameter("MaximumStorageSize", 0);
+      uint64_t size = Configuration::GetGlobalIntegerParameter("MaximumStorageSize", 0);
       context.GetIndex().SetMaximumStorageSize(size * 1024 * 1024);
     }
     catch (...)
@@ -374,28 +374,28 @@
       // DICOM server
       DicomServer dicomServer;
       OrthancApplicationEntityFilter dicomFilter;
-      dicomServer.SetCalledApplicationEntityTitleCheck(GetGlobalBoolParameter("DicomCheckCalledAet", false));
+      dicomServer.SetCalledApplicationEntityTitleCheck(Configuration::GetGlobalBoolParameter("DicomCheckCalledAet", false));
       dicomServer.SetStoreRequestHandlerFactory(serverFactory);
       dicomServer.SetMoveRequestHandlerFactory(serverFactory);
       dicomServer.SetFindRequestHandlerFactory(serverFactory);
-      dicomServer.SetPortNumber(GetGlobalIntegerParameter("DicomPort", 4242));
-      dicomServer.SetApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "ORTHANC"));
+      dicomServer.SetPortNumber(Configuration::GetGlobalIntegerParameter("DicomPort", 4242));
+      dicomServer.SetApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC"));
       dicomServer.SetApplicationEntityFilter(dicomFilter);
 
       // HTTP server
       MyIncomingHttpRequestFilter httpFilter(context);
       MongooseServer httpServer;
-      httpServer.SetPortNumber(GetGlobalIntegerParameter("HttpPort", 8042));
-      httpServer.SetRemoteAccessAllowed(GetGlobalBoolParameter("RemoteAccessAllowed", false));
+      httpServer.SetPortNumber(Configuration::GetGlobalIntegerParameter("HttpPort", 8042));
+      httpServer.SetRemoteAccessAllowed(Configuration::GetGlobalBoolParameter("RemoteAccessAllowed", false));
       httpServer.SetIncomingHttpRequestFilter(httpFilter);
 
-      httpServer.SetAuthenticationEnabled(GetGlobalBoolParameter("AuthenticationEnabled", false));
-      SetupRegisteredUsers(httpServer);
+      httpServer.SetAuthenticationEnabled(Configuration::GetGlobalBoolParameter("AuthenticationEnabled", false));
+      Configuration::SetupRegisteredUsers(httpServer);
 
-      if (GetGlobalBoolParameter("SslEnabled", false))
+      if (Configuration::GetGlobalBoolParameter("SslEnabled", false))
       {
-        std::string certificate = 
-          InterpretStringParameterAsPath(GetGlobalStringParameter("SslCertificate", "certificate.pem"));
+        std::string certificate = Configuration::InterpretStringParameterAsPath(
+          Configuration::GetGlobalStringParameter("SslCertificate", "certificate.pem"));
         httpServer.SetSslEnabled(true);
         httpServer.SetSslCertificate(certificate.c_str());
       }
@@ -413,7 +413,7 @@
       httpServer.RegisterHandler(new OrthancRestApi(context));
 
       // GO !!! Start the requested servers
-      if (GetGlobalBoolParameter("HttpServerEnabled", true))
+      if (Configuration::GetGlobalBoolParameter("HttpServerEnabled", true))
       {
         httpServer.Start();
         LOG(WARNING) << "HTTP server listening on port: " << httpServer.GetPortNumber();
@@ -423,7 +423,7 @@
         LOG(WARNING) << "The HTTP server is disabled";
       }
 
-      if (GetGlobalBoolParameter("DicomServerEnabled", true))
+      if (Configuration::GetGlobalBoolParameter("DicomServerEnabled", true))
       {
         dicomServer.Start();
         LOG(WARNING) << "DICOM server listening on port: " << dicomServer.GetPortNumber();
--- a/UnitTestsSources/UnitTestsMain.cpp	Wed May 07 16:39:53 2014 +0200
+++ b/UnitTestsSources/UnitTestsMain.cpp	Wed May 07 16:47:56 2014 +0200
@@ -424,8 +424,8 @@
 #if defined(__linux)
 TEST(OrthancInitialization, AbsoluteDirectory)
 {
-  ASSERT_EQ("/tmp/hello", InterpretRelativePath("/tmp", "hello"));
-  ASSERT_EQ("/tmp", InterpretRelativePath("/tmp", "/tmp"));
+  ASSERT_EQ("/tmp/hello", Configuration::InterpretRelativePath("/tmp", "hello"));
+  ASSERT_EQ("/tmp", Configuration::InterpretRelativePath("/tmp", "/tmp"));
 }
 #endif