Tabnine Logo
AnnotationServiceImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
AnnotationServiceImpl
in
com.oculusinfo.annotation.rest

Best Java code snippets using com.oculusinfo.annotation.rest.AnnotationServiceImpl (Showing top 13 results out of 315)

origin: unchartedsoftware/aperture-tiles

private void addDataToTiles( String layer, AnnotationData<?> data, TilePyramid pyramid ) {
  
  // get list of the indices for all levels
  List< TileAndBinIndices > indices = _indexer.getIndices( data, pyramid );
  // get all affected tiles
  List< AnnotationTile > tiles = readTilesFromIO( layer, convert( indices ) );
  // add new data certificate to tiles
  addDataCertificateToTiles( tiles, indices, data );
  // write tiles back to io
  writeTilesToIO( layer, tiles );    		
  // write data to io
  writeDataToIO( layer, data );
}

origin: unchartedsoftware/aperture-tiles

public List<List<AnnotationData<?>>> read( String layer, TileIndex index, JSONObject query ) {
  _lock.readLock().lock();
  try {
    LayerConfiguration config = getLayerConfiguration( layer, query );
    TilePyramid pyramid = config.produce( TilePyramid.class );
    AnnotationFilter filter = config.produce( AnnotationFilter.class );
    return getDataFromTiles( layer, index, filter, pyramid );
    
  } catch ( Exception e ) {
    throw new IllegalArgumentException( e.getMessage() );
  } finally { 		
    _lock.readLock().unlock();
  }
}

origin: unchartedsoftware/aperture-tiles

public void remove( String layer, Pair<String, Long> certificate ) throws IllegalArgumentException {
  _lock.writeLock().lock();
  try {
    LayerConfiguration config = getLayerConfiguration( layer, null );
    TilePyramid pyramid = config.produce(TilePyramid.class);
    /*
     *  ensure request is coherent with server state, if client is operating
     *  on a previous data state, prevent io corruption by throwing an exception
     */
    if ( isRequestOutOfDate( layer, certificate ) ) {
      throw new IllegalArgumentException("Client is out of sync with Server, "
                        + "REMOVE operation aborted. It is recommended "
                        + "upon receiving this exception to refresh all client annotations");
    }
    // remove the certificates from tiles
    removeDataFromTiles( layer, certificate, pyramid );
    // remove data from io
    removeDataFromIO( layer, certificate );
  } catch ( Exception e ) {
    throw new IllegalArgumentException( e.getMessage() );
  } finally {
    _lock.writeLock().unlock();
  }
}
origin: unchartedsoftware/aperture-tiles

private void removeDataFromTiles( String layer, Pair<String, Long> certificate, TilePyramid pyramid ) {
  // read the annotation data
  List< Pair<String, Long> > certificates = new ArrayList<>();
  certificates.add( certificate );
  AnnotationData<?> data = readDataFromIO( layer, certificates ).get(0);
  // get list of the indices for all levels
  List< TileAndBinIndices > indices = _indexer.getIndices( data, pyramid );
  // read existing tiles
  List< AnnotationTile > tiles = readTilesFromIO( layer, convert( indices ) );
  // maintain lists of what bins to modify and what bins to remove
  List< AnnotationTile > tilesToWrite = new LinkedList<>();
  List< TileIndex > tilesToRemove = new LinkedList<>();
  // remove data from tiles and organize into lists to write and remove
  removeDataCertificateFromTiles( tilesToWrite, tilesToRemove, tiles, data, pyramid );
  // write modified tiles
  writeTilesToIO( layer, tilesToWrite );		
  // remove empty tiles and data
  removeTilesFromIO( layer, tilesToRemove );
}
origin: unchartedsoftware/aperture-tiles

