Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.TreeLocation


        } else {
            return dlg.perform(new SessionOperation<PropertyImpl>() {
                @Override
                public PropertyImpl perform() throws RepositoryException {
                    String oakPath = dlg.getOakPathOrThrowNotFound(absPath);
                    TreeLocation loc = dlg.getLocation(oakPath);
                    if (loc.getProperty() == null) {
                        throw new PathNotFoundException(absPath);
                    }
                    else {
                        return new PropertyImpl(new PropertyDelegate(dlg, loc));
                    }
View Full Code Here


        } else {
            return dlg.perform(new SessionOperation<Boolean>() {
                @Override
                public Boolean perform() throws RepositoryException {
                    String oakPath = dlg.getOakPathOrThrowNotFound(absPath);
                    TreeLocation loc = dlg.getLocation(oakPath);
                    return loc.getProperty() != null;
                }
            });
        }
    }
View Full Code Here

     * @return  tree location of the underlying item
     * @throws InvalidItemStateException if the location points to a stale item
     */
    @Nonnull
    public TreeLocation getLocation() throws InvalidItemStateException {
        TreeLocation location = getLocationOrNull();
        if (location == null) {
            throw new InvalidItemStateException("Item is stale");
        }
        return location;
    }
View Full Code Here

        return getLocation().getProperty()// Not null
    }

    @Override
    public PropertyLocation getLocation() throws InvalidItemStateException {
        TreeLocation location = super.getLocation();
        if (location.getProperty() == null) {
            throw new InvalidItemStateException("Property is stale");
        }
        return (PropertyLocation) location;
    }
View Full Code Here

     * @param path Oak path
     * @return  The {@code PropertyDelegate} at {@code path} or {@code null} if
     * none exists or not accessible.
     */
    public PropertyDelegate getProperty(String path) {
        TreeLocation location = root.getLocation(path);
        return location.getProperty() == null
            ? null
            : new PropertyDelegate(this, location);
    }
View Full Code Here

     * @return  property at the path given by {@code relPath} or {@code null} if
     * no such property exists
     */
    @CheckForNull
    public PropertyDelegate getProperty(String relPath) throws InvalidItemStateException {
        TreeLocation propertyLocation = getChildLocation(relPath);
        PropertyState propertyState = propertyLocation.getProperty();
        return propertyState == null
                ? null
                : new PropertyDelegate(sessionDelegate, propertyLocation);
    }
View Full Code Here

     * @return  node at the path given by {@code relPath} or {@code null} if
     * no such node exists
     */
    @CheckForNull
    public NodeDelegate getChild(String relPath) throws InvalidItemStateException {
        TreeLocation childLocation = getChildLocation(relPath);
        return create(sessionDelegate, childLocation);
    }
View Full Code Here

                });
    }

    private Iterator<PropertyDelegate> propertyDelegateIterator(
            Iterator<? extends PropertyState> properties) throws InvalidItemStateException {
        final TreeLocation location = getLocation();
        return Iterators.transform(
                Iterators.filter(properties, new Predicate<PropertyState>() {
                    @Override
                    public boolean apply(PropertyState property) {
                        return !property.getName().startsWith(":");
                    }
                }),
                new Function<PropertyState, PropertyDelegate>() {
                    @Override
                    public PropertyDelegate apply(PropertyState propertyState) {
                        return new PropertyDelegate(sessionDelegate, location.getChild(propertyState.getName()));
                    }
                });
    }
View Full Code Here

    private final SessionDelegate sessionDelegate;

    private final ReadWriteVersionManager versionManager;

    static VersionManagerDelegate create(SessionDelegate sessionDelegate) {
        TreeLocation location = sessionDelegate.getRoot().getLocation(VERSION_STORAGE_PATH);
        return new VersionManagerDelegate(sessionDelegate, location);
    }
View Full Code Here

        return property;
    }

    @Nonnull
    private PropertyLocation getPropertyLocation() throws InvalidItemStateException {
        TreeLocation location = getLocation();
        if (!(location instanceof PropertyLocation)) {
            throw new InvalidItemStateException();
        }
        return (PropertyLocation) location;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.api.TreeLocation

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.