Examples of StorageException


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

     * @see org.apache.lucene.gdata.storage.lucenestorage.StorageModifier#updateEntry(org.apache.lucene.gdata.storage.lucenestorage.StorageEntryWrapper)
     */
    @Override
    public void updateEntry(StorageEntryWrapper wrapper) throws StorageException {
        if(throwException)
            throw new StorageException();
        if(wrapper != null)
            wrapper.getEntry();
    }
View Full Code Here

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

     * @see org.apache.lucene.gdata.storage.lucenestorage.StorageModifier#updateFeed(org.apache.lucene.gdata.storage.lucenestorage.StorageFeedWrapper)
     */
    @Override
    public void updateFeed(StorageFeedWrapper wrapper) throws StorageException {
        if(throwException)
            throw new StorageException();  
       
    }
View Full Code Here

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

     *             if the entry can not be stored
     */
    public void updateEntry(StorageEntryWrapper wrapper)
            throws StorageException {
        if(wrapper.getOperation() != StorageOperation.UPDATE)
            throw new StorageException("Illegal method call -- updateEntry does not accept other storageOperations than update");
        this.lock.lock();
        try {
           
            Term tempTerm = new Term(StorageEntryWrapper.FIELD_ENTRY_ID,
                    wrapper.getEntryId());
View Full Code Here

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

     *             if the entry can not be stored
     */
    public void insertEntry(StorageEntryWrapper wrapper)
            throws StorageException {
        if(wrapper.getOperation() != StorageOperation.INSERT)
            throw new StorageException("Illegal method call -- insertEntry does not accept other storage operations than insert");
        this.lock.lock();
        try {
            this.documentMap.put(wrapper.getEntryId(), wrapper
                    .getLuceneDocument());
            storageModified();
View Full Code Here

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

     *
     */
    public void deleteEntry(final StorageEntryWrapper wrapper)
            throws StorageException {
        if(wrapper.getOperation() != StorageOperation.DELETE)
            throw new StorageException("Illegal method call -- insertEntry does not accept other storage operations than delete");
        this.lock.lock();
        try {
           
            Term tempTerm = new Term(StorageEntryWrapper.FIELD_ENTRY_ID,
                    wrapper.getEntryId());
View Full Code Here

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

            this.modifiedCounter = 0;
        } catch (IOException e) {

            LOG.error("Writing persistent index failed - Recovering", e);
            throw new StorageException("could not write to storage index -- "+e.getMessage(),e);
        }
      
    }
View Full Code Here

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

    public StorageCoreControllerStub() throws IOException, StorageException {
        try{
            this.idGenerator = new IDGenerator(5);
        }catch (NoSuchAlgorithmException e) {
            throw new StorageException(e);
        }
      
    }
View Full Code Here

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

       
        try {
            return this.idGenerator.getUID();
        } catch (InterruptedException e) {
           
          throw new StorageException(e);
        }
    }
View Full Code Here

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

            } catch (Exception e) {
                LOG.warn("Can not parse timestamp from entry -- "
                        + h.doc(0).get(StorageEntryWrapper.FIELD_TIMESTAMP));
            }
        else
            throw new StorageException("Entry not found");
        return 0;

    }
View Full Code Here

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

    /**
     * @see org.apache.lucene.gdata.storage.Storage#storeEntry(org.apache.lucene.gdata.data.ServerBaseEntry)
     */
    public BaseEntry storeEntry(ServerBaseEntry entry) throws StorageException {
        if (entry == null)
            throw new StorageException("Can not store entry -- is null");

        if (entry.getFeedId() == null)
            throw new StorageException("can not store entry -- feed id is null");
        if (LOG.isDebugEnabled())
            LOG.debug("Storing entry for feed: " + entry.getFeedId());
        BaseFeed<BaseFeed, BaseEntry> feed = getFeedOnly(entry.getFeedId(),entry.getServiceType());
       refreshPersistentObject(feed);
        try {
            StringBuilder idBuilder = new StringBuilder(entry.getFeedId());
            idBuilder.append(this.controller.releaseId());
            entry.setId(idBuilder.toString());
        } catch (StorageException e) {
            LOG.error("Can not create uid for entry -- " + e.getMessage(), e);
            throw new StorageException("Can not create uid for entry -- "
                    + e.getMessage(), e);

        }
        setUpdated(entry, feed);
        DB4oEntry intEntry = new DB4oEntry();
        intEntry.setEntry(entry.getEntry());
        intEntry.setUpdateTime(entry.getUpdated().getValue());
        intEntry.setFeedId(feed.getId());
        intEntry.setVersion(entry.getVersion());

      
        try {
            this.container.set(feed);
            this.container.set(intEntry);
            this.container.commit();
        } catch (Exception e) {
            LOG
                    .error("Error occured on persisting changes -- rollback changes");
            this.container.rollback();
            throw new StorageException("Can not persist changes -- "
                    + e.getMessage(), e);
        }
        if (LOG.isInfoEnabled())
            LOG.info("Stored Entry for entryID: " + entry.getId()
                    + " -- feedID: " + entry.getFeedId());
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.