Package org.apache.stanbol.entityhub.servicesapi.yard

Examples of org.apache.stanbol.entityhub.servicesapi.yard.Yard


        }
    }

    @Override
    public void setBaseMappings(FieldMapper fieldMapper) throws YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            if (isAvailable()) {
                FieldMapper old = this.baseMapper;
View Full Code Here


        }
    }

    @Override
    public void remove(Iterable<String> ids) throws IllegalArgumentException, YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            yard.remove(ids);
        }
    }
View Full Code Here

            yard.remove(ids);
        }
    }
    @Override
    public void removeAll() throws YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            //ensure that the baseConfig (if present) is not deleted by this
            //operation
            Representation baseConfig = yard.getRepresentation(Cache.BASE_CONFIGURATION_URI);
            yard.removeAll();
            if(baseConfig != null){
                yard.store(baseConfig);
            }
        }
    }
View Full Code Here

        }
    }
   
    @Override
    public Iterable<Representation> store(Iterable<Representation> representations) throws IllegalArgumentException, YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.store(representations);
        }
    }
View Full Code Here

        }
    }

    @Override
    public Iterable<Representation> update(Iterable<Representation> representations) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.update(representations);
        }
    }
View Full Code Here

     *
     * @return the Yard used by this Cache or <code>null</code> if currently not
     *         available.
     */
    public Yard getCacheYard() {
        Yard yard = (Yard) yardTracker.getService();
        if (yard != null && !initWithYard) {
            try {
                initWithCacheYard(yard);
            } catch (YardException e) {
                //this case can be recovered because initWithYard will not be
View Full Code Here

     * Cache!
     * --------------------------------------------------------------------------
     */
    @Override
    public Representation store(Representation representation) throws IllegalArgumentException, YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.store(applyCacheMappings(yard, representation));
        }
    }
View Full Code Here

        }
    }

    @Override
    public Representation update(Representation representation) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.update(applyCacheMappings(yard, representation));
        }
    }
View Full Code Here

     * Methods that forward calls to the Yard configured for this Cache
     * --------------------------------------------------------------------------
     */
    @Override
    public Representation create() throws YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            return createRepresentation(null);
        } else {
            return yard.create();
        }
    }
View Full Code Here

        }
    }

    @Override
    public Representation create(String id) throws IllegalArgumentException, YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            return createRepresentation(id);
        } else {
            return yard.create(id);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.yard.Yard

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.