Package org.glassfish.deployment.common

Examples of org.glassfish.deployment.common.SecurityRoleMapperFactory


        OpsParams params = dc.getCommandParameters(OpsParams.class);
        if (params.origin != OpsParams.Origin.undeploy) {
            return;
        }
        String appName = params.name();
        SecurityRoleMapperFactory factory = getRoleMapperFactory();
        factory.removeRoleMapper(appName);

    }
View Full Code Here


        factory.removeRoleMapper(appName);

    }
   
   public static SecurityRoleMapperFactory getRoleMapperFactory() {
       SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory();
       if (factory == null) {
           throw new IllegalArgumentException("This application has no role mapper factory defined");
       }
       return factory;
   }
View Full Code Here

        String roleName = null;

        WebBundleDescriptor wbd = (WebBundleDescriptor) getComponentEnvManager().getCurrentJndiNameEnvironment();

        SecurityRoleMapperFactory securityRoleMapperFactory = getSecurityRoleMapperFactory();
        SecurityRoleMapper securityRoleMapper =
                securityRoleMapperFactory.getRoleMapper(wbd.getModuleID());

        Map<String, Subject> map = securityRoleMapper.getRoleToSubjectMapping();
        for (Map.Entry<String, Subject> entry : map.entrySet()) {
            roleName = entry.getKey();
            Subject subject = entry.getValue();
View Full Code Here

  if (!writeOnCommit) return;

  // otherwise proceed to write policy file

  Map roleToSubjectMap = null;
        SecurityRoleMapperFactory factory=SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory();
  if (rolePermissionsTable != null) {
      // Make sure a role to subject map has been defined for the Policy Context
      if (factory != null) {
                // the rolemapper is stored against the
                // appname, for a web app get the appname for this contextid
                SecurityRoleMapper srm = factory.getRoleMapper(CONTEXT_ID);
    if (srm != null) {
        roleToSubjectMap = srm.getRoleToSubjectMapping();
    }
    if (roleToSubjectMap != null) {
        // make sure all liked PC's have the same roleToSubjectMap
        Set linkSet = (Set) fact.getLinkTable().get(CONTEXT_ID);
        if (linkSet != null) {
      Iterator it = linkSet.iterator();
      while (it.hasNext()) {
          String contextId = (String)it.next();
          if (!CONTEXT_ID.equals(contextId)) {
        SecurityRoleMapper otherSrm = factory.getRoleMapper(contextId);
        Map otherRoleToSubjectMap = null;

        if (otherSrm != null) {
            otherRoleToSubjectMap = otherSrm.getRoleToSubjectMapping();
        }
View Full Code Here

        OpsParams params = dc.getCommandParameters(OpsParams.class);
        if (params.origin != OpsParams.Origin.undeploy) {
            return;
        }
        String appName = params.name();
        SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory();
        if (factory == null) {
            throw new IllegalArgumentException("This application has no role mapper factory defined");
        }
        factory.removeRoleMapper(appName);

    }
View Full Code Here

        OpsParams params = dc.getCommandParameters(OpsParams.class);
        if (params.origin != OpsParams.Origin.undeploy) {
            return;
        }
        String appName = params.name();
        SecurityRoleMapperFactory factory = getRoleMapperFactory();
        factory.removeRoleMapper(appName);

    }
View Full Code Here

        factory.removeRoleMapper(appName);

    }
   
   public static SecurityRoleMapperFactory getRoleMapperFactory() {
       SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory();
       if (factory == null) {
           throw new IllegalArgumentException("This application has no role mapper factory defined");
       }
       return factory;
   }
View Full Code Here

  if (!writeOnCommit) return;

  // otherwise proceed to write policy file

  Map roleToSubjectMap = null;
        SecurityRoleMapperFactory factory=SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory();
  if (rolePermissionsTable != null) {
      // Make sure a role to subject map has been defined for the Policy Context
      if (factory != null) {
                // the rolemapper is stored against the
                // appname, for a web app get the appname for this contextid
                SecurityRoleMapper srm = factory.getRoleMapper(CONTEXT_ID);
    if (srm != null) {
        roleToSubjectMap = srm.getRoleToSubjectMapping();
    }
    if (roleToSubjectMap != null) {
        // make sure all liked PC's have the same roleToSubjectMap
        Set linkSet = (Set) fact.getLinkTable().get(CONTEXT_ID);
        if (linkSet != null) {
      Iterator it = linkSet.iterator();
      while (it.hasNext()) {
          String contextId = (String)it.next();
          if (!CONTEXT_ID.equals(contextId)) {
        SecurityRoleMapper otherSrm = factory.getRoleMapper(contextId);
        Map otherRoleToSubjectMap = null;

        if (otherSrm != null) {
            otherRoleToSubjectMap = otherSrm.getRoleToSubjectMapping();
        }
View Full Code Here

        }
    }

    private SecurityRoleMapper getInternalMapper(String pcid) {

        SecurityRoleMapperFactory factory = Globals.get(SecurityRoleMapperFactory.class);
                //SecurityRoleMapperFactoryMgr.getFactory();

        if (factory == null) {
            String msg = "RoleMapper.factory.lookup.failed";
            logger.log(Level.SEVERE, msg);
            throw new SecurityException(msg);
        }

        SecurityRoleMapper srm = factory.getRoleMapper(pcid);

        if (srm == null) {
            String msg = "RoleMapper.mapper.lookup.failed";
            logger.log(Level.SEVERE, msg);
            throw new SecurityException(msg);
View Full Code Here

TOP

Related Classes of org.glassfish.deployment.common.SecurityRoleMapperFactory

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.