1 module hunt.security.Provider;
2 
3 
4 import std.conv;
5 
6 abstract class Provider
7 {
8 
9     /**
10     * The provider name.
11     *
12     * @serial
13     */
14     private string name;
15 
16     /**
17     * A description of the provider and its services.
18     *
19     * @serial
20     */
21     private string info;
22 
23     /**
24     * The provider version number.
25     *
26     * @serial
27     */
28     private double _version;
29 
30 
31     private bool initialized;
32 
33     /**
34     * Constructs a provider with the specified name, version number,
35     * and information.
36     *
37     * @param name the provider name.
38     *
39     * @param version the provider version number.
40     *
41     * @param info a description of the provider and its services.
42     */
43     protected this(string name, double ver, string info) {
44         this.name = name;
45         this._version = ver;
46         this.info = info;
47         // putId();
48         initialized = true;
49     }
50 
51     /**
52     * Returns the name of this provider.
53     *
54     * @return the name of this provider.
55     */
56     string getName() {
57         return name;
58     }
59 
60     /**
61     * Returns the version number for this provider.
62     *
63     * @return the version number for this provider.
64     */
65     double getVersion() {
66         return _version;
67     }
68 
69     /**
70     * Returns a human-readable description of the provider and its
71     * services.  This may return an HTML page, with relevant links.
72     *
73     * @return a description of the provider and its services.
74     */
75     string getInfo() {
76         return info;
77     }
78 
79     /**
80     * Returns a string with the name and the version number
81     * of this provider.
82     *
83     * @return the string with the name and the version number
84     * for this provider.
85     */
86     override
87     string toString() {
88         return name ~ " version " ~ _version.to!string();
89     }
90 }