00001 /*MT* 00002 00003 MediaTomb - http://www.mediatomb.cc/ 00004 00005 server.h - this file is part of MediaTomb. 00006 00007 Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>, 00008 Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc> 00009 00010 Copyright (C) 2006-2010 Gena Batyan <bgeradz@mediatomb.cc>, 00011 Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>, 00012 Leonhard Wimmer <leo@mediatomb.cc> 00013 00014 MediaTomb is free software; you can redistribute it and/or modify 00015 it under the terms of the GNU General Public License version 2 00016 as published by the Free Software Foundation. 00017 00018 MediaTomb is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 version 2 along with MediaTomb; if not, write to the Free Software 00025 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 00026 00027 $Id: server.h 2081 2010-03-23 20:18:00Z lww $ 00028 */ 00029 00032 #ifndef __SERVER_H__ 00033 #define __SERVER_H__ 00034 00035 #include "common.h" 00036 #include "singleton.h" 00037 #include "action_request.h" 00038 #include "subscription_request.h" 00039 #include "upnp_cds.h" 00040 #include "upnp_cm.h" 00041 #include "upnp_mrreg.h" 00042 #include "config_manager.h" 00043 #include "sync.h" 00044 #include "storage.h" 00045 00048 class Server : public Singleton<Server> 00049 { 00050 public: 00051 00052 Server(); 00053 00058 virtual void init(); 00059 00060 00070 void upnp_init(zmm::String interface, zmm::String ip_address, int port); 00071 00076 virtual void shutdown(); 00077 00083 zmm::String getVirtualURL(); 00084 00097 int upnp_callback(Upnp_EventType eventtype, void *event, void *cookie); 00098 00103 UpnpDevice_Handle getDeviceHandle(); 00104 00109 zmm::String getIP(); 00110 00117 zmm::String getPort(); 00118 00119 00124 bool getShutdownStatus(); 00125 00126 static void static_cleanup_callback(); 00127 00128 protected: 00129 static zmm::Ref<Storage> storage; 00130 00132 bool server_shutdown_flag; 00133 00137 UpnpDevice_Handle device_handle; 00138 00143 zmm::String serverUDN; 00144 00151 zmm::String virtual_directory; 00152 00158 zmm::String virtual_url; 00159 00166 zmm::String device_description_document; 00167 00171 int alive_advertisement; 00172 00178 zmm::Ref<ContentDirectoryService> cds; 00179 00185 zmm::Ref<ConnectionManagerService> cmgr; 00186 00187 #if defined(ENABLE_MRREG) 00193 zmm::Ref<MRRegistrarService> mrreg; 00194 #endif 00195 00203 void upnp_actions(zmm::Ref<ActionRequest> request); 00204 00212 void upnp_subscriptions(zmm::Ref<SubscriptionRequest> request); 00213 }; 00214 00215 #endif // __SERVER_H__
1.6.1