Package org.jboss.dna.graph.property

Examples of org.jboss.dna.graph.property.Property


            if (sourceLocation.hasIdProperties()) {
                // Accumulate the identification properties ...
                for (Property propertyInSource : sourceLocation.getIdProperties()) {
                    Name name = propertyInSource.getName();
                    Property existing = actualLocation.getIdProperty(name);
                    if (existing != null) {
                        // Merge the property values ...
                        propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                    }
                    actualLocation = actualLocation.with(propertyInSource);
View Full Code Here


                Location sourceLocation = readFromSource.getActualLocationOfNode();
                if (sourceLocation.hasIdProperties()) {
                    // Accumulate the identification properties ...
                    for (Property propertyInSource : sourceLocation.getIdProperties()) {
                        Name name = propertyInSource.getName();
                        Property existing = actualLocation.getIdProperty(name);
                        if (existing != null) {
                            // Merge the property values ...
                            propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                        }
                        actualLocation = actualLocation.with(propertyInSource);
                    }
                }

                // Make sure we have an actual location ...
                actualLocation = determineActualLocation(actualLocation, sourceLocation, projection);
                if (federatedPath == null) federatedPath = actualLocation.getPath();

                // Add all the children from the source ...
                for (Location childInSource : readFromSource.getChildren()) {
                    request.addChild(getChildLocationWithCorrectSnsIndex(childInSource,
                                                                         federatedPath,
                                                                         childSnsIndexes,
                                                                         projection));
                }

                // Add all the properties ...
                for (Property propertyInSource : readFromSource.getProperties()) {
                    Name name = propertyInSource.getName();
                    Property existing = properties.get(name);
                    if (existing != null) {
                        // Merge the property values ...
                        propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                    }
                    properties.put(name, propertyInSource);
View Full Code Here

                Location sourceLocation = readFromSource.getActualLocationOfNode();
                if (sourceLocation.hasIdProperties()) {
                    // Accumulate the identification properties ...
                    for (Property propertyInSource : sourceLocation.getIdProperties()) {
                        Name name = propertyInSource.getName();
                        Property existing = actualLocation.getIdProperty(name);
                        if (existing != null) {
                            // Merge the property values ...
                            propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                        }
                        actualLocation = actualLocation.with(propertyInSource);
View Full Code Here

            if (sourceLocation.hasIdProperties()) {
                // Accumulate the identification properties ...
                for (Property propertyInSource : sourceLocation.getIdProperties()) {
                    Name name = propertyInSource.getName();
                    Property existing = actualLocation.getIdProperty(name);
                    if (existing != null) {
                        // Merge the property values ...
                        propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                    }
                    actualLocation = actualLocation.with(propertyInSource);
                }
            }

            // Add all the properties ...
            for (Property propertyInSource : readFromSource.getProperties()) {
                Name name = propertyInSource.getName();
                Property existing = properties.get(name);
                if (existing != null) {
                    // Merge the property values ...
                    propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                }
                properties.put(name, propertyInSource);
View Full Code Here

            if (sourceLocation.hasIdProperties()) {
                // Accumulate the identification properties ...
                for (Property propertyInSource : sourceLocation.getIdProperties()) {
                    Name name = propertyInSource.getName();
                    Property existing = actualLocation.getIdProperty(name);
                    if (existing != null) {
                        // Merge the property values ...
                        propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                    }
                    actualLocation = actualLocation.with(propertyInSource);
                }
            }

            // Add all the properties ...
            Property read = readFromSource.getProperty();
            if (read != null) {
                Property existing = request.getProperty();
                if (existing != null) {
                    // Merge the property values ...
                    request.setProperty(merge(existing, read, propertyFactory, true));
                } else {
                    request.setProperty(read);
View Full Code Here

            if (propertiesByName != null) {
                // Add the properties to any existing properties ...
                Map<Name, Property> propsByName = request.getPropertiesFor(parent);
                if (propsByName == null) propsByName = new HashMap<Name, Property>();
                for (Property property : propertiesByName.values()) {
                    Property existingProperty = propsByName.get(property.getName());
                    if (existingProperty != null) {
                        // Merge the property values ...
                        property = merge(existingProperty, property, propertyFactory, true);
                    }
                    propsByName.put(property.getName(), property);
                }
                request.setProperties(parent, propsByName.values());
            }
            return;
        }
        for (Path path : projection.getPathsInRepository(parent.getPath(), pathFactory)) {
            if (!path.isAtOrBelow(ancestorPath)) continue;

            // Determine the list of children ...
            Location parentInFederation = parent.with(path);
            if (children != null) {
                // Add the children to any existing children ...
                List<Location> existing = request.getChildren(parentInFederation);
                if (existing == null) existing = new ArrayList<Location>(children.size());
                for (Location child : children) {
                    Path childPath = pathFactory.create(path, child.getPath().getLastSegment());
                    existing.add(child.with(childPath));
                }
                request.setChildren(parentInFederation, existing);
            }

            // Set or update the properties ...
            if (propertiesByName != null) {
                Map<Name, Property> propsByName = request.getPropertiesFor(parentInFederation);
                if (propsByName == null) propsByName = new HashMap<Name, Property>();
                for (Property property : propertiesByName.values()) {
                    Property existingProperty = propsByName.get(property.getName());
                    if (existingProperty != null) {
                        // Merge the property values ...
                        property = merge(existingProperty, property, propertyFactory, true);
                    }
                    propsByName.put(property.getName(), property);
View Full Code Here

            Location sourceLocation = readFromSource.getActualLocationOfNode();
            if (sourceLocation.hasIdProperties()) {
                // Accumulate the identification properties ...
                for (Property propertyInSource : sourceLocation.getIdProperties()) {
                    Name name = propertyInSource.getName();
                    Property existing = actualLocation.getIdProperty(name);
                    if (existing != null) {
                        // Merge the property values ...
                        propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
                    }
                    actualLocation = actualLocation.with(propertyInSource);
View Full Code Here

        }

        protected Request toRequest() {
            if (pendingProperties.size() == 1) {
                Map.Entry<Name, Property> entry = pendingProperties.entrySet().iterator().next();
                Property property = entry.getValue();
                if (property == null) {
                    return new RemovePropertyRequest(location, workspaceName, entry.getKey());
                }
                return new SetPropertyRequest(location, workspaceName, property);
            }
View Full Code Here

                            return to(value.getLocation());
                        }

                        public BatchConjunction to( Location value ) {
                            Reference ref = (Reference)convertReferenceValue(value);
                            Property property = getContext().getPropertyFactory().create(propertyName, ref);
                            requestQueue.setProperty(location, getCurrentWorkspaceName(), property);
                            return nextRequests;
                        }

                        protected BatchConjunction toValue( Object value ) {
                            Property property = getContext().getPropertyFactory().create(propertyName, value);
                            requestQueue.setProperty(location, getCurrentWorkspaceName(), property);
                            return nextRequests;
                        }

                        public BatchConjunction to( String value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( int value ) {
                            return toValue(Integer.valueOf(value));
                        }

                        public BatchConjunction to( long value ) {
                            return toValue(Long.valueOf(value));
                        }

                        public BatchConjunction to( boolean value ) {
                            return toValue(Boolean.valueOf(value));
                        }

                        public BatchConjunction to( float value ) {
                            return toValue(Float.valueOf(value));
                        }

                        public BatchConjunction to( double value ) {
                            return toValue(Double.valueOf(value));
                        }

                        public BatchConjunction to( BigDecimal value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( Calendar value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( Date value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( DateTime value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( Name value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( Path value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( Reference value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( URI value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( UUID value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( Binary value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( byte[] value ) {
                            return toValue(value);
                        }

                        public BatchConjunction to( InputStream stream,
                                                    long approximateLength ) {
                            Binary value = getContext().getValueFactories().getBinaryFactory().create(stream, approximateLength);
                            return toValue(value);
                        }

                        public BatchConjunction to( Reader reader,
                                                    long approximateLength ) {
                            Binary value = getContext().getValueFactories().getBinaryFactory().create(reader, approximateLength);
                            return toValue(value);
                        }

                        public BatchConjunction to( Object value ) {
                            value = convertReferenceValue(value);
                            Property property = getContext().getPropertyFactory().create(propertyName, value);
                            requestQueue.setProperty(location, getCurrentWorkspaceName(), property);
                            return nextRequests;
                        }

                        public BatchConjunction to( Object firstValue,
                                                    Object... otherValues ) {
                            firstValue = convertReferenceValue(firstValue);
                            for (int i = 0, len = otherValues.length; i != len; ++i) {
                                otherValues[i] = convertReferenceValue(otherValues[i]);
                            }
                            Property property = getContext().getPropertyFactory().create(propertyName, firstValue, otherValues);
                            requestQueue.setProperty(location, getCurrentWorkspaceName(), property);
                            return nextRequests;
                        }

                        public BatchConjunction to( Object[] values ) {
                            for (int i = 0; i != values.length; ++i) {
                                values[i] = convertReferenceValue(values[i]);
                            }
                            Property property = getContext().getPropertyFactory().create(propertyName, values);
                            requestQueue.setProperty(location, getCurrentWorkspaceName(), property);
                            return nextRequests;
                        }

                        public BatchConjunction to( Iterable<?> values ) {
                            List<Object> valueList = new LinkedList<Object>();
                            for (Object value : values) {
                                value = convertReferenceValue(value);
                                valueList.add(value);
                            }
                            Property property = getContext().getPropertyFactory().create(propertyName, valueList);
                            requestQueue.setProperty(location, getCurrentWorkspaceName(), property);
                            return nextRequests;
                        }

                        public BatchConjunction to( Iterator<?> values ) {
                            List<Object> valueList = new LinkedList<Object>();
                            while (values.hasNext()) {
                                Object value = values.next();
                                valueList.add(value);
                            }
                            Property property = getContext().getPropertyFactory().create(propertyName, valueList);
                            requestQueue.setProperty(location, getCurrentWorkspaceName(), property);
                            return nextRequests;
                        }

                    };
View Full Code Here

            if (projectedNode.isPlaceholder()) {
                PlaceholderNode placeholder = projectedNode.asPlaceholder();
                // Create a request and set the results ...
                ReadPropertyRequest placeholderRequest = new ReadPropertyRequest(placeholder.location(), request.inWorkspace(),
                                                                                 request.named());
                Property property = placeholder.properties().get(request.named());
                placeholderRequest.setProperty(property);
                placeholderRequest.setActualLocationOfNode(placeholder.location());
                federatedRequest.add(placeholderRequest, true, true, null);
            } else if (projectedNode.isProxy()) {
                ProxyNode proxy = projectedNode.asProxy();
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.property.Property

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.