Packages
 In this topic

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.security.permissions   Previous This
Package
Next

 


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.

Methods

check

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.

ParameterDescription
request This parameter is ignored.

combine

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.

ParameterDescription
other This parameter is ignored, but it must be an instance of the PrintingPermission class.

compareSet

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.

ParameterDescription
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.

copy

public IPermission copy();

Retrieves a new instance of the PrintingPermission class.

Return Value:

Returns a new PrintingPermission instance.

decode

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.

ParameterDescription
tag The encoding type identifier.
data The raw data to construct the object from. The type of data is specified by the tag parameter.

encode

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.

ParameterDescription
tag The encoding type identifier.
out The output stream to send the encoded data to.

mapFormat

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.

ParameterDescription
format The encoding format to retrieve the tag for.

supportedFormats

public String[] supportedFormats();

Retrieves the encoding formats that this permission type supports.

Return Value:

Returns an array of the supported format identifiers.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.