Package com.sun.enterprise.security.util

Examples of com.sun.enterprise.security.util.IASSecurityException


    public static void generatePolicyFile(String name) throws IASSecurityException {

  assert name != null;

  if (name == null) {
      throw new IASSecurityException("Invalid Module Name");
  }

  try {

      boolean inService =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    inService(name);

      if (!inService) {

    // find the PolicyConfig using remove=false to ensure policy stmts
    // are retained.

    // Note that it is presumed that the pc exists, and that
    // it is populated with the desired policy statements.
    // If this is not true, the call to commit will not
    // result in the correct policy statements being made
    // available to the policy module.


                PolicyConfigurationFactory pcf =
                    PolicyConfigurationFactory.getPolicyConfigurationFactory();
                PolicyConfiguration pc =
        pcf.getPolicyConfiguration(name, false);
               
    pc.commit();

    if (_logger.isLoggable(Level.FINE)){
        _logger.fine("JACC: committed policy for context: "+name);
    }
      }
    
      Policy.getPolicy().refresh();

  } catch(java.lang.ClassNotFoundException cnfe){
      String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
      throw new IASSecurityException(msg);
  } catch(javax.security.jacc.PolicyContextException pce){
      throw new IASSecurityException(pce.toString());
  }
    }
View Full Code Here


    public static void removePolicy(String name) throws IASSecurityException {

  assert name != null;

  if (name == null) {
      throw new IASSecurityException("Invalid Module Name");
  }

  try {

      boolean wasInService =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    inService(name);
     
      // find the PolicyConfig and delete it.

      PolicyConfiguration pc =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    getPolicyConfiguration(name, false);

      pc.delete();

      // Only do refresh policy if the deleted context was in service

      if (wasInService) {
    Policy.getPolicy().refresh();
      }

  } catch(java.lang.ClassNotFoundException cnfe){
      String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
      throw new IASSecurityException(msg);
  } catch(javax.security.jacc.PolicyContextException pce){
      throw new IASSecurityException(pce.toString());
  }
    }
View Full Code Here

        boolean rvalue = lastInService;
       
        assert name != null;
       
        if (name == null) {
            throw new IASSecurityException("Invalid Module Name");
        }
        try {
            PolicyConfigurationFactory pcf = PolicyConfigurationFactory.getPolicyConfigurationFactory();
            boolean inService =  pcf.inService(name);
           
            if (linkName == null) {
                rvalue = inService;
            } else if (inService == lastInService) {
               
                // only do the link if the named PC is not inService.
                if (!inService) {
                   
                    // find the PolicyConfigs using remove=false to ensure policy stmts
                    // are retained.
                   
                    PolicyConfiguration pc =
                        pcf.getPolicyConfiguration(name, false);                   
                    PolicyConfiguration linkPc =
                        pcf.getPolicyConfiguration(linkName, false);                   
                    pc.linkConfiguration(linkPc);
                }
            } else {
                throw new IASSecurityException("Inconsistent Module State");
            }
           
        } catch(java.lang.ClassNotFoundException cnfe){
            String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
            throw new IASSecurityException(msg);
        } catch(javax.security.jacc.PolicyContextException pce){
            throw new IASSecurityException(pce.toString());
        }       
        return rvalue;
    }
View Full Code Here

     throw an exception.
     */
    public static void generatePolicyFile(String name) throws IASSecurityException {
  assert name != null;
  if (name == null) {
      throw new IASSecurityException("Invalid Module Name");
        }
       
  try {

      boolean inService =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    inService(name);
      if (!inService) {
    // find the PolicyConfig using remove=false to ensure policy stmts
    // are retained.

    // Note that it is presumed that the pc exists, and that
    // it is populated with the desired policy statements.
    // If this is not true, the call to commit will not
    // result in the correct policy statements being made
    // available to the policy module.
                PolicyConfigurationFactory pcf =
                    PolicyConfigurationFactory.getPolicyConfigurationFactory();
                PolicyConfiguration pc =
        pcf.getPolicyConfiguration(name, false);
    pc.commit();
    if (_logger.isLoggable(Level.FINE)){
        _logger.fine("JACC: committed policy for context: "+name);
    }
      }

      Policy.getPolicy().refresh();
  } catch(java.lang.ClassNotFoundException cnfe){
      //String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
      throw new IASSecurityException(cnfe);
  } catch(javax.security.jacc.PolicyContextException pce){
      throw new IASSecurityException(pce);
  }
    }
View Full Code Here

     * the corresponding policy context. The name shall not be null.
     */
    public static void removePolicy(String name) throws IASSecurityException {
  assert name != null;
  if (name == null) {
      throw new IASSecurityException("Invalid Module Name");
  }
  try {
      boolean wasInService =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    inService(name);     
      // find the PolicyConfig and delete it.
      PolicyConfiguration pc =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    getPolicyConfiguration(name, false);
      pc.delete();
      // Only do refresh policy if the deleted context was in service
      if (wasInService) {
    Policy.getPolicy().refresh();
      }

  } catch(java.lang.ClassNotFoundException cnfe){
      String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
      throw new IASSecurityException(msg);
  } catch(javax.security.jacc.PolicyContextException pce){
      throw new IASSecurityException(pce.toString());
  }
    }
