Class PrintingPermission
public class PrintingPermission implements IPermission,
IEncodablePermission
{
// Methods
public void check(Object request) throws SecurityException;
public IPermission combine (IPermission other);
public int compareSet (Object other);
public IPermission copy();
public boolean decode(String tag, InputStream data);
public boolean encode(String tag, OutputStream out);
public String mapFormat(String format);
public String[] supportedFormats();
}
This class represents a permission that controls access to the printing APIs. Security checks for the printing permission are non-parameterized. When the permission-based security model is enabled, classes that possess the PrintingPermission can use the printing services.
This class implements the IPermission and the IEncodablePermission interfaces.
public void check(Object request) throws SecurityException;
Performs a check on the permission object. Because checks for the printing permission are non-parameterized, this method always succeeds.
Return Value:
No return value.
Parameter | Description |
request
| This parameter is ignored.
|
public IPermission combine (IPermission other);
Returns a new PrintingPermission instance. Because checks for the printing permission are non-parameterized, the combine operation serves no purpose.
Return Value:
Returns a new PrintingPermission instance.
Parameter | Description |
other
| This parameter is ignored, but it must be an instance of the PrintingPermission class.
|
public int compareSet (Object other);
Compares the PrintingPermission instance with another permission object.
Return Value:
Returns EQUAL if the other object is an instance of the PrintingPermission class.
Parameter | Description |
other
| The permission object that the PrintingPermission instance is compared with. This parameter must be an instance of the PrintingPermission class.
|
Exceptions:
IllegalArgumentException
if the specified Object is not an instance of the PrintingPermission class.
public IPermission copy();
Retrieves a new instance of the PrintingPermission class.
Return Value:
Returns a new PrintingPermission instance.
public boolean decode(String tag, InputStream data);
Decodes the contents of the specified data stream into the permission object. The tag parameter specifies the type of data in the stream.
Return Value:
Returns true if the decoding operation succeeded; otherwise, returns false.
Parameter | Description |
tag
| The encoding type identifier.
|
data
| The raw data to construct the object from. The type of data is specified by the tag parameter.
|
public boolean encode(String tag, OutputStream out);
Encodes the contents of this permission object and sends the encoded data to the specified stream. The tag parameter specifies the type of encoding that should be used.
Return Value:
Returns true if the encoding operation succeeded; otherwise, returns false.
Parameter | Description |
tag
| The encoding type identifier.
|
out
| The output stream to send the encoded data to.
|
public String mapFormat(String format);
Retrieves a permission-specific tag when given an encoding format. The tag is then used with the encode and decode methods to specify an encoding type.
Return Value:
Returns the permission-specific tag that corresponds to the specified format.
Parameter | Description |
format
| The encoding format to retrieve the tag for.
|
public String[] supportedFormats();
Retrieves the encoding formats that this permission type supports.
Return Value:
Returns an array of the supported format identifiers.