Examples of RelationshipManager


Examples of org.datanucleus.state.RelationshipManager

        boolean success = delegate.removeAll(c);
        if (ownerSM != null && ownerSM.getExecutionContext().getManageRelations())
        {
            // Relationship management
            Iterator iter = c.iterator();
            RelationshipManager relMgr = ownerSM.getExecutionContext().getRelationshipManager(ownerSM);
            while (iter.hasNext())
            {
                relMgr.relationRemove(fieldNumber, iter.next());
            }
        }
        if (success)
        {
            makeDirty();
View Full Code Here

Examples of org.datanucleus.state.RelationshipManager

        if (ownerSM != null && ownerSM.getExecutionContext().getManageRelations())
        {
            // Relationship management
            Iterator iter = c.iterator();
            RelationshipManager relMgr = ownerSM.getExecutionContext().getRelationshipManager(ownerSM);
            while (iter.hasNext())
            {
                relMgr.relationAdd(fieldNumber, iter.next());
            }
        }

        boolean backingSuccess = true;
        if (backingStore != null)
View Full Code Here

Examples of org.datanucleus.state.RelationshipManager

        if (ownerSM != null && ownerSM.getExecutionContext().getManageRelations())
        {
            // Relationship management
            Iterator iter = c.iterator();
            RelationshipManager relMgr = ownerSM.getExecutionContext().getRelationshipManager(ownerSM);
            while (iter.hasNext())
            {
                relMgr.relationRemove(fieldNumber, iter.next());
            }
        }

        if (backingStore != null)
        {
View Full Code Here

Examples of org.picketlink.idm.RelationshipManager

        }
    }

    private void setup() {
        final IdentityManager identityManager = partitionManager.createIdentityManager();
        final RelationshipManager relationshipManager = partitionManager.createRelationshipManager();

        final User admin = new User( "admin" );
        final User director = new User( "director" );
        final User user = new User( "user" );
        final User guest = new User( "guest" );

        identityManager.add( admin );
        identityManager.add( director );
        identityManager.add( user );
        identityManager.add( guest );

        identityManager.updateCredential( admin, new Password( "admin" ) );
        identityManager.updateCredential( director, new Password( "director" ) );
        identityManager.updateCredential( user, new Password( "user" ) );
        identityManager.updateCredential( guest, new Password( "guest" ) );

        final Role roleAdmin = new Role( "admin" );
        final Role roleAnalyst = new Role( "analyst" );

        identityManager.add( roleAdmin );
        identityManager.add( roleAnalyst );

        relationshipManager.add( new Grant( admin, roleAnalyst ) );
        relationshipManager.add( new Grant( admin, roleAdmin ) );

        relationshipManager.add( new Grant( director, roleAnalyst ) );

        relationshipManager.add( new Grant( user, roleAnalyst ) );
    }
View Full Code Here

Examples of org.picketlink.idm.RelationshipManager

        PartitionManager partitionManager = getPartitionManager();
        IdentityManager identityManager = partitionManager.createIdentityManager();
        User user = getUser(identityManager, "johny");
        Role role = getRole(identityManager, "admin");

        RelationshipManager relationshipManager = partitionManager.createRelationshipManager();

        BasicModel.grantRole(relationshipManager, user, role);

        assertTrue(hasRole(relationshipManager, user, role));
    }
View Full Code Here

Examples of org.picketlink.idm.RelationshipManager

   * <p>Loads some users during the first construction.</p>
   */
  @PostConstruct
  public void create() {
    final IdentityManager identityManager = partitionManager.createIdentityManager();
    final RelationshipManager relationshipManager = partitionManager.createRelationshipManager();

    User john = new User("john");

    john.setEmail("john@doe.com");
    john.setFirstName("John");
    john.setLastName("Doe");

    User hacker = new User("hacker");

    hacker.setEmail("hacker@illegal.ru");
    hacker.setFirstName("Hacker");
    hacker.setLastName("anonymous");
   
    identityManager.add(john);
    identityManager.add(hacker);
    final Password defaultPassword = new Password("123");
    identityManager.updateCredential(john, defaultPassword);
    identityManager.updateCredential(hacker, defaultPassword);

    Role roleDeveloper = new Role("simple");
    Role roleAdmin = new Role("admin");

    identityManager.add(roleDeveloper);
    identityManager.add(roleAdmin);

    relationshipManager.add(new Grant(john, roleDeveloper));
    relationshipManager.add(new Grant(john, roleAdmin));
  }
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.people.relationship.RelationshipManager

     */
    public Activity[] getActivities(String[] userIds, String groupId, String appId,
                                    Set<String> fields, FilterOptions options)
            throws SocialDataException {

        RelationshipManager relationshipManager=new RelationshipManagerImpl();
        List<Activity> activityList = new ArrayList<Activity>();
        List<String> userIdsToFetch=new ArrayList<String>();
        String[] userIdArray=null;
        // Handle GroupId
        if(groupId.equals(SocialImplConstants.GROUP_ID_SELF)){
            userIdArray=userIds;
        }
        else if(groupId.equals(SocialImplConstants.GROUP_ID_FRIENDS)){
            for(String id:userIds){
                if(relationshipManager.getRelationshipList(id)!=null){
                    for(String friend:relationshipManager.getRelationshipList(id)){
                        userIdsToFetch.add(friend);
                    }
                }
            }
            userIdArray=new String[userIdsToFetch.size()];
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.people.relationship.RelationshipManager

     */
    public Person[] getPeople(String[] userIds, String groupId, FilterOptions filterOptions,
                              String[] fields) throws SocialDataException {
        //TODO: filter options
        List<String> userIdsToFetch = new ArrayList<String>();
        RelationshipManager relationshipManager;
        if (groupId.equalsIgnoreCase(SocialImplConstants.GROUP_ID_SELF)) {
            userIdsToFetch = new ArrayList(Arrays.asList(userIds));
        } else if (groupId.equalsIgnoreCase(SocialImplConstants.GROUP_ID_FRIENDS)) {
            relationshipManager = new RelationshipManagerImpl();
            for (String userId : userIds) {
                for (String id : relationshipManager.getRelationshipList(userId)) {
                    userIdsToFetch.add(id);
                }
            }
        } else if (groupId.equalsIgnoreCase(GroupId.Type.all.toString())) {
            try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.