public PrivacyFieldDTO[] getUserProfile(String userId, String profileName, String[] claimValues) {
   try {
     org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO[] result =
         stub.getUserProfile(userId, profileName, claimValues);
     PrivacyFieldDTO[] profileData = new PrivacyFieldDTO[result.length];
     int index = 0;
     for (org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO data : result) {
       PrivacyFieldDTO obj = new PrivacyFieldDTO();
       obj.setFieldName(data.getFieldName());
       obj.setVisibilityValue(data.getVisibilityValue());
       profileData[index++] = obj;
     }
     return profileData;
   } catch (RemoteException e) {
     log.error(e.getMessage(), e);
     return new PrivacyFieldDTO[0];
   }
 }
 public Boolean updateUserProfile(
     String userId, String profileName, PrivacyFieldDTO[] profileData) {
   try {
     org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO[] profileDataArray =
         new org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO
             [profileData.length];
     int index = 0;
     for (PrivacyFieldDTO data : profileData) {
       org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO obj =
           new org.wso2.carbon.dashboard.social.stub.types.carbon.PrivacyFieldDTO();
       obj.setFieldName(data.getFieldName());
       obj.setVisibilityValue(data.getVisibilityValue());
       profileDataArray[index++] = obj;
     }
     return stub.updateUserProfile(userId, profileName, profileDataArray);
   } catch (RemoteException e) {
     log.error(e.getMessage(), e);
     return false;
   }
 }