if ( isRequestOutOfDate( layer, annotation.getCertificate() ) ) {
  throw new IllegalArgumentException("Client is out of sync with Server, "
                    + "MODIFY operation aborted. It is recommended "
                    + "upon receiving this exception to refresh all client annotations");
LayerConfiguration config = getLayerConfiguration( layer, null );
TilePyramid pyramid = config.produce( TilePyramid.class );
removeDataFromTiles( layer, annotation.getCertificate(), pyramid );
addDataToTiles( layer, annotation, pyramid );
origin: unchartedsoftware/aperture-tiles

protected void writeTilesToIO( String layer, List< AnnotationTile > tiles ) {
  
  if ( tiles.size() == 0 ) return;
  
  try {
    LayerConfiguration config = getLayerConfiguration( layer, null );
    PyramidIO io = config.produce(PyramidIO.class);	
    TileSerializer<Map<String, List<Pair<String, Long>>>> serializer =
      SerializationTypeChecker.checkBinClass(config.produce(TileSerializer.class),
                          getRuntimeBinClass(),
                          getRuntimeTypeDescriptor());
    String dataId = config.getPropertyValue(LayerConfiguration.DATA_ID);
    io.writeTiles( dataId, serializer, AnnotationTile.convertToRaw( tiles ) );
        
  } catch ( Exception e ) {
    throw new IllegalArgumentException( e.getMessage() );
  }
  
}

origin: unchartedsoftware/aperture-tiles

try {
  LayerConfiguration config = getLayerConfiguration( layer, null );
  TilePyramid pyramid = config.produce( TilePyramid.class );
  if ( checkForCollision( layer, annotation ) ) {
    throw new IllegalArgumentException("Unable to generate UUID without collision, WRITE operation aborted");
  addDataToTiles( layer, annotation, pyramid );
origin: unchartedsoftware/aperture-tiles

protected void writeDataToIO( String layer, AnnotationData<?> data ) {
  
  List<AnnotationData<?>> dataList = new LinkedList<>();
  dataList.add( data );
  try {
    LayerConfiguration config = getLayerConfiguration( layer, null );
    AnnotationIO io = config.produce( AnnotationIO.class );
    String dataId = config.getPropertyValue(LayerConfiguration.DATA_ID);
    io.writeData( dataId, _dataSerializer, dataList );
  } catch ( Exception e ) {
    throw new IllegalArgumentException( e.getMessage() );
  }
}

origin: unchartedsoftware/aperture-tiles

AnnotationSerializer annotationSerializer = new JSONAnnotationDataSerializer();
_service = new AnnotationServiceImpl( _layerService,
 annotationSerializer,
 annotationIndexer,
origin: unchartedsoftware/aperture-tiles

protected List< AnnotationTile > readTilesFromIO( String layer, List<TileIndex> indices ) {
  List< AnnotationTile > tiles = new LinkedList<>();
  Set<TileIndex> readTiles = new HashSet<>();
  if ( indices.size() == 0 ) {
    return tiles;
  }
  
  try {
    LayerConfiguration config = getLayerConfiguration( layer, null );
    PyramidIO io = config.produce( PyramidIO.class );
    TileSerializer<Map<String, List<Pair<String, Long>>>> serializer =
      SerializationTypeChecker.checkBinClass(config.produce(TileSerializer.class),
                          getRuntimeBinClass(),
                          getRuntimeTypeDescriptor());
    String dataId = config.getPropertyValue(LayerConfiguration.DATA_ID);
    for ( AnnotationTile tile : AnnotationTile.convertFromRaw( io.readTiles(dataId, serializer, indices) ) ) {
      if (!readTiles.contains(tile.getDefinition())) {
        readTiles.add(tile.getDefinition());
        tiles.add(tile);
      }
    }
        
  } catch ( Exception e ) {
    throw new IllegalArgumentException( e.getMessage() );
  }
  return tiles;		
}

origin: unchartedsoftware/aperture-tiles

protected void removeDataFromIO( String layer, Pair<String, Long> data ) {
  
  List<Pair<String, Long>> dataList = new LinkedList<>();
  dataList.add( data );
  try {
    LayerConfiguration config = getLayerConfiguration( layer, null );
    AnnotationIO io = config.produce( AnnotationIO.class );
    String dataId = config.getPropertyValue(LayerConfiguration.DATA_ID);
    io.removeData( dataId, dataList );
    
  } catch ( Exception e ) {
    throw new IllegalArgumentException( e.getMessage() );
  }
}

origin: unchartedsoftware/aperture-tiles

protected void removeTilesFromIO( String layer, List<TileIndex> tiles ) {
  if ( tiles.size() == 0 ) {
    return;
  }
  
  try {
    LayerConfiguration config = getLayerConfiguration( layer, null );
    PyramidIO io = config.produce( PyramidIO.class );
    String dataId = config.getPropertyValue(LayerConfiguration.DATA_ID);
    io.removeTiles( dataId, tiles );
    
  } catch ( Exception e ) {
    throw new IllegalArgumentException( e.getMessage() );
  }
}

origin: unchartedsoftware/aperture-tiles

  protected List<AnnotationData<?>> readDataFromIO( String layer, List<Pair<String,Long>> certificates ) {
    
    List<AnnotationData<?>> data = new LinkedList<>();
    
    if ( certificates.size() == 0 ) {
      return data;
    }
    
    try {

      LayerConfiguration config = getLayerConfiguration( layer, null );
      String dataId = config.getPropertyValue(LayerConfiguration.DATA_ID);
      AnnotationIO io = config.produce( AnnotationIO.class );
      data = io.readData( dataId, _dataSerializer, certificates );
      
    } catch ( Exception e ) {
      throw new IllegalArgumentException( e.getMessage() );
    }

    return data;
  }
}
com.oculusinfo.annotation.restAnnotationServiceImpl

Most used methods

  • <init>
  • addDataCertificateToTiles
  • addDataToTiles
  • checkForCollision
  • convert
  • getDataFromTiles
  • getLayerConfiguration
  • getRuntimeBinClass
  • getRuntimeTypeDescriptor
  • isRequestOutOfDate
  • mergeQueryConfigOptions
    Wraps the options and query JSONObjects together into a new object.
  • readDataFromIO
  • mergeQueryConfigOptions,
  • readDataFromIO,
  • readTilesFromIO,
  • removeDataCertificateFromTiles,
  • removeDataFromIO,
  • removeDataFromTiles,
  • removeTilesFromIO,
  • writeDataToIO,
  • writeTilesToIO

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now