Package org.codehaus.loom.xmlpolicy.metadata

Examples of org.codehaus.loom.xmlpolicy.metadata.GrantMetaData


    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName(), null, null,
                                    "jenny", "default" );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "jenny", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
            new KeyStoreMetaData( "default", "http://spice.sourceforge.net", "DoDgY" );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{keyStore}, new GrantMetaData[]{grant} );
View Full Code Here


    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "jenny", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
            new KeyStoreMetaData( "default", "http://spice.sourceforge.net", "DoDgY" );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{keyStore}, new GrantMetaData[]{grant} );
View Full Code Here

    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "jenny", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
            new KeyStoreMetaData( "default", "http://spice.sourceforge.net/NoExist", "DoDgY" );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{keyStore}, new GrantMetaData[]{grant} );
View Full Code Here

    {
        final PolicyBuilder builder = new TestNoInitPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
            new KeyStoreMetaData( "default", "http://spice.sourceforge.net", "DoDgY" );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{keyStore}, new GrantMetaData[]{grant} );
View Full Code Here

    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName() + "sss", null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final KeyStoreMetaData keyStore =
            new KeyStoreMetaData( "default", "http://spice.sourceforge.net", "DoDgY" );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{keyStore}, new GrantMetaData[]{grant} );
View Full Code Here

    {
        final PolicyBuilder builder = new TestPolicyBuilder();
        final PermissionMetaData permission =
            new PermissionMetaData( AllPermission.class.getName(), null, null,
                                    null, null );
        final GrantMetaData grant =
            new GrantMetaData( "file:/", "peter", "default",
                               new PermissionMetaData[]{permission} );
        final PolicyMetaData metaData =
            new PolicyMetaData( new KeyStoreMetaData[]{}, new GrantMetaData[]{grant} );
        final TestResolver resolver = new TestResolver();
        try
View Full Code Here

        throws Exception
    {
        final GrantMetaData[] grants = policy.getGrants();
        for( int i = 0; i < grants.length; i++ )
        {
            final GrantMetaData grant = grants[ i ];
            final PermissionMetaData[] permissions = grant.getPermissions();
            for( int j = 0; j < permissions.length; j++ )
            {
                final PermissionMetaData permission = permissions[ j ];
                final String target = permission.getTarget();
                final String action = permission.getAction();
                if( null == target && null != action )
                {
                    final String message =
                        REZ.format( "permission-missing-action.error",
                                       grant.getCodebase(),
                                       permission.getClassname() );
                    throw new Exception( message );
                }
            }
        }
View Full Code Here

        final int length = elements.getLength();

        for( int i = 0; i < length; i++ )
        {
            final Element element = (Element)elements.item( i );
            final GrantMetaData grant = buildGrant( element );
            grants.add( grant );
        }

        return (GrantMetaData[])grants.toArray( new GrantMetaData[ grants.size() ] );
    }
View Full Code Here

            keyStore = "default";
        }
        final NodeList permissionElements =
            element.getElementsByTagName( "permission" );
        final PermissionMetaData[] permissions = buildPermissions( permissionElements );
        return new GrantMetaData( codeBase, signedBy, keyStore, permissions );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.loom.xmlpolicy.metadata.GrantMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.