blob: 3f199ee3cb1aea442df92d7b68f99dca44f4c95d [file] [log] [blame]
Alison Craig2a4d5282015-04-10 12:00:02 -06001/** NDN-Atmos: Cataloging Service for distributed data originally developed
2 * for atmospheric science data
3 * Copyright (C) 2015 Colorado State University
Chengyu Faneb0422c2015-03-04 16:34:14 -07004 *
Alison Craig2a4d5282015-04-10 12:00:02 -06005 * NDN-Atmos is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
Chengyu Faneb0422c2015-03-04 16:34:14 -07009 *
Alison Craig2a4d5282015-04-10 12:00:02 -060010 * NDN-Atmos is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Chengyu Faneb0422c2015-03-04 16:34:14 -070014 *
Alison Craig2a4d5282015-04-10 12:00:02 -060015 * You should have received a copy of the GNU General Public License
16 * along with NDN-Atmos. If not, see <http://www.gnu.org/licenses/>.
17**/
18
19#include "catalog/catalog.hpp"
20#include "util/mysql-util.hpp"
Chengyu Faneb0422c2015-03-04 16:34:14 -070021
22#include <ChronoSync/socket.hpp>
Chengyu Faneb0422c2015-03-04 16:34:14 -070023
Alison Craig2a4d5282015-04-10 12:00:02 -060024#include <ndn-cxx/data.hpp>
25#include <ndn-cxx/face.hpp>
26#include <ndn-cxx/interest.hpp>
27#include <ndn-cxx/name.hpp>
28#include <ndn-cxx/security/key-chain.hpp>
29
30#include "mysql/mysql.h"
31
32#include <memory>
Chengyu Faneb0422c2015-03-04 16:34:14 -070033
34int main()
35{
Alison Craig2a4d5282015-04-10 12:00:02 -060036 std::shared_ptr<chronosync::Socket> socket; // use ChronoSync
37 std::shared_ptr<ndn::Face> face(new ndn::Face());
38 std::shared_ptr<ndn::KeyChain> keyChain(new ndn::KeyChain());
Chengyu Fan8b92f122015-03-09 22:13:36 -060039
Alison Craig2a4d5282015-04-10 12:00:02 -060040 // This should be unique to each instance
41 ndn::Name aName("/catalog/myUniqueName");
42
43 atmos::util::ConnectionDetails mysqlID("atmos-den.es.net", "testuser", "test623", "testdb");
44 std::shared_ptr<MYSQL> conn;
45 conn = atmos::util::MySQLConnectionSetup(mysqlID);
46
47 atmos::catalog::Catalog<MYSQL> catalog(face, keyChain, conn, aName);
48 face->processEvents();
Chengyu Fan8b92f122015-03-09 22:13:36 -060049
Chengyu Faneb0422c2015-03-04 16:34:14 -070050 return 0;
51}