Alison Craig | 2a4d528 | 2015-04-10 12:00:02 -0600 | [diff] [blame] | 1 | /** NDN-Atmos: Cataloging Service for distributed data originally developed |
| 2 | * for atmospheric science data |
| 3 | * Copyright (C) 2015 Colorado State University |
Chengyu Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 4 | * |
Alison Craig | 2a4d528 | 2015-04-10 12:00:02 -0600 | [diff] [blame] | 5 | * 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 Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 9 | * |
Alison Craig | 2a4d528 | 2015-04-10 12:00:02 -0600 | [diff] [blame] | 10 | * 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 Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 14 | * |
Alison Craig | 2a4d528 | 2015-04-10 12:00:02 -0600 | [diff] [blame] | 15 | * 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 Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 21 | |
| 22 | #include <ChronoSync/socket.hpp> |
Chengyu Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 23 | |
Alison Craig | 2a4d528 | 2015-04-10 12:00:02 -0600 | [diff] [blame] | 24 | #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 Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 33 | |
| 34 | int main() |
| 35 | { |
Alison Craig | 2a4d528 | 2015-04-10 12:00:02 -0600 | [diff] [blame] | 36 | 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 Fan | 8b92f12 | 2015-03-09 22:13:36 -0600 | [diff] [blame] | 39 | |
Alison Craig | 2a4d528 | 2015-04-10 12:00:02 -0600 | [diff] [blame] | 40 | // 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 Fan | 8b92f12 | 2015-03-09 22:13:36 -0600 | [diff] [blame] | 49 | |
Chengyu Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 50 | return 0; |
| 51 | } |