00001 #include "Sct/ISProxy/ISProxy.h"
00002 #include "Sct/ISProxy/IOManagerISProxy.h"
00003 #include <iostream>
00004 #include <string>
00005
00014 using namespace Sct;
00015 using namespace Sct::IS;
00016 using namespace Sct::ISProxy;
00017 using namespace std;
00018
00019 int printHelp() {
00020 cout << "Usage: ProxyPublish <IS server> <class name> <uniqueID>" << endl;
00021 cout << "ProxyPublish puts an ISProxy into IS given appropriate information" << endl;
00022 cout << "This is useful if you still have the data transfer files, but the IS server has been restarted" << endl;
00023 cout << "The arguments should be obvious from the usage" << endl;
00024 return 0;
00025 }
00026
00027 void publishProxy(string isServer, string className, string uniqueID) {
00028 IOParamsIS params(isServer);
00029 Sct::ISProxy::ISProxy proxy(uniqueID, className);
00030 IOManagerISProxy::instance().write(proxy, ¶ms);
00031 }
00032
00033
00034 int main(int argc, char** argv) {
00035 if (argc != 4) return printHelp();
00036 try {
00037 publishProxy(argv[1], argv[2], argv[3]);
00038 } catch (Throwable& t) {
00039 cout << t.what() << endl;
00040 return 1;
00041 }
00042 return 0;
00043 }