Package org.qi4j.spi.entitystore

Examples of org.qi4j.spi.entitystore.EntityNotFoundException


                            for( StorageMetadata stored : storeContext.getBlobStore().list() )
                            {
                                Payload payload = storeContext.getBlobStore().getBlob( container, stored.getName() ).getPayload();
                                if( payload == null )
                                {
                                    throw new EntityNotFoundException( parseEntityReference( stored.getName() ) );
                                }
                                InputStream input = null;
                                try
                                {
                                    input = payload.openStream();
View Full Code Here


        {
            File f = getDataFile( entityReference );

            if( !f.exists() )
            {
                throw new EntityNotFoundException( entityReference );
            }

            byte[] serializedState = fetch( f );
            return new StringReader( new String( serializedState, "UTF-8" ) );
        }
View Full Code Here

                    throws EntityNotFoundException
                {
                    File dataFile = getDataFile( ref );
                    if( !dataFile.exists() )
                    {
                        throw new EntityNotFoundException( ref );
                    }
                    dataFile.delete();
                }
            } );
        }
View Full Code Here

        {
            Long stateIndex = getStateIndex( entityReference.identity() );

            if( stateIndex == null )
            {
                throw new EntityNotFoundException( entityReference );
            }

            byte[] serializedState = (byte[]) recordManager.fetch( stateIndex, serializer );

            if( serializedState == null )
            {
                throw new EntityNotFoundException( entityReference );
            }

            return new StringReader( new String( serializedState, "UTF-8" ) );
        }
        catch( IOException e )
View Full Code Here

            Key key = KeyFactory.createKey( entityKind, ref.toURI() );
            Entity entity = datastore.get( key );
            Text serializedState = (Text) entity.getProperty( "value" );
            if( serializedState == null )
            {
                throw new EntityNotFoundException( ref );
            }
            return new StringReader( serializedState.getValue() );
        }
        catch( com.google.appengine.api.datastore.EntityNotFoundException e )
        {
            e.printStackTrace();
            throw new EntityNotFoundException( ref );
        }
    }
View Full Code Here

            Bucket bucket = riakClient.fetchBucket( bucketKey ).execute();
            IRiakObject entity = bucket.fetch( entityReference.identity() ).execute();
            if( entity == null )
            {
                throw new EntityNotFoundException( entityReference );
            }
            String jsonState = entity.getValueAsString();
            return new StringReader( jsonState );

        }
View Full Code Here

                            {
                                super.close();
                                IRiakObject entity = bucket.fetch( ref.identity() ).execute();
                                if( entity == null )
                                {
                                    throw new EntityNotFoundException( ref );
                                }
                                bucket.store( ref.identity(), toString() ).execute();
                            }
                            catch( RiakException ex )
                            {
                                throw new EntityStoreException( "Unable to apply entity change: updateEntity", ex );
                            }
                        }

                    };
                }

                @Override
                public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
                    throws EntityNotFoundException
                {
                    try
                    {
                        IRiakObject entity = bucket.fetch( ref.identity() ).execute();
                        if( entity == null )
                        {
                            throw new EntityNotFoundException( ref );
                        }
                        bucket.delete( ref.identity() ).execute();
                    }
                    catch( RiakException ex )
                    {
View Full Code Here

      try
      {
         Versioned<byte[]> versioned = client.get(entityReference.identity());
         if (versioned == null)
         {
            throw new EntityNotFoundException(entityReference);
         }
         byte[] serializedState = versioned.getValue();
         return new StringReader(new String(serializedState, "UTF-8"));
      } catch (IOException e)
      {
View Full Code Here

            states.add( state );
            return state;
        }
        catch( com.google.appengine.api.datastore.EntityNotFoundException e )
        {
            throw new EntityNotFoundException( reference );
        }
    }
View Full Code Here

        throws EntityStoreException
    {
        final String serializedState = stringMap.get( ref.identity() );
        if( serializedState == null )
        {
            throw new EntityNotFoundException( ref );
        }
        return new StringReader( serializedState );
    }
View Full Code Here

TOP

Related Classes of org.qi4j.spi.entitystore.EntityNotFoundException

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.