Package org.apache.jackrabbit.oak.jcr.delegate

Examples of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate


                }

                NodeDelegate parent = dlg.getParent();
                while (parent != null) {
                    if (parent.getPropertyOrNull(lockOwner) != null) {
                        PropertyDelegate isDeep =
                                parent.getPropertyOrNull(lockIsDeep);
                        if (isDeep != null) {
                            PropertyState state = isDeep.getPropertyState();
                            if (!state.isArray() && state.getValue(BOOLEAN)) {
                                return true;
                            }
                        }
                    }
View Full Code Here


                        dlg.getParent()), sessionContext);
    }

    @Override
    public Calendar getCreated() throws RepositoryException {
        PropertyDelegate dlg = getPropertyOrThrow(JcrConstants.JCR_CREATED);
        return ValueFactoryImpl.createValue(dlg.getSingleState(), sessionContext).getDate();
    }
View Full Code Here

        return ValueFactoryImpl.createValues(p.getMultiState(), sessionContext);
    }

    @Override
    public Version[] getPredecessors() throws RepositoryException {
        PropertyDelegate p = getPropertyOrThrow(VersionConstants.JCR_PREDECESSORS);
        List<Version> predecessors = new ArrayList<Version>();
        VersionManagerDelegate vMgr = getVersionManagerDelegate();
        for (Value v : getValues(p)) {
            String id = v.getString();
            predecessors.add(new VersionImpl(vMgr.getVersionByIdentifier(id), sessionContext));
View Full Code Here

        return predecessors.toArray(new Version[predecessors.size()]);
    }

    @Override
    public Version[] getSuccessors() throws RepositoryException {
        PropertyDelegate p = getPropertyOrThrow(VersionConstants.JCR_SUCCESSORS);
        List<Version> successors = new ArrayList<Version>();
        VersionManagerDelegate vMgr = getVersionManagerDelegate();
        for (Value v : getValues(p)) {
            String id = v.getString();
            successors.add(new VersionImpl(vMgr.getVersionByIdentifier(id), sessionContext));
View Full Code Here

    }

    @Nonnull
    private PropertyDelegate getPropertyOrThrow(@Nonnull String name)
            throws RepositoryException {
        PropertyDelegate p = dlg.getPropertyOrNull(checkNotNull(name));
        if (p == null) {
            throw new RepositoryException("Inconsistent version storage. " +
                    "Version does not have a " + name + " property.");
        }
        return p;
View Full Code Here

    public NodeImpl createNodeOrNull(NodeDelegate nd) throws RepositoryException {
        if (nd == null) {
            return null;
        }
        PropertyDelegate pd = nd.getPropertyOrNull(JcrConstants.JCR_PRIMARYTYPE);
        String type = pd != null ? pd.getString() : null;
        if (JcrConstants.NT_VERSION.equals(type)) {
            VersionManagerDelegate delegate = VersionManagerDelegate.create(getSessionDelegate());
            return new VersionImpl(delegate.createVersion(nd), this);
        } else if (JcrConstants.NT_VERSIONHISTORY.equals(type)) {
            VersionManagerDelegate delegate = VersionManagerDelegate.create(getSessionDelegate());
View Full Code Here

    }

    public static NodeImpl<? extends NodeDelegate> createNode(
                NodeDelegate delegate, SessionContext context)
                throws RepositoryException {
        PropertyDelegate pd = delegate.getPropertyOrNull(JCR_PRIMARYTYPE);
        String type = pd != null ? pd.getString() : null;
        if (JcrConstants.NT_VERSION.equals(type)) {
            VersionManagerDelegate vmd =
                    VersionManagerDelegate.create(context.getSessionDelegate());
            return new VersionImpl(vmd.createVersion(delegate), context);
        } else if (JcrConstants.NT_VERSIONHISTORY.equals(type)) {
View Full Code Here

    public Property getProperty(String relPath) throws RepositoryException {
        final String oakPath = getOakPathOrThrowNotFound(relPath);
        return perform(new NodeOperation<PropertyImpl>(dlg) {
            @Override
            public PropertyImpl perform() throws RepositoryException {
                PropertyDelegate pd = node.getPropertyOrNull(oakPath);
                if (pd == null) {
                    throw new PathNotFoundException(
                            oakPath + " not found on " + node.getPath());
                } else {
                    return new PropertyImpl(pd, sessionContext);
View Full Code Here

                Iterable<Property> properties = Iterables.transform(
                        propertyOakPaths,
                        new Function<String, Property>() {
                            @Override
                            public Property apply(String oakPath) {
                                PropertyDelegate pd = sessionDelegate.getProperty(oakPath);
                                return pd == null ? null : new PropertyImpl(pd, sessionContext);
                            }
                        }
                );
View Full Code Here

            throws RepositoryException {
        final String oakName = getOakName(checkNotNull(jcrName));
        return perform(new ItemWriteOperation<Property>() {
            @Override
            public Property perform() throws RepositoryException {
                PropertyDelegate property = dlg.getPropertyOrNull(oakName);
                if (property != null) {
                    property.remove();
                } else {
                    // Return an instance which throws on access; see OAK-395
                    property = dlg.getProperty(oakName);
                }
                return new PropertyImpl(property, sessionContext);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

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.