@Override public String toString() { return identity.toString(); } }
public void setIdentity( Identity identity ) { if( identity == null ) { return; } this.identity = identity.toString(); }
public void setIdentity( Identity identity ) { if( identity == null ) { return; } this.identity = identity.toString(); }
private void removeEntity( EntityState state, PreparedStatement ps ) throws SQLException { ps.setString( 1, state.entityReference().identity().toString() ); ps.addBatch(); }
private File diskStorePath() { String stringIdentity = identity.identity().get().toString(); if( fileConfiguration != null ) { return new File( fileConfiguration.cacheDirectory(), stringIdentity ); } return new File( System.getProperty( "java.io.tmpdir" ), stringIdentity ); }
@Override public Reader get( EntityReference entityReference ) throws EntityStoreException { byte[] state = db.get( entityReference.identity().toString().getBytes( charset ) ); if( state == null ) { throw new EntityNotFoundException( entityReference ); } String jsonState = new String( state, charset ); return new StringReader( jsonState ); }
private Bson byIdentity( EntityReference entityReference ) { return eq( IDENTITY_COLUMN, entityReference.identity().toString() ); } }
private String cacheManagerThreadPoolName( String name ) { return identity.identity().get().toString() + "-" + name; } }
@Override public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor ) throws EntityNotFoundException { stringMap.remove( ref.identity().toString() ); } } );
@Override public boolean contains( EntityReference entityReference ) { return indexOfReference( entityReference.identity().toString() ) != -1; }
public boolean isActive() { Class<?> mainType = serviceDescriptor.types().findFirst().orElse( null ); ServiceReference<?> first = module.findServices( mainType ) .filter( withId( serviceDescriptor.identity().toString() ) ) .findFirst().orElse( null ); return first != null && first.isActive(); }
public boolean isAvailable() { Class<?> mainType = serviceDescriptor.types().findFirst().orElse( null ); ServiceReference<?> first = module.findServices( mainType ) .filter( withId( serviceDescriptor.identity().toString() ) ) .findFirst().orElse( null ); return first != null && first.isAvailable(); }
@Override public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor ) throws EntityNotFoundException { if( !blobStore.blobExists( container, ref.identity().toString() ) ) { throw new EntityNotFoundException( ref ); } blobStore.removeBlob( container, ref.identity().toString() ); } }
@SuppressWarnings( "SameParameterValue" ) protected void addEntityInfoToInsertToEntityTablePS( EntityState state, PreparedStatement ps, int startingIndex ) throws SQLException { ps.setString( startingIndex, state.entityReference().identity().toString() ); ps.setTimestamp( startingIndex + 1, Timestamp.from( state.lastModified() ) ); ps.setString( startingIndex + 2, state.version() ); ps.setString( startingIndex + 3, this._app.version() ); }
@Override public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor ) { operations.add( dsl.deleteFrom( table ) .where( identityColumn.equal( ref.identity().toString() ) ) ); } } );
@Override public boolean remove( EntityReference entityReference ) { int refIndex = indexOfReference( entityReference.identity().toString() ); if( refIndex != -1 ) { entityState.stateCloneRemoveManyAssociation( stateName, entityReference ); entityState.markUpdated(); return true; } return false; }
@Override public Reader get( EntityReference entityReference ) { String state = dsl.select( stateColumn ) .from( table ) .where( identityColumn.equal( entityReference.identity().toString() ) ) .fetchOptional( stateColumn ) .orElseThrow( () -> new EntityNotFoundException( entityReference ) ); return new StringReader( state ); }
@Override public EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, ModuleDescriptor module, EntityReference reference ) { return queryFor( cluster.entityRetrieveStatement().bind( reference.identity().toString() ), module, reference ); }
@Override public File locateAttachedFile() { File baseDir = spi.entityDescriptorFor( meAsIdentity ).metaInfo( File.class ); return new File( baseDir, meAsIdentity.identity().get().toString() ); } }
private SomeType createEntity( UnitOfWork uow, Identity identity ) { EntityBuilder<SomeType> builder = uow.newEntityBuilder( SomeType.class, identity ); builder.instance().name().set( identity.toString() ); return builder.newInstance(); }