net.sf.container
Interface PolicyParseListener

All Known Implementing Classes:
AbstractParseListener, AbstractPolicyFactory, CertificateAuthorityFactory, CodebaseFactory

public interface PolicyParseListener

Listener for PolicyParser callback events.

This interface is abstracting the actual ContainerFactory from the actual PolicyParser implementations.
This way one can reuse various parsing algorithms with various factory implementations.

Typically various ContainerFactory implementations would implement this interface as factories are very much responsible about how the policy file will be interpreted into a Container object. created on Jun 10, 2005

Since:
Version:
$Revision: 1.1 $
Author:
fiykov
See Also:
AbstractParseListener

Method Summary
 void beginParsing()
          callback to indicate that parsing process begins
 void endGrant()
          callback when grant definition is over
 void endParsing()
          callback to indicate that parsing process is over
 void endPolicyFile()
          callback when the parsing of the policy file is over
 ContainerFactory getContainerFactory()
           
 void newGrant(java.lang.String signedbyAliases, java.lang.String codebaseUrl)
          callback when new grant definition is encountered
 void newKeystore(java.lang.String ksUrl, java.lang.String ksType)
          callback when new keystore definition is encountered
 void newPermission(java.lang.String className, java.lang.String target, java.lang.String action, java.lang.String signedbyAliases)
          callback when new permission grant is encountered
 void newPolicyFile(java.net.URL url)
          callback when parsing of a new policy file starts
 

Method Detail

getContainerFactory

ContainerFactory getContainerFactory()
Returns:
the associated with this listener container factory

beginParsing

void beginParsing()
callback to indicate that parsing process begins


endParsing

void endParsing()
callback to indicate that parsing process is over


newPolicyFile

void newPolicyFile(java.net.URL url)
callback when parsing of a new policy file starts

Parameters:
url - of the policy file

endPolicyFile

void endPolicyFile()
callback when the parsing of the policy file is over


newKeystore

void newKeystore(java.lang.String ksUrl,
                 java.lang.String ksType)
                 throws java.io.FileNotFoundException,
                        java.security.KeyStoreException,
                        java.io.IOException,
                        java.security.NoSuchAlgorithmException,
                        java.security.cert.CertificateException
callback when new keystore definition is encountered

Parameters:
ksUrl - is mandatory, url is relative to the policy file location
ksType - is optional, null if not present in the policy file
Throws:
java.io.FileNotFoundException - if the keystore does not exists
java.security.KeyStoreException - while opening the keystore
java.io.IOException - while reading the keystore
java.security.NoSuchAlgorithmException - while reading the certificates
java.security.cert.CertificateException - while reading the certificates

newGrant

void newGrant(java.lang.String signedbyAliases,
              java.lang.String codebaseUrl)
              throws java.net.MalformedURLException,
                     java.security.KeyStoreException
callback when new grant definition is encountered

Parameters:
signedbyAliases - is optional, list of certificate aliases separated by semicolon
codebaseUrl - is optional, url pattern compatible with Policy File specification
Throws:
java.net.MalformedURLException
java.security.KeyStoreException

endGrant

void endGrant()
callback when grant definition is over


newPermission

void newPermission(java.lang.String className,
                   java.lang.String target,
                   java.lang.String action,
                   java.lang.String signedbyAliases)
                   throws java.lang.ClassNotFoundException,
                          java.lang.NoSuchMethodException,
                          java.lang.SecurityException,
                          java.lang.InstantiationException,
                          java.lang.IllegalAccessException,
                          java.lang.IllegalArgumentException,
                          java.lang.reflect.InvocationTargetException
callback when new permission grant is encountered

Parameters:
className - is mandatory, fully qualified class name
target - is mandatory depending on the permission type
action - is mandatory depending on the permission type
signedbyAliases - is optional, a list of certificate aliased separated by semicolon
Throws:
java.lang.ClassNotFoundException - if the permission class if not found
java.lang.NoSuchMethodException - if the permission class does not have suitable constructor
java.lang.SecurityException - while instantiating a new permission
java.lang.InstantiationException - while instantiating a new permission
java.lang.IllegalAccessException - while instantiating a new permission
java.lang.IllegalArgumentException - while instantiating a new permission
java.lang.reflect.InvocationTargetException - while instantiating a new permission


Copyright © 2007 Nikolay Fiykov. All Rights Reserved.