001 /*
002 * Copyright 1999-2002 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package javax.sound.sampled;
027
028 import java.security.BasicPermission;
029
030 /**
031 * The <code>AudioPermission</code> class represents access rights to the audio
032 * system resources. An <code>AudioPermission</code> contains a target name
033 * but no actions list; you either have the named permission or you don't.
034 * <p>
035 * The target name is the name of the audio permission (see the table below).
036 * The names follow the hierarchical property-naming convention. Also, an asterisk
037 * can be used to represent all the audio permissions.
038 * <p>
039 * The following table lists the possible <code>AudioPermission</code> target names.
040 * For each name, the table provides a description of exactly what that permission
041 * allows, as well as a discussion of the risks of granting code the permission.
042 * <p>
043 *
044 * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks">
045 * <tr>
046 * <th>Permission Target Name</th>
047 * <th>What the Permission Allows</th>
048 * <th>Risks of Allowing this Permission</th>
049 * </tr>
050 *
051 * <tr>
052 * <td>play</td>
053 * <td>Audio playback through the audio device or devices on the system.
054 * Allows the application to obtain and manipulate lines and mixers for
055 * audio playback (rendering).</td>
056 * <td>In some cases use of this permission may affect other
057 * applications because the audio from one line may be mixed with other audio
058 * being played on the system, or because manipulation of a mixer affects the
059 * audio for all lines using that mixer.</td>
060 *</tr>
061 *
062 * <tr>
063 * <td>record</td>
064 * <td>Audio recording through the audio device or devices on the system.
065 * Allows the application to obtain and manipulate lines and mixers for
066 * audio recording (capture).</td>
067 * <td>In some cases use of this permission may affect other
068 * applications because manipulation of a mixer affects the audio for all lines
069 * using that mixer.
070 * This permission can enable an applet or application to eavesdrop on a user.</td>
071 *</tr>
072 *</table>
073 *<p>
074 *
075 * @author Kara Kytle
076 * @version 1.25 07/05/05
077 * @since 1.3
078 */
079 /*
080 * (OLD PERMISSIONS TAKEN OUT FOR 1.2 BETA)
081 *
082 * <tr>
083 * <td>playback device access</td>
084 * <td>Direct access to the audio playback device(s), including configuration of the
085 * playback format, volume, and balance, explicit opening and closing of the device,
086 * etc.</td>
087 * <td>Changes the properties of a shared system device and therefore
088 * can affect other applications.</td>
089 * </tr>
090 *
091 * <tr>
092 * <td>playback device override</td>
093 * <td>Manipulation of the audio playback device(s) in a way that directly conflicts
094 * with use by other applications. This includes closing the device while it is in
095 * use by another application, changing the device format while another application
096 * is using it, etc. </td>
097 * <td>Changes the properties of a shared system device and therefore
098 * can affect other applications.</td>
099 * </tr>
100 *
101 * <tr>
102 * <td>record device access</td>
103 * <td>Direct access to the audio recording device(s), including configuration of the
104 * the record format, volume, and balance, explicit opening and closing of the device,
105 * etc.</td>
106 * <td>Changes the properties of a shared system device and therefore
107 * can affect other applications.</td>
108 * </tr>
109 *
110 * <tr>
111 * <td>record device override</td>
112 * <td>Manipulation of the audio recording device(s) in a way that directly conflicts
113 * with use by other applications. This includes closing the device while it is in
114 * use by another application, changing the device format while another application
115 * is using it, etc. </td>
116 * <td>Changes the properties of a shared system device and therefore
117 * can affect other applications.</td>
118 * </tr>
119 *
120 * </table>
121 *<p>
122 *
123 * @author Kara Kytle
124 * @version 1.25 07/05/05
125 * @since 1.3
126 */
127
128 /*
129 * The <code>AudioPermission</code> class represents access rights to the audio
130 * system resources. An <code>AudioPermission</code> contains a target name
131 * but no actions list; you either have the named permission or you don't.
132 * <p>
133 * The target name is the name of the audio permission (see the table below).
134 * The names follow the hierarchical property-naming convention. Also, an asterisk
135 * can be used to represent all the audio permissions.
136 * <p>
137 * The following table lists all the possible AudioPermission target names.
138 * For each name, the table provides a description of exactly what that permission
139 * allows, as well as a discussion of the risks of granting code the permission.
140 * <p>
141 *
142 * <table border=1 cellpadding=5>
143 * <tr>
144 * <th>Permission Target Name</th>
145 * <th>What the Permission Allows</th>
146 * <th>Risks of Allowing this Permission</th>
147 * </tr>
148 *
149 * <tr>
150 * <td>play</td>
151 * <td>Audio playback through the audio device or devices on the system.</td>
152 * <td>Allows the application to use a system device. Can affect other applications,
153 * because the result will be mixed with other audio being played on the system.</td>
154 *</tr>
155 *
156 * <tr>
157 * <td>record</td>
158 * <td>Recording audio from the audio device or devices on the system,
159 * commonly through a microphone.</td>
160 * <td>Can enable an applet or application to eavesdrop on a user.</td>
161 * </tr>
162 *
163 * <tr>
164 * <td>playback device access</td>
165 * <td>Direct access to the audio playback device(s), including configuration of the
166 * playback format, volume, and balance, explicit opening and closing of the device,
167 * etc.</td>
168 * <td>Changes the properties of a shared system device and therefore
169 * can affect other applications.</td>
170 * </tr>
171 *
172 * <tr>
173 * <td>playback device override</td>
174 * <td>Manipulation of the audio playback device(s) in a way that directly conflicts
175 * with use by other applications. This includes closing the device while it is in
176 * use by another application, changing the device format while another application
177 * is using it, etc. </td>
178 * <td>Changes the properties of a shared system device and therefore
179 * can affect other applications.</td>
180 * </tr>
181 *
182 * <tr>
183 * <td>record device access</td>
184 * <td>Direct access to the audio recording device(s), including configuration of the
185 * the record format, volume, and balance, explicit opening and closing of the device,
186 * etc.</td>
187 * <td>Changes the properties of a shared system device and therefore
188 * can affect other applications.</td>
189 * </tr>
190 *
191 * <tr>
192 * <td>record device override</td>
193 * <td>Manipulation of the audio recording device(s) in a way that directly conflicts
194 * with use by other applications. This includes closing the device while it is in
195 * use by another application, changing the device format while another application
196 * is using it, etc. </td>
197 * <td>Changes the properties of a shared system device and therefore
198 * can affect other applications.</td>
199 * </tr>
200 *
201 * </table>
202 *<p>
203 *
204 * @version 1.25 07/05/05
205 * @author Kara Kytle
206 */
207
208 public class AudioPermission extends BasicPermission {
209
210 /**
211 * Creates a new <code>AudioPermission</code> object that has the specified
212 * symbolic name, such as "play" or "record". An asterisk can be used to indicate
213 * all audio permissions.
214 * @param name the name of the new <code>AudioPermission</code>
215 *
216 * @throws NullPointerException if <code>name</code> is <code>null</code>.
217 * @throws IllegalArgumentException if <code>name</code> is empty.
218 */
219 public AudioPermission(String name) {
220
221 super (name);
222 }
223
224 /**
225 * Creates a new <code>AudioPermission</code> object that has the specified
226 * symbolic name, such as "play" or "record". The <code>actions</code>
227 * parameter is currently unused and should be <code>null</code>.
228 * @param name the name of the new <code>AudioPermission</code>
229 * @param actions (unused; should be <code>null</code>)
230 *
231 * @throws NullPointerException if <code>name</code> is <code>null</code>.
232 * @throws IllegalArgumentException if <code>name</code> is empty.
233 */
234 public AudioPermission(String name, String actions) {
235
236 super(name, actions);
237 }
238 }
|