Package org.apache.syncope.common.mod

Examples of org.apache.syncope.common.mod.ReferenceMod


            } else {
                Long userId = handler.findMatchingAttributableId(ObjectClass.ACCOUNT, entry.getValue());
                if (userId == null) {
                    Long roleId = handler.findMatchingAttributableId(ObjectClass.GROUP, entry.getValue());
                    if (roleId != null) {
                        roleMod.setRoleOwner(new ReferenceMod(roleId));
                    }
                } else {
                    roleMod.setUserOwner(new ReferenceMod(userId));
                }
            }

            rwfAdapter.update(roleMod);
        }
View Full Code Here


        result.setInheritAttributes(updated.isInheritAttributes());
        result.setInheritDerivedAttributes(updated.isInheritDerivedAttributes());
        result.setInheritVirtualAttributes(updated.isInheritVirtualAttributes());

        // 2. policies
        result.setAccountPolicy(new ReferenceMod(updated.getAccountPolicy()));
        result.setPasswordPolicy(new ReferenceMod(updated.getPasswordPolicy()));

        // 3. name
        if (!original.getName().equals(updated.getName())) {
            result.setName(updated.getName());
        }

        // 4. entitlements
        Set<String> updatedEnts = new HashSet<String>(updated.getEntitlements());
        Set<String> originalEnts = new HashSet<String>(original.getEntitlements());
        if (updatedEnts.equals(originalEnts)) {
            result.setEntitlements(null);
        } else {
            result.setEntitlements(updated.getEntitlements());
        }

        // 5. owner
        result.setUserOwner(new ReferenceMod(updated.getUserOwner()));
        result.setRoleOwner(new ReferenceMod(updated.getRoleOwner()));

        return result;
    }
View Full Code Here

        assertNotNull(connObjectTO.getAttributeMap().get("owner"));

        // SYNCOPE-515: remove ownership
        final RoleMod roleMod = new RoleMod();
        roleMod.setId(roleTO.getId());
        roleMod.setRoleOwner(new ReferenceMod());

        assertNull(roleService.update(roleMod.getId(), roleMod).getRoleOwner());
    }
View Full Code Here

            } else {
                Long userId = handler.findMatchingAttributableId(ObjectClass.ACCOUNT, entry.getValue());
                if (userId == null) {
                    Long roleId = handler.findMatchingAttributableId(ObjectClass.GROUP, entry.getValue());
                    if (roleId != null) {
                        roleMod.setRoleOwner(new ReferenceMod(roleId));
                    }
                } else {
                    roleMod.setUserOwner(new ReferenceMod(userId));
                }
            }

            rwfAdapter.update(roleMod);
        }
View Full Code Here

            } else {
                Long userId = handler.findMatchingAttributableId(ObjectClass.ACCOUNT, entry.getValue());
                if (userId == null) {
                    Long roleId = handler.findMatchingAttributableId(ObjectClass.GROUP, entry.getValue());
                    if (roleId != null) {
                        roleMod.setRoleOwner(new ReferenceMod(roleId));
                    }
                } else {
                    roleMod.setUserOwner(new ReferenceMod(userId));
                }
            }

            rwfAdapter.update(roleMod);
        }
View Full Code Here

            } else {
                Long userId = handler.findMatchingAttributableId(ObjectClass.ACCOUNT, entry.getValue());
                if (userId == null) {
                    Long roleId = handler.findMatchingAttributableId(ObjectClass.GROUP, entry.getValue());
                    if (roleId != null) {
                        roleMod.setRoleOwner(new ReferenceMod(roleId));
                    }
                } else {
                    roleMod.setUserOwner(new ReferenceMod(userId));
                }
            }

            rwfAdapter.update(roleMod);
        }
View Full Code Here

        result.setInheritAttributes(updated.isInheritAttributes());
        result.setInheritDerivedAttributes(updated.isInheritDerivedAttributes());
        result.setInheritVirtualAttributes(updated.isInheritVirtualAttributes());

        // 2. policies
        result.setAccountPolicy(new ReferenceMod(updated.getAccountPolicy()));
        result.setPasswordPolicy(new ReferenceMod(updated.getPasswordPolicy()));

        // 3. name
        if (!original.getName().equals(updated.getName())) {
            result.setName(updated.getName());
        }

        // 4. entitlements
        Set<String> updatedEnts = new HashSet<String>(updated.getEntitlements());
        Set<String> originalEnts = new HashSet<String>(original.getEntitlements());
        if (updatedEnts.equals(originalEnts)) {
            result.setEntitlements(null);
        } else {
            result.setEntitlements(updated.getEntitlements());
        }

        // 5. owner
        result.setUserOwner(new ReferenceMod(updated.getUserOwner()));
        result.setRoleOwner(new ReferenceMod(updated.getRoleOwner()));

        return result;
    }
View Full Code Here

        result.setInheritAttributes(updated.isInheritAttributes());
        result.setInheritDerivedAttributes(updated.isInheritDerivedAttributes());
        result.setInheritVirtualAttributes(updated.isInheritVirtualAttributes());

        // 2. policies
        result.setAccountPolicy(new ReferenceMod(updated.getAccountPolicy()));
        result.setPasswordPolicy(new ReferenceMod(updated.getPasswordPolicy()));

        // 3. name
        if (!original.getName().equals(updated.getName())) {
            result.setName(updated.getName());
        }

        // 4. entitlements
        Set<String> updatedEnts = new HashSet<String>(updated.getEntitlements());
        Set<String> originalEnts = new HashSet<String>(original.getEntitlements());
        if (updatedEnts.equals(originalEnts)) {
            result.setEntitlements(null);
        } else {
            result.setEntitlements(updated.getEntitlements());
        }

        // 5. owner
        result.setUserOwner(new ReferenceMod(updated.getUserOwner()));
        result.setRoleOwner(new ReferenceMod(updated.getRoleOwner()));

        return result;
    }
View Full Code Here

                            entry.getValue(),
                            rhandler.getProfile().getSyncTask().getResource(),
                            rhandler.getProfile().getConnector());

                    if (roleId != null) {
                        roleMod.setRoleOwner(new ReferenceMod(roleId));
                    }
                } else {
                    roleMod.setUserOwner(new ReferenceMod(userId));
                }
            }

            rwfAdapter.update(roleMod);
        }
View Full Code Here

        assertNotNull(connObjectTO.getAttrMap().get("owner"));

        // SYNCOPE-515: remove ownership
        final RoleMod roleMod = new RoleMod();
        roleMod.setId(roleTO.getId());
        roleMod.setRoleOwner(new ReferenceMod());

        assertNull(updateRole(roleMod).getRoleOwner());
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.common.mod.ReferenceMod

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.