Example usage for javax.naming.directory ModificationItem toString

List of usage examples for javax.naming.directory ModificationItem toString

Introduction

In this page you can find the example usage for javax.naming.directory ModificationItem toString.

Prototype

public String toString() 

Source Link

Document

Generates the string representation of this modification item, which consists of the modification operation and its related attribute.

Usage

From source file:org.jasig.cas.adaptors.ldap.services.LdapServiceRegistryDao.java

public RegisteredService update(final RegisteredServiceImpl registeredService) {
    final DirContextAdapter ctx = lookupCtx(
            findDn(this.ldapServiceMapper.getSearchFilter(registeredService.getId()).encode()));
    if (ctx == null) {
        return null;
    }//  w  ww . j  ava 2 s . c  o  m

    this.ldapServiceMapper.doMapToContext(registeredService, ctx);

    final String dn = ctx.getNameInNamespace();
    final ModificationItem[] modItems = ctx.getModificationItems();
    if (log.isDebugEnabled()) {
        log.debug("Attemting to perform modify operations on " + dn);
        for (final ModificationItem modItem : modItems) {
            log.debug(modItem.toString());
        }
    }
    this.ldapTemplate.modifyAttributes(dn, modItems);
    return registeredService;
}