public void createEntry(SSOToken token,String entryName,int objectType,String parentDN,Map attributes) throws AMEntryExistsException, AMException, SSOException {
  try {
    if (entryName == null || entryName.length() == 0) {
      throw new AMException(token,"320");
    }
 else     if (parentDN == null) {
      throw new AMException(token,"322");
    }
    String tmpDN=getNamingAttribute(objectType) + "=" + entryName+ ","+ parentDN;
    validateAttributeUniqueness(tmpDN,objectType,true,attributes);
    PersistentObject po=UMSObject.getObjectHandle(token,new Guid(parentDN));
switch (objectType) {
case AMObject.USER:
      createUser(token,po,attributes,entryName);
    break;
case AMObject.MANAGED_ROLE:
case AMObject.ROLE:
  createRole(token,po,attributes,entryName);
break;
case AMObject.ORGANIZATION:
createOrganization(token,po,attributes,entryName);
break;
case AMObject.STATIC_GROUP:
case AMObject.GROUP:
createGroup(token,po,attributes,entryName);
break;
case AMObject.ASSIGNABLE_DYNAMIC_GROUP:
createAssignDynamicGroup(token,po,attributes,entryName);
break;
case AMObject.DYNAMIC_GROUP:
createDynamicGroup(token,po,attributes,entryName);
break;
case AMObject.PEOPLE_CONTAINER:
createPeopleContainer(po,attributes,entryName);
break;
case AMObject.ORGANIZATIONAL_UNIT:
createOrganizationalUnit(token,po,attributes,entryName);
break;
case AMObject.GROUP_CONTAINER:
createGroupContainer(po,attributes,entryName);
break;
case AMObject.FILTERED_ROLE:
createFilteredRole(token,po,attributes,entryName);
break;
case AMObject.RESOURCE:
createResource(po,attributes,entryName);
break;
case AMObject.UNDETERMINED_OBJECT_TYPE:
case AMObject.UNKNOWN_OBJECT_TYPE:
throw new AMException(token,"326");
default :
createEntity(token,po,objectType,attributes,entryName);
}
}
 catch (AccessRightsException e) {
if (debug.warningEnabled()) {
debug.warning("DirectoryServicesImpl.createEntry() " + "Insufficient access rights to create entry: " + entryName,e);
}
throw new AMException(token,"460");
}
catch (EntryAlreadyExistsException e) {
if (debug.warningEnabled()) {
debug.warning("DirectoryServicesImpl.createEntry() Entry: " + entryName + "already exists: ",e);
}
String msgid=getEntryExistsMsgID(objectType);
String name=getEntryName(e);
Object args[]={name};
throw new AMException(AMSDKBundle.getString(msgid,args),msgid,args);
}
catch (UMSException e) {
if (debug.warningEnabled()) {
debug.warning("DirectoryServicesImpl.createEntry() Unable to " + "create entry: " + entryName,e);
}
throw new AMException(token,"324",e);
}
}

public void createEntry ( SSOToken token , String entryName , int objectType , String parentDN , Map attributes ) throws AMEntryExistsException , AMException , SSOException { try { if ( entryName == null || entryName . length ( ) == 0 ) { throw new AMException ( token , "320" ) ; } else if ( parentDN == null ) { throw new AMException ( token , "322" ) ; } String tmpDN = getNamingAttribute ( objectType ) + "=" + entryName + "," + parentDN ; validateAttributeUniqueness ( tmpDN , objectType , true , attributes ) ; PersistentObject po = UMSObject . getObjectHandle ( token , new Guid ( parentDN ) ) ; switch ( objectType ) { case AMObject . USER : createUser ( token , po , attributes , entryName ) ; break ; case AMObject . MANAGED_ROLE : case AMObject . ROLE : createRole ( token , po , attributes , entryName ) ; break ; case AMObject . ORGANIZATION : createOrganization ( token , po , attributes , entryName ) ; break ; case AMObject . STATIC_GROUP : case AMObject . GROUP : createGroup ( token , po , attributes , entryName ) ; break ; case AMObject . ASSIGNABLE_DYNAMIC_GROUP : createAssignDynamicGroup ( token , po , attributes , entryName ) ; break ; case AMObject . DYNAMIC_GROUP : createDynamicGroup ( token , po , attributes , entryName ) ; break ; case AMObject . PEOPLE_CONTAINER : createPeopleContainer ( po , attributes , entryName ) ; break ; case AMObject . ORGANIZATIONAL_UNIT : createOrganizationalUnit ( token , po , attributes , entryName ) ; break ; case AMObject . GROUP_CONTAINER : createGroupContainer ( po , attributes , entryName ) ; break ; case AMObject . FILTERED_ROLE : createFilteredRole ( token , po , attributes , entryName ) ; break ; case AMObject . RESOURCE : createResource ( po , attributes , entryName ) ; break ; case AMObject . UNDETERMINED_OBJECT_TYPE : case AMObject . UNKNOWN_OBJECT_TYPE : throw new AMException ( token , "326" ) ; default : createEntity ( token , po , objectType , attributes , entryName ) ; } } catch ( AccessRightsException e ) { if ( debug . warningEnabled ( ) ) { debug . warning ( "DirectoryServicesImpl.createEntry() " + "Insufficient access rights to create entry: " + entryName , e ) ; } throw new AMException ( token , "460" ) ; } catch ( EntryAlreadyExistsException e ) { if ( debug . warningEnabled ( ) ) { debug . warning ( "DirectoryServicesImpl.createEntry() Entry: " + entryName + "already exists: " , e ) ; } String msgid = getEntryExistsMsgID ( objectType ) ; String name = getEntryName ( e ) ; Object args [ ] = { name } ; throw new AMException ( AMSDKBundle . getString ( msgid , args ) , msgid , args ) ; } catch ( UMSException e ) { if ( debug . warningEnabled ( ) ) { debug . warning ( "DirectoryServicesImpl.createEntry() Unable to " + "create entry: " + entryName , e ) ; } throw new AMException ( token , "324" , e ) ; } }
create an entry in the directory
