Package org.qi4j.spi.entitystore

Examples of org.qi4j.spi.entitystore.EntityNotFoundException


        throws EntityStoreException
    {
        String state = store.get( entityReference );
        if( state == null )
        {
            throw new EntityNotFoundException( entityReference );
        }

        return new StringReader( state );
    }
View Full Code Here


                    super.close();
                    String old = store.put( ref, toString() );
                    if( old == null )
                    {
                        store.remove( ref );
                        throw new EntityNotFoundException( ref );
                    }
                }
            };
        }
View Full Code Here

        throws EntityStoreException
    {
        byte[] state = db.get( entityReference.identity().getBytes( charset ) );
        if( state == null )
        {
            throw new EntityNotFoundException( entityReference );
        }
        String jsonState = new String( state, charset );
        return new StringReader( jsonState );
    }
View Full Code Here

        db.requestStart();

        DBObject entity = db.getCollection( collectionName ).findOne( byIdentity( entityReference ) );
        if( entity == null )
        {
            throw new EntityNotFoundException( entityReference );
        }
        DBObject bsonState = (DBObject) entity.get( STATE_COLUMN );

        db.requestDone();
View Full Code Here

                throws EntityNotFoundException
            {
                DBObject entity = entities.findOne( byIdentity( ref ) );
                if( entity == null )
                {
                    throw new EntityNotFoundException( ref );
                }
                entities.remove( entity, writeConcern );
            }
        } );
View Full Code Here

        try
        {
            String jsonState = jedis.get( entityReference.identity() );
            if( notFound( jsonState ) )
            {
                throw new EntityNotFoundException( entityReference );
            }
            return new StringReader( jsonState );
        }
        finally
        {
View Full Code Here

                        {
                            super.close();
                            String statusCode = jedis.set( ref.identity(), toString(), "XX" );
                            if( !"OK".equals( statusCode ) )
                            {
                                throw new EntityNotFoundException( ref );
                            }
                        }
                    };
                }

                @Override
                public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
                    throws EntityNotFoundException
                {
                    String jsonState = jedis.get( ref.identity() );
                    if( notFound( jsonState ) )
                    {
                        throw new EntityNotFoundException( ref );
                    }
                    jedis.del( ref.identity() );
                }
            } );
        }
View Full Code Here

            ps = database.prepareGetEntityStatement( connection );
            database.populateGetEntityStatement( ps, ref );
            rs = ps.executeQuery();
            if( !rs.next() )
            {
                throw new EntityNotFoundException( ref );
            }

            EntityValueResult result = database.getEntityValue( rs );

            return result;
View Full Code Here

        throws EntityStoreException
    {
        Blob blob = storeContext.getBlobStore().getBlob( container, entityReference.identity() );
        if( blob == null )
        {
            throw new EntityNotFoundException( entityReference );
        }
        Payload payload = blob.getPayload();
        if( payload == null )
        {
            throw new EntityNotFoundException( entityReference );
        }
        InputStream input = null;
        try
        {
            input = payload.openStream();
View Full Code Here

                public Writer updateEntity( final EntityReference ref, EntityDescriptor entityDescriptor )
                    throws IOException
                {
                    if( !blobStore.blobExists( container, ref.identity() ) )
                    {
                        throw new EntityNotFoundException( ref );
                    }
                    return new StringWriter()
                    {
                        @Override
                        public void close()
                        throws IOException
                        {
                            super.close();
                            Blob blob = blobStore.blobBuilder( ref.identity() )
                                .payload( ByteSource.wrap( toString().getBytes( UTF_8 ) ) )
                                .build();
                            blobStore.putBlob( container, blob );
                        }
                    };
                }

                @Override
                public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
                    throws EntityNotFoundException
                {
                    if( !blobStore.blobExists( container, ref.identity() ) )
                    {
                        throw new EntityNotFoundException( ref );
                    }
                    blobStore.removeBlob( container, ref.identity() );
                }
            }
        );
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.