View Full Code Here

        boolean rvalue = lastInService;
       
        assert name != null;
       
        if (name == null) {
            throw new IASSecurityException("Invalid Module Name");
        }
        try {
            PolicyConfigurationFactory pcf = PolicyConfigurationFactory.getPolicyConfigurationFactory();
            boolean inService =  pcf.inService(name);
           
            if (linkName == null) {
                rvalue = inService;
            } else if (inService == lastInService) {
               
                // only do the link if the named PC is not inService.
                if (!inService) {
                   
                    // find the PolicyConfigs using remove=false to ensure policy stmts
                    // are retained.
                   
                    PolicyConfiguration pc =
                        pcf.getPolicyConfiguration(name, false);                   
                    PolicyConfiguration linkPc =
                        pcf.getPolicyConfiguration(linkName, false);                   
                    pc.linkConfiguration(linkPc);
                }
            } else {
                throw new IASSecurityException("Inconsistent Module State");
            }
           
        } catch(java.lang.ClassNotFoundException cnfe){
            String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
            throw new IASSecurityException(msg);
        } catch(javax.security.jacc.PolicyContextException pce){
            throw new IASSecurityException(pce.toString());
        }       
        return rvalue;
    }
View Full Code Here

     throw an exception.
     */
    public static void generatePolicyFile(String name) throws IASSecurityException {
  assert name != null;
  if (name == null) {
      throw new IASSecurityException("Invalid Module Name");
        }
       
  try {

      boolean inService =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    inService(name);
      if (!inService) {
    // find the PolicyConfig using remove=false to ensure policy stmts
    // are retained.

    // Note that it is presumed that the pc exists, and that
    // it is populated with the desired policy statements.
    // If this is not true, the call to commit will not
    // result in the correct policy statements being made
    // available to the policy module.
                PolicyConfigurationFactory pcf =
                    PolicyConfigurationFactory.getPolicyConfigurationFactory();
                PolicyConfiguration pc =
        pcf.getPolicyConfiguration(name, false);
    pc.commit();
    if (_logger.isLoggable(Level.FINE)){
        _logger.fine("JACC: committed policy for context: "+name);
    }
      }

      Policy.getPolicy().refresh();
  } catch(java.lang.ClassNotFoundException cnfe){
      //String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
      throw new IASSecurityException(cnfe);
  } catch(javax.security.jacc.PolicyContextException pce){
      throw new IASSecurityException(pce);
  }
    }
View Full Code Here

     * the corresponding policy context. The name shall not be null.
     */
    public static void removePolicy(String name) throws IASSecurityException {
  assert name != null;
  if (name == null) {
      throw new IASSecurityException("Invalid Module Name");
  }
  try {
      boolean wasInService =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    inService(name);     
      // find the PolicyConfig and delete it.
      PolicyConfiguration pc =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    getPolicyConfiguration(name, false);
      pc.delete();
      // Only do refresh policy if the deleted context was in service
      if (wasInService) {
    Policy.getPolicy().refresh();
      }

  } catch(java.lang.ClassNotFoundException cnfe){
      String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
      throw new IASSecurityException(msg);
  } catch(javax.security.jacc.PolicyContextException pce){
      throw new IASSecurityException(pce.toString());
  }
    }
View Full Code Here

        boolean rvalue = lastInService;
       
        assert name != null;
       
        if (name == null) {
            throw new IASSecurityException("Invalid Module Name");
        }
        try {
            PolicyConfigurationFactory pcf = PolicyConfigurationFactory.getPolicyConfigurationFactory();
            boolean inService =  pcf.inService(name);
           
            if (linkName == null) {
                rvalue = inService;
            } else if (inService == lastInService) {
               
                // only do the link if the named PC is not inService.
                if (!inService) {
                   
                    // find the PolicyConfigs using remove=false to ensure policy stmts
                    // are retained.
                   
                    PolicyConfiguration pc =
                        pcf.getPolicyConfiguration(name, false);                   
                    PolicyConfiguration linkPc =
                        pcf.getPolicyConfiguration(linkName, false);                   
                    pc.linkConfiguration(linkPc);
                }
            } else {
                throw new IASSecurityException("Inconsistent Module State");
            }
           
        } catch(java.lang.ClassNotFoundException cnfe){
            String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
            throw new IASSecurityException(msg);
        } catch(javax.security.jacc.PolicyContextException pce){
            throw new IASSecurityException(pce.toString());
        }       
        return rvalue;
    }
View Full Code Here

     throw an exception.
     */
    public static void generatePolicyFile(String name) throws IASSecurityException {
  assert name != null;
  if (name == null) {
      throw new IASSecurityException("Invalid Module Name");
        }
       
  try {

      boolean inService =
    PolicyConfigurationFactory.getPolicyConfigurationFactory().
    inService(name);
      if (!inService) {
    // find the PolicyConfig using remove=false to ensure policy stmts
    // are retained.

    // Note that it is presumed that the pc exists, and that
    // it is populated with the desired policy statements.
    // If this is not true, the call to commit will not
    // result in the correct policy statements being made
    // available to the policy module.
                PolicyConfigurationFactory pcf =
                    PolicyConfigurationFactory.getPolicyConfigurationFactory();
                PolicyConfiguration pc =
        pcf.getPolicyConfiguration(name, false);
    pc.commit();
    if (_logger.isLoggable(Level.FINE)){
        _logger.fine("JACC: committed policy for context: "+name);
    }
      }

      Policy.getPolicy().refresh();
  } catch(java.lang.ClassNotFoundException cnfe){
      //String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
      throw new IASSecurityException(cnfe);
  } catch(javax.security.jacc.PolicyContextException pce){
      throw new IASSecurityException(pce);
  }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.util.IASSecurityException

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.