Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.kuali.rice.ken.service.impl;
 
 
 import java.util.List;

NotificationRecipientService implementation This implementation relies on KIM user and group management

Author(s):
Kuali Rice Team (rice.collab@kuali.org)
 
 {
     private static final Logger LOG =
         Logger.getLogger(NotificationRecipientServiceKimImpl.class);
 
     protected GroupService getGroupService()
     {
         return KimApiServiceLocator.getGroupService();
     }

    
Uses the IdentityManagementService of KIM to get the members of a group.

Parameters:
groupRecipientId the String name of the recipient group
Returns:
a String array of all direct (child) principals and descendent principals
See also:
org.kuali.rice.ken.service.NotificationRecipientService.getGroupMembers(java.lang.String)
 
     public String[] getGroupMembers(String groupRecipientId)
     {
         Group group = getGroupService().getGroup(groupRecipientId);
 
         List<Stringids = getGroupService().getMemberPrincipalIds(group.getId());
 
         String[] array = new String[ids.size()];
         return ids.toArray(array);
     }

    
This method retrieves the display name for a user.

Parameters:
userId
Returns:
String
 
     public String getUserDisplayName(String userId)
     {
         //Gary's handling user conversion
         return null;
     }

    
 
      public boolean isRecipientValid(String recipientIdString recipientType)
      {
          boolean b = false;
 
          if..getCode().equals(recipientType) )
          {
              b = isGroupRecipientValidrecipientId );
          }
          else if..getCode().equals(recipientType) )
          {
              b = isUserRecipientValidrecipientId );
          }
          else
          {
              if.isEnabledFor(.) )
              {
                  .error("Recipient Type is neither of two acceptable values");
              }
          }
          return b;
      }

    
    public boolean isGroupRecipientValid(String groupRecipientId)
    {
        return (KimApiServiceLocator.getGroupService().getGroupgroupRecipientId ) != null);
    }

    
    public boolean isUserRecipientValid(String principalName)
    {
        return (KimApiServiceLocator.getIdentityService()
                .getPrincipalByPrincipalName(principalName) != null);
    }
New to GrepCode? Check out our FAQ X