Examples of ResourceIDImpl


Examples of org.geotools.filter.identity.ResourceIdImpl

        final Date date1 = dateParser.parseDateTime("1977-01-17T01:05:40Z").getTime();
        final Date date2 = dateParser.parseDateTime("2011-07-29T23:49:40Z").getTime();
        FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);

        // This is in consistent as the FIRST entry cannot have a previous1
        ResourceIdImpl resourceId =  new ResourceIdImpl("rid1", "abc", new Version(FIRST));
        resourceId.setPreviousRid("previous1");
        assertEquals( resourceId.getID(), ids.get(0).getID());
       
        assertEquals(ff.resourceId("rid2", "", new Version(LAST)).getID(),
                     ids.get(1).getID());
        assertEquals(ff.resourceId("rid3", "", new Version(PREVIOUS)).getID(),
                     ids.get(2).getID());
        assertEquals(ff.resourceId("rid4", "", new Version(NEXT)).getID(),
                     ids.get(3).getID());
        assertEquals(ff.resourceId("rid5", "", new Version(ALL)).getID(),
                     ids.get(4).getID());
       
        // This is inconsistent as date and resource based query cannot be used at the same time
        ResourceIdImpl resourceId2 =  new ResourceIdImpl("rid6", "", new Version(4));
        resourceId2.setPreviousRid("previous2");
        resourceId2.setStartTime(date1);
        resourceId2.setEndTime(date2);
        assertEquals( resourceId2.getID(),
                      ids.get(5).getID());
       
        assertEquals(ff.resourceId("rid7", "123"new Version(date1)).getID(), ids.get(6).getID());
    }
View Full Code Here

