Package org.wso2.carbon.registry.social.api

Examples of org.wso2.carbon.registry.social.api.SocialDataException


                                String activityId) throws SocialDataException {
        //TODO: Set<String> fields is not currently used -- all fields are retrieved
        Activity userActivity = null;
        if ((userId == null || userId.trim().equals("") || appId == null ||
                appId.trim().equals("") || activityId == null || activityId.trim().equals(""))) {
            throw new SocialDataException("Invalid parameters provided. " +
                    "One or more of the parameter is either null or empty");
        }
        try {
            registry = getRegistry();
            if (groupId == null || groupId.equals(SocialImplConstants.GROUP_ID_SELF)) {
                // retrieve activity for user {userId}
                userActivity = getUserActivity(userId, appId, activityId);

            }
            //TODO: Handle GroupID= @friends, @topfriends etc
        }
        catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving activity of user " +
                    userId + " with activityId " + activityId, e);
        }

        return userActivity;
    }
View Full Code Here


            throws SocialDataException {
        // Should save the activity according to given parameters
        if (activity == null) {
            String errorMsg = "Cannot create activity. Passed Activity argument is null";
            log.error(errorMsg);
            throw new SocialDataException(errorMsg);
        }
        //if the posted time is not set, set system time as posted time
        if (activity.getPostedTime() == null || activity.getPostedTime() == 0) {
            activity.setPostedTime(System.currentTimeMillis());
        }
View Full Code Here

                userStoreManager.addUser(userId, "abcd123", new String[]{"admin"}, null, null);
            }
            userStoreManager.setUserClaimValues(userId, retrieveClaimValues(person), null);
        } catch (UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while saving person with id " + userId, e);
        }
        catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while saving person with id " + userId, e);
        }
        return true;
    }
View Full Code Here

        try {
            userStoreManager = getUserStoreManager();
            if (userStoreManager.isExistingUser(userId)) {
                userStoreManager.setUserClaimValues(userId, claims, null);
            } else {
                throw new SocialDataException("No user existing with id " + userId);
            }
        } catch (UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while saving person with id " + userId, e);
        }
        catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while saving person with id " + userId, e);
        }
    }
View Full Code Here

        try {
            userStoreManager = getUserStoreManager();
            userStoreManager.deleteUser(userId);
        } catch (UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while removing person with id " + userId, e);
        }
        catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while removing person with id " + userId, e);
        }
        return true;
    }
View Full Code Here

                    claims,
                    null);
            personObj = getPersonWithClaims(userClaims, userId);
        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving data for person " + userId, e);
        } catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving data for person " + userId, e);

        }

        return personObj;
View Full Code Here

                        SocialImplConstants.DEFAULT_USER_FILTER_STRING,
                        SocialImplConstants.DEFAULT_RETURN_ARRAY_SIZE);
                userIdsToFetch = new ArrayList(Arrays.asList(userList));
            } catch (Exception e) {
                log.error(e.getMessage(), e);
                throw new SocialDataException("Error while retrieving user list", e);
            }
        }
        Person[] peopleArray = new Person[userIdsToFetch.size()];
        int index = 0;
        for (String id : userIdsToFetch) {
View Full Code Here

            if (personObj != null && personObj.getDisplayName() == null) {
                personObj.setDisplayName(userId);
            }
        } catch (UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving data for person " + userId, e);
        }
        catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving data for person " + userId, e);
        }
        return personObj;
    }
View Full Code Here

                claimInfo[1][index++] = claim.getDisplayTag();
               
            }
        } catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving claims", e);
        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving claims", e);
        }

        return userClaims;
    }
View Full Code Here

                    userList[1][index++] = (getDisplayName(userId) != null) ? getDisplayName(userId) : userId;
                }
            }
        } catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving user-list", e);
        } catch (UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new SocialDataException("Error while retrieving user-list", e);
        }
        return userList;
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.social.api.SocialDataException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.