Codota Logo
FeatureStoreTransaction
Code IndexAdd Codota to your IDE (free)

How to use
FeatureStoreTransaction
in
org.deegree.feature.persistence

Best Java code snippets using org.deegree.feature.persistence.FeatureStoreTransaction (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: deegree/deegree3

private static void insert( FeatureStore fs, String datasetFile, GMLVersion gmlVersion, IDGenMode mode )
            throws XMLStreamException, FactoryConfigurationError, IOException, XMLParsingException,
            UnknownCRSException, FeatureStoreException {
  File f = new File( datasetFile );
  URL url = f.toURI().toURL();
  System.out.print( "- Reading dataset: '" + datasetFile + "'..." );
  GMLStreamReader gmlReader = GMLInputFactory.createGMLStreamReader( gmlVersion, url );
  gmlReader.setApplicationSchema( fs.getSchema() );
  FeatureCollection fc = gmlReader.readFeatureCollection();
  System.out.println( "done." );
  FeatureStoreTransaction ta = null;
  try {
    ta = fs.acquireTransaction();
    System.out.print( "- Inserting features..." );
    List<String> fids = ta.performInsert( fc, mode );
    System.out.println( "done." );
    for ( String fid : fids ) {
      System.out.println( "- Inserted: " + fid );
    }
    System.out.println( "\n- Insert succeeded (" + fids.size() + " features). Committing transaction." );
    ta.commit();
  } catch ( Exception e ) {
    e.printStackTrace();
    System.err.println( "Error performing insert: " + e.getMessage() );
    if ( ta != null ) {
      ta.rollback();
    }
  }
}
origin: deegree/deegree3

  int fids = ta.performInsert( fc, USE_EXISTING ).size();
  LOG.info( "Inserted " + fids + " features." );
  ta.commit();
} catch ( Exception e ) {
  String msg = Messages.getMessage( "STORE_MANAGER_STORE_SETUP_ERROR", e.getMessage() );
origin: deegree/deegree3

ta.commit();
try {
  LOG.debug( "Rolling back feature store transaction:" + ta );
  ta.rollback();
} catch ( FeatureStoreException e1 ) {
  LOG.debug( "Error occured during rollback: " + e.getMessage(), e );
try {
  LOG.debug( "Rolling back feature store transaction:" + ta );
  ta.rollback();
} catch ( FeatureStoreException e1 ) {
  LOG.debug( "Error occured during rollback: " + e.getMessage(), e );
try {
  LOG.debug( "Rolling back feature store transaction:" + ta );
  ta.rollback();
} catch ( FeatureStoreException e1 ) {
  LOG.debug( "Error occured during rollback: " + e.getMessage(), e );
try {
  LOG.debug( "Rolling back feature store transaction:" + ta );
  ta.rollback();
} catch ( FeatureStoreException e1 ) {
  LOG.debug( "Error occured during rollback: " + e.getMessage(), e );
origin: deegree/deegree3

List<String> newFids = ta.performInsert( fc, mode );
for ( String newFid : newFids ) {
  inserted.add( newFid, insert.getHandle() );
origin: deegree/deegree3

private void doDelete( Delete delete, Lock lock )
            throws OWSException {
  LOG.debug( "doDelete: " + delete );
  QName ftName = delete.getTypeName();
  FeatureStore fs = service.getStore( ftName );
  if ( fs == null ) {
    throw new OWSException( Messages.get( "WFS_FEATURE_TYPE_NOT_SERVED", ftName ), INVALID_PARAMETER_VALUE );
  }
  FeatureStoreTransaction ta = acquireTransaction( fs );
  Filter filter = delete.getFilter();
  // superimpose default query CRS
  Filters.setDefaultCRS( filter, master.getDefaultQueryCrs() );
  try {
    switch ( filter.getType() ) {
    case ID_FILTER: {
      deleted += ta.performDelete( (IdFilter) filter, lock );
      break;
    }
    case OPERATOR_FILTER: {
      deleted += ta.performDelete( ftName, (OperatorFilter) filter, lock );
      break;
    }
    }
  } catch ( FeatureStoreException e ) {
    throw new OWSException( Messages.get( "WFS_ERROR_PERFORMING_DELETE", e.getMessage() ), NO_APPLICABLE_CODE );
  }
}
origin: deegree/deegree3

private void doReplace( Replace replace, Lock lock )
            throws OWSException {
  LOG.debug( "doReplace: " + replace );
  XMLStreamReader xmlStream = replace.getReplacementFeatureStream();
  QName ftName = xmlStream.getName();
  FeatureStore fs = service.getStore( ftName );
  if ( fs == null ) {
    throw new OWSException( Messages.get( "WFS_FEATURE_TYPE_NOT_SERVED", ftName ), INVALID_PARAMETER_VALUE );
  }
  Feature replacementFeature = null;
  Filter filter = null;
  try {
    GMLStreamReader gmlReader = createGMLStreamReader( GML_32, xmlStream );
    gmlReader.setApplicationSchema( fs.getSchema() );
    replacementFeature = gmlReader.readFeature();
    filter = replace.getFilter();
    // superimpose default CRS
    Filters.setDefaultCRS( filter, master.getDefaultQueryCrs() );
  } catch ( Exception e ) {
    throw new OWSException( e.getMessage(), INVALID_PARAMETER_VALUE );
  }
  FeatureStoreTransaction ta = acquireTransaction( fs );
  try {
    String newFid = ta.performReplace( replacementFeature, filter, lock, idGenMode );
    replaced.add( newFid, replace.getHandle() );
  } catch ( FeatureStoreException e ) {
    throw new OWSException( "Error performing replace: " + e.getMessage(), e, NO_APPLICABLE_CODE );
  }
}
origin: deegree/deegree3

private void doUpdate( Update update, Lock lock )
            throws OWSException {
  LOG.debug( "doUpdate: " + update );
  QName ftName = update.getTypeName();
  FeatureType ft = service.lookupFeatureType( ftName );
  FeatureStore fs = service.getStore( ftName );
  if ( fs == null ) {
    throw new OWSException( Messages.get( "WFS_FEATURE_TYPE_NOT_SERVED", ftName ), INVALID_PARAMETER_VALUE );
  }
  GMLVersion inputFormat = determineFormat( request.getVersion(), update.getInputFormat() );
  FeatureStoreTransaction ta = acquireTransaction( fs );
  List<ParsedPropertyReplacement> replacementProps = getReplacementProps( update, ft, inputFormat );
  Filter filter = null;
  try {
    filter = update.getFilter();
    // superimpose default query CRS
    Filters.setDefaultCRS( filter, master.getDefaultQueryCrs() );
  } catch ( Exception e ) {
    throw new OWSException( e.getMessage(), INVALID_PARAMETER_VALUE );
  }
  try {
    List<String> updatedFids = ta.performUpdate( ftName, replacementProps, filter, lock );
    for ( String updatedFid : updatedFids ) {
      this.updated.add( updatedFid, update.getHandle() );
    }
  } catch ( FeatureStoreException e ) {
    throw new OWSException( "Error performing update: " + e.getMessage(), e, NO_APPLICABLE_CODE );
  }
}
org.deegree.feature.persistenceFeatureStoreTransaction

Javadoc

Provides transactional access to a FeatureStore.

Please note that a transaction must always be ended by calling either #commit() or #rollback().

Most used methods

  • commit
    Makes the changes persistent that have been performed in this transaction and releases the transacti
  • performInsert
    Inserts the given FeatureCollection into the FeatureStore (including subfeatures).
  • rollback
    Aborts the changes that have been performed in this transaction and releases the transaction instanc
  • performDelete
    Deletes the features from the FeatureStore that are matched by the given filter.
  • performReplace
    Performs a replace operation against the FeatureStore.
  • performUpdate
    Performs an update operation against the FeatureStore.

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now