Examples of org.geotools.filter.identity.ResourceIdImpl

        return f.id(new LinkedHashSet<Identifier>(Arrays.asList(
            f.featureId("foo.1"), f.featureId("foo.2"), f.featureId("foo.3"))));
    }
   
    public static Id resourceId() {
        ResourceIdImpl resourceId = new ResourceIdImpl("foo.4","", new Version(Version.Action.NEXT));
       
        resourceId.setPreviousRid("previousRid");
        resourceId.setStartTime( new Date(1000) );
        resourceId.setEndTime(new Date(2000));

        Integer testInt = new Integer(1234567890);
       
        return f.id(new LinkedHashSet<Identifier>(Arrays.asList(
                f.featureId("foo.1", "v1"),
View Full Code Here

Examples of org.geotools.filter.identity.ResourceIdImpl

        return new FeatureIdVersionedImpl(fid, featureVersion);
    }

    /** ResouceId for identifier based query */
    public ResourceId resourceId(String fid, String featureVersion, Version version ){
        return new ResourceIdImpl(fid, featureVersion, version);
    }
View Full Code Here

Examples of org.geotools.filter.identity.ResourceIdImpl

        return new ResourceIdImpl(fid, featureVersion, version);
    }
   
    /** ResourceId for time based query */
    public ResourceId resourceId(String fid, Date startTime, Date endTime){
        return new ResourceIdImpl(fid, startTime, endTime );
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.ResourceIDImpl

     * @throws RegistryException if an error occurs while retrieving resource data.
     */
    public static ResourceImpl getResourceWithMinimumData(String path, ResourceDAO resourceDAO,
                                                          boolean versioned)
            throws RegistryException {
        ResourceIDImpl resourceID = resourceDAO.getResourceID(path);
        if (resourceID == null) {
            return null;
        }
        ResourceImpl resourceImpl;
        if (resourceID.isCollection()) {
            resourceImpl = new CollectionImpl();
        } else {
            resourceImpl = new ResourceImpl();
        }
        if (versioned) {
            resourceImpl.setVersionNumber(resourceDAO.getVersion(resourceID));
        } else {
            resourceImpl.setName(resourceID.getName());
            resourceImpl.setPathID(resourceID.getPathID());
        }
        resourceImpl.setPath(path);
        return resourceImpl;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.ResourceIDImpl

                    "name for a resource.");
        }

        String purePath = RegistryUtils.getPureResourcePath(path);

        ResourceIDImpl resourceID =
                resourceDAO.getResourceID(purePath, resource instanceof CollectionImpl);
        boolean resourceExists = false;
        if (resourceID != null) {

            // existence of the resource id doesn't mean the existence of the
            // resource, so need to verify resource existence

            // load the meta data for the existing resource
            ResourceDO oldResourceDO = resourceDAO.getResourceDO(resourceID);

            if (oldResourceDO != null) {
                // the resource does exists
                resourceExists = true;
                prepareUpdate(resource, resourceID, oldResourceDO);
                update(resourceID, (ResourceImpl) resource, oldResourceDO);
            }
        }
        if (!resourceExists) {

            // now we are checking whether there is an entry with the inverse type
            ResourceIDImpl inverseResourceID = resourceDAO.getResourceID(purePath,
                    !(resource instanceof CollectionImpl));
            if (inverseResourceID != null) {
                ResourceDO inverseResourceDO = resourceDAO.getResourceDO(inverseResourceID);
                if (inverseResourceDO != null) {
                    // well, in fact there is an inverse type => we are deleting the resource
View Full Code Here

Examples of org.wso2.carbon.registry.core.ResourceIDImpl

     */
    public void delete(String path) throws RegistryException {

        path = RegistryUtils.getPureResourcePath(path);

        ResourceIDImpl resourceID = resourceDAO.getResourceID(path);
        ResourceDO resourceDO = resourceDAO.getResourceDO(resourceID);
        if (resourceDO == null) {
            boolean isCollection = resourceID.isCollection();
            // then we will check for non-collections as the getResourceID only check the collection
            // exist
            if (isCollection) {
                resourceID = resourceDAO.getResourceID(path, false);
                if (resourceID != null) {
View Full Code Here

Examples of org.wso2.carbon.registry.core.ResourceIDImpl

     */
    public void prepareVersionRestore(String path) throws RegistryException {

        path = RegistryUtils.getPureResourcePath(path);

        ResourceIDImpl resourceID = resourceDAO.getResourceID(path);
        ResourceDO resourceDO = resourceDAO.getResourceDO(resourceID);
        if (resourceDO == null) {
            boolean isCollection = resourceID.isCollection();
            // then we will check for non-collections as the getResourceID only check the collection
            // exist
            if (isCollection) {
                resourceID = resourceDAO.getResourceID(path, false);
                if (resourceID != null) {
View Full Code Here

Examples of org.wso2.carbon.registry.core.ResourceIDImpl

     * @throws RegistryException if the operation failed.
     */
    public void prepareDumpRestore(String path) throws RegistryException {
        path = RegistryUtils.getPureResourcePath(path);

        ResourceIDImpl resourceID = resourceDAO.getResourceID(path);
        ResourceDO resourceDO = resourceDAO.getResourceDO(resourceID);
        if (resourceDO == null) {
            boolean isCollection = resourceID.isCollection();
            // then we will check for non-collections as the getResourceID only check the collection
            // exist
            if (isCollection) {
                resourceID = resourceDAO.getResourceID(path, false);
                if (resourceID != null) {
View Full Code Here

Examples of org.wso2.carbon.registry.core.ResourceIDImpl


        // prepare the target parent path
        String targetParentPath = RegistryUtils.getParentPath(newPath);
        // first create a parent path for the target if doesn't exist
        ResourceIDImpl targetParentResourceID = resourceDAO.getResourceID(targetParentPath, true);
        if (targetParentResourceID == null || !resourceDAO.resourceExists(targetParentResourceID)) {
            addEmptyCollection(targetParentPath);
            if (targetParentResourceID == null) {
                targetParentResourceID = resourceDAO.getResourceID(targetParentPath, true);
            }
        } else if (!AuthorizationUtils.authorize(targetParentPath, ActionConstants.PUT)) {
            String msg = "Resource Move failed. User " +
                    CurrentSession.getUser() + " is not authorized to update " +
                    "the parent collection of target " + targetParentPath + ".";
            log.warn(msg);
            throw new AuthorizationFailedException(msg);
        }

        // get the source resource
        ResourceImpl sourceResource = (ResourceImpl) getMetaData(oldPath);
        if (sourceResource == null) {
            throw new ResourceNotFoundException(oldPath);
        }
        ResourceIDImpl sourceID = sourceResource.getResourceIDImpl();

        if (!(sourceResource instanceof CollectionImpl)) {
            prepareMove(oldPath, newPath);
            // get the source resource
            // just rename the resource + all the community features.
            ResourceIDImpl targetID = resourceDAO.getResourceID(newPath, false);
            if (targetID == null) {
                // create resourceID
                targetID = resourceDAO.createResourceID(newPath, targetParentResourceID, false);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.