public void objectAdded(NamingEvent namingEvent){
  Map<String,Set<Role>> newRoles=new HashMap<>();
  try {
    processSearchResult(newRoles,(SearchResult)namingEvent.getNewBinding());
    for (    Map.Entry<String,Set<Role>> entry : newRoles.entrySet()) {
      Set<Role> existingRoles=securityRepository.getMatch(entry.getKey());
      for (      Role role : entry.getValue()) {
        existingRoles.add(role);
      }
    }
  }
 catch (  NamingException e) {
    e.printStackTrace();
  }
}

public void objectAdded ( NamingEvent namingEvent ) { Map < String , Set < Role > > newRoles = new HashMap < > ( ) ; try { processSearchResult ( newRoles , ( SearchResult ) namingEvent . getNewBinding ( ) ) ; for ( Map . Entry < String , Set < Role > > entry : newRoles . entrySet ( ) ) { Set < Role > existingRoles = securityRepository . getMatch ( entry . getKey ( ) ) ; for ( Role role : entry . getValue ( ) ) { existingRoles . add ( role ) ; } } } catch ( NamingException e ) { e . printStackTrace ( ) ; } }
handler for new policy entries in the directory .
