libstorage-ng
Loading...
Searching...
No Matches
Nfs.h
1/*
2 * Copyright (c) [2017-2020] SUSE LLC
3 *
4 * All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, contact Novell, Inc.
17 *
18 * To contact Novell about this file by physical or electronic mail, you may
19 * find current contact information at www.novell.com.
20 */
21
22
23#ifndef STORAGE_NFS_H
24#define STORAGE_NFS_H
25
26
27#include "storage/Filesystems/Filesystem.h"
28#include "storage/Devicegraph.h"
29
30
31namespace storage
32{
33
35 {
36 public:
37
38 NfsNotFoundByServerAndPath(const std::string& server, const std::string& path);
39 };
40
41
55 class Nfs : public Filesystem
56 {
57 public:
58
64 static Nfs* create(Devicegraph* devicegraph, const std::string& server, const std::string& path);
65
66 static Nfs* load(Devicegraph* devicegraph, const xmlNode* node);
67
71 const std::string& get_server() const;
72
76 const std::string& get_path() const;
77
81 static std::vector<Nfs*> get_all(Devicegraph* devicegraph);
82
86 static std::vector<const Nfs*> get_all(const Devicegraph* devicegraph);
87
94 static Nfs* find_by_server_and_path(Devicegraph* devicegraph, const std::string& server,
95 const std::string& path);
96
100 static const Nfs* find_by_server_and_path(const Devicegraph* devicegraph,
101 const std::string& server, const std::string& path);
102
103 public:
104
105 class Impl;
106
107 Impl& get_impl();
108 const Impl& get_impl() const;
109
110 virtual Nfs* clone() const override;
111
112 Nfs(Impl* impl);
113
114 };
115
116
122 bool is_nfs(const Device* device);
123
130 Nfs* to_nfs(Device* device);
131
135 const Nfs* to_nfs(const Device* device);
136
137}
138
139#endif
Definition: Devicegraph.h:50
An abstract base class for storage devices.
Definition: Device.h:82
The main container of the libstorage-ng.
Definition: Devicegraph.h:170
Definition: Filesystem.h:41
Class to represent a NFS mount.
Definition: Nfs.h:56
static Nfs * find_by_server_and_path(Devicegraph *devicegraph, const std::string &server, const std::string &path)
Find a Nfs by its server and path.
static std::vector< Nfs * > get_all(Devicegraph *devicegraph)
Get all Nfses.
static const Nfs * find_by_server_and_path(const Devicegraph *devicegraph, const std::string &server, const std::string &path)
Find a Nfs by its server and path.
const std::string & get_server() const
Get the server of the Nfs.
static Nfs * create(Devicegraph *devicegraph, const std::string &server, const std::string &path)
Create a device of type Nfs.
static std::vector< const Nfs * > get_all(const Devicegraph *devicegraph)
Get all Nfses.
const std::string & get_path() const
Get the path of the Nfs.
The storage namespace.
Definition: Actiongraph.h:40
bool is_nfs(const Device *device)
Checks whether device points to a Nfs.
Nfs * to_nfs(Device *device)
Converts pointer to Device to pointer to Nfs.