com.adobe.flashaccess.sdk.rights
Class ModuleRequirements

java.lang.Object
  extended by com.adobe.flashaccess.sdk.rights.ModuleRequirements
All Implemented Interfaces:
java.lang.Cloneable

public class ModuleRequirements
extends java.lang.Object
implements java.lang.Cloneable

This class is used to specify requirements related to the DRM or runtime module.

If a minimum security level is specified, the module on the user's machine must have a security level greater than or equal to the level specified. If excluded versions are specified, modules with versions matching those listed are not allowed.


Nested Class Summary
static class ModuleRequirements.ModuleAccess
          Indicates whether a specific module is granted access
 
Constructor Summary
ModuleRequirements()
          Creates a ModuleRequirements object.
 
Method Summary
 java.util.Collection getExcludedVersions()
          Retrieves a list of version information specifying versions that are not permitted.
 int getMinSecurityLevel()
          Retrieves the minimum security level.
 ModuleRequirements.ModuleAccess isModuleAllowed(ModuleInfo module)
          Checks if the specified module is allowed access (minimum security level requirements are met and version is not on the excluded version list).
 ModuleRequirements.ModuleAccess isVersionAllowed(VersionInfo version)
          Checks if the specified version is on the excluded version list.
 void setExcludedVersions(java.util.Collection exclusions)
          Sets the list of version information specifying versions that are not permitted.
 void setMinSecurityLevel(int securityLevel)
          Sets the minimum security level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleRequirements

public ModuleRequirements()
Creates a ModuleRequirements object. Initially, there are no module restrictions.

Method Detail

getMinSecurityLevel

public int getMinSecurityLevel()
Retrieves the minimum security level. The module on the user's machine must have a security level greater than or equal to the level specified.

Returns:
The minimum security level.

setMinSecurityLevel

public void setMinSecurityLevel(int securityLevel)
Sets the minimum security level. The module on the user's machine must have a security level greater than or equal to the level specified.

Parameters:
securityLevel - The minimum security level (must be at least 0).

getExcludedVersions

public java.util.Collection getExcludedVersions()
Retrieves a list of version information specifying versions that are not permitted. If the client's version matches any of the version identifiers in the list, the client will not be allowed to use a right containing this ModuleRequirements instance.

Returns:
Collection<VersionInfo> containing black-listed versions (empty if no restrictions set).

setExcludedVersions

public void setExcludedVersions(java.util.Collection exclusions)
Sets the list of version information specifying versions that are not permitted. If the client's version matches any of the version identifiers in the list, the client will not be allowed to use a right containing this ModuleRequirements instance. For a module to match the version information, all parameters specified in the version information, except for the release version, must exactly match the modules's values. The release version matches if the module's value is less than or equal to the value in the version information.

Parameters:
exclusions - Collection<VersionInfo> containing black-listed versions.

isModuleAllowed

public ModuleRequirements.ModuleAccess isModuleAllowed(ModuleInfo module)
Checks if the specified module is allowed access (minimum security level requirements are met and version is not on the excluded version list).

Parameters:
module - The module to be checked.
Returns:
ModuleAccess indicating if the module is allowed

isVersionAllowed

public ModuleRequirements.ModuleAccess isVersionAllowed(VersionInfo version)
Checks if the specified version is on the excluded version list.

Parameters:
version - The version to be checked.
Returns:
ModuleAccess indicating if the version is allowed


[an error occurred while processing this directive] [an error occurred while processing this directive]