Package org.apache.slide.structure

Examples of org.apache.slide.structure.ObjectNode


            super.createObject(uri, object);
        }
        else {
            ResourceId resourceId = ResourceId.createNew(uri);
            object.setUuri(resourceId.getUuri());
            ObjectNode objectClone = object.cloneObject();
            objectClone.setUri(resourceId.getUuri()); // switch to uuri
            cacheResolve(uri, resourceId);
            resourceId.getStore().createObject(resourceId, objectClone);
        }
    }
View Full Code Here


        if (uri instanceof ResourceId) {
            super.removeObject(uri, object);
        }
        else {
            ResourceId resourceId = obtainResourceId(uri);
            ObjectNode objectClone = object.cloneObject();
            objectClone.setUri(resourceId.getUuri()); // switch to uuri
            resourceId.getStore().removeObject(resourceId, objectClone);
        }
    }
View Full Code Here

        if (uri instanceof ResourceId) {
            return super.retrieveRevisionDescriptor(uri, revisionNumber);
        }
        else {
            try {
                ObjectNode objectNode = doRetrieveObjectNode(uri);
                ResourceId resourceId = obtainResourceId(uri);
                NodeRevisionDescriptor nrd = resourceId.getStore().retrieveRevisionDescriptor(resourceId, revisionNumber);
                nrd.setProperty("resource-id", resourceId.asXml());
                nrd.setProperty("parent-set", getXmlParentSet(uri, objectNode));
                return nrd;
View Full Code Here

    }
   
    private ObjectNode doRetrieveObjectNode(Uri uri)
        throws ServiceAccessException, ObjectNotFoundException  {
       
        ObjectNode result;
        if (Configuration.useBinding(this)) {
            result = doResolve(uri);
            result.setUuri(result.getUri());
            result.setUri(uri.toString()); // switch to uri
        } else {
            ResourceId resourceId = ResourceId.create(uri, uri.toString());
            result = resourceId.getStore().retrieveObject(resourceId);
            result.setUuri(result.getUri());
        }
        return result;
    }
View Full Code Here

           
            for (int i = start; i < segments.length; i++) {
                // cacheResolve(currentUri, currentResourceId);
                // TODO: make it work with caching here :-(
               
                ObjectNode objectNode = currentResourceId.getStore().retrieveObject(currentResourceId);
                objectNode.setUri(currentUriStr);
                currentUriStr = uriPath.subUriPath(0, i + 1).toString();
                currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
                String currentUuri = objectNode.getBindingUuri(segments[i]);
                if (currentUuri == null) {
                    throw new ObjectNotFoundException(currentUriStr);
                }
                currentResourceId = ResourceId.create(currentUri, currentUuri);
            }
View Full Code Here

        }
        return resourceId;
    }
   
    private ResourceId obtainResourceId(Uri uri) throws ServiceAccessException, ObjectNotFoundException {
        ObjectNode objectNode = doRetrieveObjectNode(uri);
        ResourceId resourceId = ResourceId.create(uri, objectNode.getUuri());
        return resourceId;
    }
View Full Code Here

     * @exception ObjectNotFoundException The object to retrieve was not found
     */
    public ObjectNode retrieveObject(Connection connection, Uri uri)
        throws ServiceAccessException, ObjectNotFoundException {

        ObjectNode result = null;
        PreparedStatement statement = null;

        try {

            statement =
View Full Code Here

            try {
                Object tempObject = objectsCache.get(uri.toString());
                if (tempObject != null) {
                    return ((ObjectNode) tempObject).cloneObject();
                } else {
                    ObjectNode objectNode = super.retrieveObject(uri);
                    objectNode.validate(uri.toString());
                    objectsCache.put(uri.toString(), objectNode);
                    return objectNode.cloneObject();
                }
            } finally {
                if (isForceStoreEnlistment(uri)) {
                    delist(this);
                }
View Full Code Here

            try {
               
                if (object instanceof LinkNode) {
                    // add the link into the "linked" object if it is in the cache
                   String linkedUri = ((LinkNode) object).getLinkedUri();
                   ObjectNode linkedObject = (ObjectNode) objectsCache.get(linkedUri);
                   if (linkedObject != null) {
                       linkedObject.addLink((LinkNode)object);
                   }
                }
                objectsCache.put(uri.toString(), object.cloneObject());
            } finally {
                delist(this);
View Full Code Here

        if (nodeStore.cacheResults()) {
            enlist(this);
            try {
                if (object instanceof LinkNode) {
                    // check if the linked object is in the cache, and remove the linknode  fromits link vector
                    ObjectNode linkedObject = (ObjectNode) objectsCache.get(((LinkNode)object).getLinkedUri());
                    if (linkedObject !=null) {
                        linkedObject.removeLink((LinkNode) object);
                    }
                }
                objectsCache.remove(uri.toString());
            } finally {
                delist(this);
View Full Code Here

TOP

Related Classes of org.apache.slide.structure.ObjectNode

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.