Coverage Report - org.kuali.rice.kim.ldap.EntityPrivacyPreferencesMapper
 
Classes in this File Line Coverage Branch Coverage Complexity
EntityPrivacyPreferencesMapper
0%
0/12
N/A
1
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kim.ldap;
 17  
 
 18  
 import org.springframework.ldap.core.DirContextOperations;
 19  
 import org.springframework.ldap.core.support.AbstractContextMapper;
 20  
 
 21  
 import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences;
 22  
 import org.kuali.rice.kim.util.Constants;
 23  
 
 24  
 /**
 25  
  * 
 26  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 27  
  */
 28  0
 public class EntityPrivacyPreferencesMapper extends AbstractContextMapper {
 29  
     private Constants constants;
 30  
     
 31  
     public Object doMapFromContext(DirContextOperations context) {
 32  0
         final String entityId      = context.getStringAttribute(getConstants().getKimLdapIdProperty());
 33  0
         final EntityPrivacyPreferences.Builder person = EntityPrivacyPreferences.Builder.create(entityId);
 34  0
         person.setSuppressName(false);
 35  0
         person.setSuppressEmail(false);
 36  0
         person.setSuppressPhone(false);
 37  0
         person.setSuppressAddress(false);
 38  0
         person.setSuppressPersonal(true);
 39  0
         return person;
 40  
     }
 41  
     
 42  
     /**
 43  
      * Gets the value of constants
 44  
      *
 45  
      * @return the value of constants
 46  
      */
 47  
     public final Constants getConstants() {
 48  0
         return this.constants;
 49  
     }
 50  
 
 51  
     /**
 52  
      * Sets the value of constants
 53  
      *
 54  
      * @param argConstants Value to assign to this.constants
 55  
      */
 56  
     public final void setConstants(final Constants argConstants) {
 57  0
         this.constants = argConstants;
 58  0
     }
 59  
 }