Package org.jitterbit.integration.data.structure.ldap

Examples of org.jitterbit.integration.data.structure.ldap.AttributeContributions$Contribution


            classNodes.put(classDef.getOid(), parent);
            ObjectClassStructure classStruct = e.getValue();
            if (classStruct != null) {
                Collection<LdapStructureAttribute> extAttrs = askStructureForExtendedAttributes(ldapStructure,
                                classStruct);
                AttributeContributions attrs = addAttributeContributions(classDef.getOid(), classStruct, extAttrs);
                ObjectClassStructure[] auxStructs = auxInfo.get(classDef.getOid());
                if (auxStructs != null) {
                    auxClassSelection.setAuxiliaryClasses(classDef.getOid(), auxStructs);
                }
                buildTree(attrs, parent);
View Full Code Here


        return parent;
    }

    private AttributeContributions addAttributeContributions(NumericOid oid, ObjectClassStructure struct,
                    Collection<LdapStructureAttribute> extAttrs) {
        AttributeContributions contribs = attributeContributions.get(oid);
        if (contribs == null) {
            contribs = new AttributeContributions();
            attributeContributions.put(oid, contribs);
        }
        contribs.add(struct);
        contribs.setExtendedAttributes(extAttrs.toArray(new LdapStructureAttribute[extAttrs.size()]));
        return contribs;
    }
View Full Code Here

    }

    private void rebuildClassNodeAttributes(NumericOid classOid, ClassNameNode classNode) {
        Map<NumericOid, AttributeSelectionNode> currentAttrNodes = classNode.getAttributeNodeMap();
        classNode.removeAllChildren();
        AttributeContributions contributions = attributeContributions.get(classOid);
        for (LdapStructureAttribute attr : contributions.getEffectiveAttributes()) {
            AttributeSelectionNode node = AttributeSelectionNode.create(attr, type, classNode);
            AttributeSelectionNode previous = currentAttrNodes.get(attr.getOid());
            if (previous != null) {
                node.setSelected(previous.isSelected());
            }
View Full Code Here

        fireTreeStructureChanged(this, new TreePath(new Object[] { getRoot(), classNode }));
    }

    public LdapStructureAttribute[] getExtendedAttributes(NumericOid classOid) {
        checkNotNull(classOid, "classOid");
        AttributeContributions contribs = attributeContributions.get(classOid);
        if (contribs == null) {
            throw new IllegalArgumentException("Unknown class OID: " + classOid);
        }
        return contribs.getExtendedAttributes();
    }
View Full Code Here

        final ClassNameNode classNode = classNodes.get(classOid);
        UiUtils.runOnEventThread(new Runnable() {

            @Override
            public void run() {
                AttributeContributions contributions = attributeContributions.get(classOid);
                contributions.setExtendedAttributes(extAttrs);
                rebuildClassNodeAttributes(classOid, classNode);
            }
        });
    }
View Full Code Here

        }
        processAddedAuxClasses(classOid, delta);
    }

    private void processRemovedAuxClasses(NumericOid classOid, AuxClassDelta delta) {
        AttributeContributions contributions = attributeContributions.get(classOid);
        // If the structure was unknown when the tree model was created (the structure
        // was not in the cache, and the user cancelled login or provided the wrong
        // credentials) and the model has not been refreshed, there are no
        // AttributeContributions yet.
        if (contributions != null) {
            for (NumericOid oid : delta.toRemove()) {
                ObjectClassStructure struct = auxClassStructures.get(oid);
                contributions.remove(struct);
            }
        }
    }
View Full Code Here

            }
        }
    }

    private void processAddedAuxClasses(NumericOid classOid, AuxClassDelta delta) {
        AttributeContributions contributions = getAttributeContributionsCreateIfNotExist(classOid);
        for (NumericOid oid : delta.toAdd()) {
            ObjectClassStructure struct = auxClassStructures.get(oid);
            contributions.add(struct);
        }
    }
View Full Code Here

            contributions.add(struct);
        }
    }
   
    private AttributeContributions getAttributeContributionsCreateIfNotExist(NumericOid classOid) {
        AttributeContributions c = attributeContributions.get(classOid);
        if (c == null) {
            c = new AttributeContributions();
            attributeContributions.put(classOid, c);
        }
        return c;
    }
View Full Code Here

            processEntry((ClassNameNode) child);
        }
    }

    private void processEntry(ClassNameNode node) {
        AttributeContributions contribs = model.getAttributeContributions(node.getOid());
        List<String> attrs = Lists.newArrayList();
        boolean atLeastOneNotSelected = false;
        for (KongaTreeNode child : node.children()) {
            if (child instanceof AttributeSelectionNode) {
                AttributeSelectionNode attrNode = (AttributeSelectionNode) child;
                if (attrNode.isSelected()) {
                    LdapStructureAttribute attr = attrNode.getUserObject();
                    if (!contribs.isExtendedAttribute(attr)) {
                        attrs.add(attrNode.getUserObject().getName());
                    }
                } else {
                    atLeastOneNotSelected = true;
                }
View Full Code Here

    public LdapStructureEntry[] getDefinedEntries() {
        List<LdapStructureEntry> entries = Lists.newArrayList();
        for (NumericOid oid : model.getClassOids()) {
            String[] attrs = selected.get(oid);
            NumericOid[] aux = model.getAuxiliaryClassesFor(oid);
            AttributeContributions contribs = model.getAttributeContributions(oid);
            LdapStructureAttribute[] extendedAttrs = contribs.getExtendedAttributes();
            LdapStructureEntry e = new LdapStructureEntry(oid, attrs, aux, extendedAttrs);
            entries.add(e);
        }
        return entries.toArray(new LdapStructureEntry[entries.size()]);
    }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.structure.ldap.AttributeContributions$Contribution

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.