Package org.apache.lucene.gdata.storage

Examples of org.apache.lucene.gdata.storage.ModificationConflictException


    private void createSemaphore(String key)
            throws ModificationConflictException {
        this.semaphore.add(key);
        if (this.container.ext().setSemaphore(key, 0))
            return;
        throw new ModificationConflictException(
                "can not create semaphore for key -- " + key);
    }
View Full Code Here


        DB4oEntry persistentEntry = getInternalEntry(entry.getId());
        // lock the entry to prevent concurrent access
        createSemaphore(entry.getId());
        refreshPersistentObject(persistentEntry);
        if(persistentEntry.getVersion() != entry.getVersion())
            throw new ModificationConflictException(
                    "Current version does not match given version  -- currentVersion: "+persistentEntry.getVersion()+"; given Version: "+entry.getVersion() );
        BaseFeed<BaseFeed, BaseEntry> feed = getFeedOnly(entry.getFeedId(),entry.getServiceType());
        refreshPersistentObject(feed);
        DateTime time = DateTime.now();
        if (persistentEntry.getEntry().getUpdated() != null)
View Full Code Here

        DB4oEntry persistentEntry = getInternalEntry(entry.getId());
        // lock the entry to prevent concurrent access
        createSemaphore(entry.getId());
        refreshPersistentObject(persistentEntry);
        if(persistentEntry.getVersion() != entry.getVersion())
            throw new ModificationConflictException(
                    "Current version does not match given version  -- currentVersion: "+persistentEntry.getVersion()+"; given Version: "+entry.getVersion() );
       
        setUpdated(entry, persistentEntry);
        BaseFeed<BaseFeed, BaseEntry> feed = getFeedOnly(entry.getFeedId(),entry.getServiceType());
        refreshPersistentObject(feed);
View Full Code Here

        try{
        if(query.get().isEntryStored(entry.getId(),entry.getFeedId())){
            if(query.get().checkEntryVersion(entry.getId(),entry.getFeedId(),entry.getVersion())){
                modifier.deleteEntry(new StorageEntryWrapper(entry,StorageOperation.DELETE));
            }else
                throw new ModificationConflictException("The entry version does not match -- entry "+entry.getId()+" feed:"+entry.getFeedId()+" version: "+entry.getVersion());
        }
        else
            throw new ResourceNotFoundException("Entry for entry id: "+entry.getId()+" is not stored");
        }catch (IOException e) {
            throw new StorageException("Can not access storage");
View Full Code Here

                    entry.setVersion(entry.getVersion()+1);
                    StorageEntryWrapper wrapper = new StorageEntryWrapper(entry,
                            StorageOperation.UPDATE)
                    modifier.updateEntry(wrapper);
                }else
                    throw new ModificationConflictException("The entry version does not match -- entry "+entry.getId()+" feed:"+entry.getFeedId()+" version: "+entry.getVersion());
             
            }else
                throw new ResourceNotFoundException("Entry for entry id: "+entry.getId()+" is not stored");
           
        } catch (IOException e) {
View Full Code Here

        return entry.getEntry();

    }
    private void setLock(String key) throws ModificationConflictException{
        if(!this.controller.getLock().setLock(key))
            throw new ModificationConflictException("Can not set lock for entry -- "+key);
           
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.gdata.storage.ModificationConflictException

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.