public void deleteAuthenticationInstance(String name) throws AMConfigurationException {
  AMAuthenticationInstance instance=getAuthenticationInstance(name);
  if (instance == null) {
    throw new AMConfigurationException(BUNDLE_NAME,"authInstanceNotExist",new Object[]{name});
  }
  if (isModuleInstanceInUse(name)) {
    throw new AMConfigurationException(BUNDLE_NAME,"authInstanceInUse",new Object[]{name});
  }
  String type=getAuthInstanceType(name);
  ServiceConfig serviceConfig=instance.getServiceConfig();
  if (serviceConfig == null) {
    throw new AMConfigurationException(BUNDLE_NAME,"authInstanceIsGlobal",new Object[]{type});
  }
  try {
    if (name.equals(type)) {
      Map attrs=serviceConfig.getAttributesWithoutDefaults();
      if (attrs != null) {
        serviceConfig.removeAttributes(attrs.keySet());
      }
    }
 else {
      String serviceName=serviceConfig.getServiceName();
      ServiceConfigManager scm=new ServiceConfigManager(serviceName,token);
      ServiceConfig orgConfig=scm.getOrganizationConfig(realm,null);
      orgConfig.removeSubConfig(name);
    }
    if (isInheritedAuthInstance(name)) {
      Set<String> moduleNames=new HashSet<String>();
      moduleNames.add(name);
      orgServiceConfig.removeAttributeValues(ISAuthConstants.AUTH_ALLOWED_MODULES,moduleNames);
    }
    if (!SystemProperties.isServerMode()) {
      buildModuleInstanceForService(realm,serviceConfig.getServiceName());
    }
  }
 catch (  Exception e) {
    throw new AMConfigurationException(e);
  }
}

public void deleteAuthenticationInstance ( String name ) throws AMConfigurationException { AMAuthenticationInstance instance = getAuthenticationInstance ( name ) ; if ( instance == null ) { throw new AMConfigurationException ( BUNDLE_NAME , "authInstanceNotExist" , new Object [ ] { name } ) ; } if ( isModuleInstanceInUse ( name ) ) { throw new AMConfigurationException ( BUNDLE_NAME , "authInstanceInUse" , new Object [ ] { name } ) ; } String type = getAuthInstanceType ( name ) ; ServiceConfig serviceConfig = instance . getServiceConfig ( ) ; if ( serviceConfig == null ) { throw new AMConfigurationException ( BUNDLE_NAME , "authInstanceIsGlobal" , new Object [ ] { type } ) ; } try { if ( name . equals ( type ) ) { Map attrs = serviceConfig . getAttributesWithoutDefaults ( ) ; if ( attrs != null ) { serviceConfig . removeAttributes ( attrs . keySet ( ) ) ; } } else { String serviceName = serviceConfig . getServiceName ( ) ; ServiceConfigManager scm = new ServiceConfigManager ( serviceName , token ) ; ServiceConfig orgConfig = scm . getOrganizationConfig ( realm , null ) ; orgConfig . removeSubConfig ( name ) ; } if ( isInheritedAuthInstance ( name ) ) { Set < String > moduleNames = new HashSet < String > ( ) ; moduleNames . add ( name ) ; orgServiceConfig . removeAttributeValues ( ISAuthConstants . AUTH_ALLOWED_MODULES , moduleNames ) ; } if ( ! SystemProperties . isServerMode ( ) ) { buildModuleInstanceForService ( realm , serviceConfig . getServiceName ( ) ) ; } } catch ( Exception e ) { throw new AMConfigurationException ( e ) ; } }
deletes a specified authentication module instance .
