00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef HPSSBRIDGE_H_
00041 #define HPSSBRIDGE_H_
00042
00043 #include <sys/types.h>
00044 #include <unistd.h>
00045
00046 #include "logger.h"
00047 #include "DBUtils.h"
00048 #include "TapeStatus.h"
00049 #include "TreqsConfig.h"
00050
00051 #define MAX_PATH_LEN 256
00052
00053 namespace treqs {
00054
00056 class HPSSError {
00057 public:
00058 int getErrorcode();
00059 std::string getErrormessage();
00060 void setErrorcode(int e);
00061 void setErrorMessage(std::string s);
00062 private:
00063 int Errorcode;
00064 std::string Errormessage;
00065 };
00066
00068 class HPSSUnknownError: public HPSSError {
00069 };
00071 class HPSSStatError: public HPSSError {
00072 };
00074 class HPSSOpenError: public HPSSError {
00075 };
00076
00078
00081 class HPSSResourceError: public HPSSOpenError{};
00082
00084 class HPSSStageError: public HPSSError {
00085 };
00087 class HPSSCloseError: public HPSSError {
00088 };
00089
00091 class HPSSBridge {
00092 public:
00093 static HPSSBridge * getInstance();
00095
00104
00105 void getFileProperties(std::string n, unsigned long long int *s, int *p,
00106 std::string *t, int *sl) throw (HPSSStatError, HPSSUnknownError,
00107 HPSSError);
00109
00115 int hpss_stage(std::string, unsigned long long int s) throw (HPSSOpenError,
00116 HPSSResourceError, HPSSStageError, HPSSCloseError);
00118
00123 TapeStatus getTapeProperties(std::string t);
00125 std::string getAuth_type() const;
00127 std::string getHpss_home() const;
00129 std::string getImp_user() const;
00131 std::string getKeytab_path() const;
00133 void setAuth_type(std::string auth_type);
00135 void setHpss_home(std::string hpss_home);
00137 void setImp_user(std::string imp_user);
00139 void setKeytab_path(std::string keytab_path);
00140
00141 private:
00143 static HPSSBridge *_instance;
00145 static LoggerPtr logger;
00146
00148 std::string imp_user;
00150 std::string keytab_path;
00152 std::string auth_type;
00154 std::string hpss_home;
00155
00157 void hpss_init();
00162 bool testKeytab();
00163
00164 protected:
00166 HPSSBridge();
00168 ~HPSSBridge();
00169 };
00170
00171 }
00172 #endif