public void purge(boolean recursive,int graceperiod) throws AMException, SSOException {
  if (debug.messageEnabled()) {
    debug.message("AMObjectImpl.delete(): DN=" + entryDN + " recursive="+ recursive+ "graceperiod= "+ graceperiod);
  }
  if (entryDN.equals(AMStoreConnection.defaultOrg)) {
    throw new AMException(AMSDKBundle.getString("160",locale),"160");
  }
  if ((graceperiod > -1) && (graceperiod > AMStoreConnection.daysSinceModified(token,entryDN))) {
    if (debug.messageEnabled()) {
      debug.message("AMObjectImpl.purge-> " + entryDN + "will not be purged. Grace period= "+ graceperiod+ " has not expired");
    }
    throw new AMException(AMSDKBundle.getString("974",locale),"974");
  }
  if ((profileType == GROUP) || (profileType == DYNAMIC_GROUP) || (profileType == ASSIGNABLE_DYNAMIC_GROUP)|| (profileType == PEOPLE_CONTAINER)) {
    try {
      removeAdminRoleAci(recursive);
    }
 catch (    Exception e) {
      if (debug.messageEnabled()) {
        debug.message("AMObjectImpl.delete: Unable to remove " + "admin role aci." + e);
      }
    }
    try {
      dsServices.removeAdminRole(token,entryDN,recursive);
    }
 catch (    Exception e) {
      if (debug.messageEnabled()) {
        debug.message("AMObjectImpl.delete: " + e.getMessage());
      }
    }
  }
  Set aciList=null;
  Set templateDNs=null;
  if ((profileType == ROLE) || (profileType == FILTERED_ROLE)) {
    aciList=findRemovableAciList(getAttribute("iplanet-am-role-aci-list"));
    String filter="(&(objectclass=costemplate)(cn=\"" + entryDN + "\"))";
    templateDNs=dsServices.search(token,getOrganizationDN(),filter,AMConstants.SCOPE_SUB);
  }
  dsServices.removeEntry(token,entryDN,profileType,recursive,false);
  if (aciList != null) {
    removeAci(aciList);
  }
  if ((templateDNs != null) && !templateDNs.isEmpty()) {
    Iterator iter=templateDNs.iterator();
    while (iter.hasNext()) {
      String templateDN=(String)iter.next();
      dsServices.removeEntry(token,templateDN,AMObject.TEMPLATE,recursive,false);
    }
  }
  stringValueModMap.clear();
  if (!byteValueModMap.isEmpty()) {
    byteValueModMap.clear();
  }
}

public void purge ( boolean recursive , int graceperiod ) throws AMException , SSOException { if ( debug . messageEnabled ( ) ) { debug . message ( "AMObjectImpl.delete(): DN=" + entryDN + " recursive=" + recursive + "graceperiod= " + graceperiod ) ; } if ( entryDN . equals ( AMStoreConnection . defaultOrg ) ) { throw new AMException ( AMSDKBundle . getString ( "160" , locale ) , "160" ) ; } if ( ( graceperiod > - 1 ) && ( graceperiod > AMStoreConnection . daysSinceModified ( token , entryDN ) ) ) { if ( debug . messageEnabled ( ) ) { debug . message ( "AMObjectImpl.purge-> " + entryDN + "will not be purged. Grace period= " + graceperiod + " has not expired" ) ; } throw new AMException ( AMSDKBundle . getString ( "974" , locale ) , "974" ) ; } if ( ( profileType == GROUP ) || ( profileType == DYNAMIC_GROUP ) || ( profileType == ASSIGNABLE_DYNAMIC_GROUP ) || ( profileType == PEOPLE_CONTAINER ) ) { try { removeAdminRoleAci ( recursive ) ; } catch ( Exception e ) { if ( debug . messageEnabled ( ) ) { debug . message ( "AMObjectImpl.delete: Unable to remove " + "admin role aci." + e ) ; } } try { dsServices . removeAdminRole ( token , entryDN , recursive ) ; } catch ( Exception e ) { if ( debug . messageEnabled ( ) ) { debug . message ( "AMObjectImpl.delete: " + e . getMessage ( ) ) ; } } } Set aciList = null ; Set templateDNs = null ; if ( ( profileType == ROLE ) || ( profileType == FILTERED_ROLE ) ) { aciList = findRemovableAciList ( getAttribute ( "iplanet-am-role-aci-list" ) ) ; String filter = "(&(objectclass=costemplate)(cn=\"" + entryDN + "\"))" ; templateDNs = dsServices . search ( token , getOrganizationDN ( ) , filter , AMConstants . SCOPE_SUB ) ; } dsServices . removeEntry ( token , entryDN , profileType , recursive , false ) ; if ( aciList != null ) { removeAci ( aciList ) ; } if ( ( templateDNs != null ) && ! templateDNs . isEmpty ( ) ) { Iterator iter = templateDNs . iterator ( ) ; while ( iter . hasNext ( ) ) { String templateDN = ( String ) iter . next ( ) ; dsServices . removeEntry ( token , templateDN , AMObject . TEMPLATE , recursive , false ) ; } } stringValueModMap . clear ( ) ; if ( ! byteValueModMap . isEmpty ( ) ) { byteValueModMap . clear ( ) ; } }
method to hard delete an object .
