00001 /* 00002 * FADE - Secure Overlay Cloud Storage with File Assured Deletion 00003 * Copyright (C) 2010 Yang Tang 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00026 #ifndef FADE_EPHEMERIZER_H 00027 #define FADE_EPHEMERIZER_H 00028 00029 #include "PolicyForEphemerizer.h" 00030 00034 class Ephemerizer 00035 { 00036 int sockfd; 00037 bool use_cpabe; 00038 Ephemerizer() 00039 : use_cpabe(false) 00040 { 00041 } 00042 ~Ephemerizer() {} 00043 void closeSocket() const; 00044 public: 00049 static Ephemerizer *instance(); 00050 00055 bool getUseCpabe() const 00056 { 00057 return this->use_cpabe; 00058 } 00059 00064 void setUseCpabe(bool use_cpabe) 00065 { 00066 this->use_cpabe = use_cpabe; 00067 } 00068 00072 void initSocket(int port); 00073 00077 void run() const; 00078 }; 00079 00080 #endif /* FADE_EPHEMERIZER_H */