source: trunk/src/gcc/libjava/java/security/Provider.java@ 141

Last change on this file since 141 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.9 KB
Line 
1/* Provider.java -- Security provider information
2 Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
3
4This file is part of GNU Classpath.
5
6GNU Classpath is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU Classpath is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Classpath; see the file COPYING. If not, write to the
18Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
1902111-1307 USA.
20
21Linking this library statically or dynamically with other modules is
22making a combined work based on this library. Thus, the terms and
23conditions of the GNU General Public License cover the whole
24combination.
25
26As a special exception, the copyright holders of this library give you
27permission to link this library with independent modules to produce an
28executable, regardless of the license terms of these independent
29modules, and to copy and distribute the resulting executable under
30terms of your choice, provided that you also meet, for each linked
31independent module, the terms and conditions of the license of that
32module. An independent module is a module which is not derived from
33or based on this library. If you modify this library, you may extend
34this exception to your version of the library, but you are not
35obligated to do so. If you do not wish to do so, delete this
36exception statement from your version. */
37
38package java.security;
39
40import java.io.Serializable;
41import java.util.Properties;
42
43/**
44 * This class represents a Java security architecture service provider.
45 * The services provided by a such a provider can range from security
46 * algorithms to key generation.
47 * <p>
48 * Providers are installed by name and verion number. There is one
49 * standard provider supplied with the class library. This is the
50 * "GNU" provider, which can also be accessed by the alias "SUN" for
51 * compatibility with the JDK.
52 *
53 * @version 0.0
54 *
55 * @author Aaron M. Renn ([email protected])
56 */
57public abstract class Provider extends Properties implements Serializable
58{
59 /**
60 * This is a textual description of the provider
61 */
62 private String info;
63
64 /**
65 * This is the name of the provider
66 */
67 private String name;
68
69 /**
70 * This is the version number of the provider
71 */
72 private double version;
73
74 /**
75 * This method initializes a new instance of <code>Provider</code> to have
76 * the specified name, version, and description information.
77 *
78 * @param name The name to assign to this <code>Provider</code>.
79 * @param version The version number for this <code>Provider</code>.
80 * @param info A textual description of this provider.
81 */
82 protected Provider(String name, double version, String info)
83 {
84 this.name = name;
85 this.version = version;
86 this.info = info;
87 }
88
89 /**
90 * This method returns the name assigned to this <code>Provider</code>.
91 *
92 * @return The <code>Provider</code>'s name.
93 */
94 public String getName()
95 {
96 return (name);
97 }
98
99 /**
100 * This method retunrs the version number of this <code>Provider</code>.
101 *
102 * @return The <code>Provider</code>'s version number.
103 */
104 public double getVersion()
105 {
106 return (version);
107 }
108
109 /**
110 * This method returns a textual description of the <code>Provider</code>.
111 *
112 * @return A description of the <code>Provider</code>.
113 */
114 public String getInfo()
115 {
116 return (info);
117 }
118
119 /**
120 * This method sets the specified key to have the specified value.
121 *
122 * @param key The property key
123 * @param value The property value
124 *
125 * @return The previous value for this key, or <code>null</code> if no previous value.
126 */
127 public Object put(Object key, Object value)
128 {
129 return (super.put(key, value));
130 }
131
132 /**
133 * This method removes the specified key entry (and its associated value)
134 * from the property mapping list.
135 *
136 * @param key The key to remove
137 *
138 * @return The previous value for this key, or <code>null</code> if no previous value.
139 */
140 public Object remove(Object key)
141 {
142 return (super.remove(key));
143 }
144
145 /**
146 * This method clears the entire property list such that it no longer
147 * contains the properties used to look up the services provided by
148 * the <code>Provider</code>.
149 */
150 public void clear()
151 {
152 super.clear();
153 }
154
155 /**
156 * This method returns a <code>String</code> representation of this
157 * object. This will include the <code>Provider</code> name and
158 * version number.
159 *
160 * @return A <code>String</code> representation of this object.
161 */
162 public String toString()
163 {
164 return (getClass().getName() + ": name=" + getName() + " version=" +
165 version);
166 }
167}
Note: See TracBrowser for help on using the repository browser.