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

How to use
LockingManager
in
org.geotools.data

Best Java code snippets using org.geotools.data.LockingManager (Showing top 20 results out of 315)

origin: geotools/geotools

  public void lockFeatureID(
      String typeName, String authID, Transaction transaction, FeatureLock featureLock)
      throws IOException {
    DataStore store = cache.getDataStore(typeName, false);

    if ((store != null) && (store.getLockingManager() != null)) {
      store.getLockingManager().lockFeatureID(typeName, authID, transaction, featureLock);
    }
  }
}
origin: geotools/geotools

public void unLockFeatureID(
    String typeName, String authID, Transaction transaction, FeatureLock featureLock)
    throws IOException {
  DataStore store = cache.getDataStore(typeName, false);
  if ((store != null) && (store.getLockingManager() != null)) {
    store.getLockingManager().unLockFeatureID(typeName, authID, transaction, featureLock);
  }
}
origin: geotools/geotools

public boolean release(String authID, Transaction transaction) throws IOException {
  List<DataStore> stores = cache.getDataStores();
  for (DataStore store : stores) {
    if ((store.getLockingManager() != null) && store.getLockingManager().exists(authID)) {
      return store.getLockingManager().release(authID, transaction);
    }
  }
  return false;
}
origin: geotools/geotools

public boolean refresh(String authID, Transaction transaction) throws IOException {
  List<DataStore> stores = cache.getDataStores();
  for (DataStore store : stores) {
    if ((store.getLockingManager() != null) && store.getLockingManager().exists(authID)) {
      return store.getLockingManager().refresh(authID, transaction);
    }
  }
  return false;
}
origin: geotools/geotools

/**
 * Check if a lock exists in any of the DataStores.
 *
 * @param lockID
 */
public boolean lockExists(String lockID) {
  if (lockID == null) {
    return false;
  }
  LockingManager lockManager;
  for (DataAccess<?, ?> access : repository.values()) {
    DataStore store = (DataStore) access;
    lockManager = store.getLockingManager();
    if (lockManager == null) {
      continue; // did not support locking
    }
    if (lockManager.exists(lockID)) {
      return true;
    }
  }
  return false;
}
origin: geotools/geotools

if (lockManager == null) continue; // did not support locking
if (lockManager.release(lockID, transaction)) {
  release = true;
origin: org.geoserver/gs-wfs

t.addAuthorization(lockId);
if (lockingManager.refresh(lockId, t)) {
  refresh = true;
origin: org.geotools/gt-directory

/**
 * @see org.geotools.data.LockingManager#refresh(java.lang.String,
 *      org.geotools.data.Transaction)
 */
public boolean refresh(String authID, Transaction transaction)
  throws IOException {
  Iterator i = dataStores.values().iterator();
  while (i.hasNext()) {
    AbstractFileDataStore afds = (AbstractFileDataStore) i.next();
    if ((afds.getLockingManager() != null)
        && afds.getLockingManager().exists(authID)) {
      return afds.getLockingManager().refresh(authID, transaction);
    }
  }
  return false;
}
origin: geotools/geotools

public boolean exists(String authID) {
  List<DataStore> stores = cache.getDataStores();
  for (DataStore store : stores) {
    if ((store.getLockingManager() != null) && store.getLockingManager().exists(authID)) {
      return true;
    }
  }
  return false;
}
origin: geotools/geotools

  continue; // did not support locking
if (lockManager.release(lockID, transaction)) {
  refresh = true;
origin: org.geoserver/gs-wfs

  t.addAuthorization(fLock.getAuthorization());
  DataStore dataStore = (DataStore) source.getDataStore();
  dataStore.getLockingManager().refresh(fLock.getAuthorization(), t);
} finally {
  t.commit();
origin: geotools/geotools

private void createManyLocks() throws IOException {
  for (int count = 0; count < JDBCDataStore.MAX_IDS_IN_FILTER + 1; count++) {
    dataStore
        .getLockingManager()
        .lockFeatureID(
            SAMPLE_FEATURE_NAME,
            count + "",
            tx,
            new FeatureLock(count + "", 10000000L));
  }
}
origin: geotools/geotools

/** Unlocks features specified by a filter. */
public final void unLockFeatures(Filter filter) throws IOException {
  filter = resolvePropertyNames(filter);
  String typeName = getSchema().getTypeName();
  FeatureReader<SimpleFeatureType, SimpleFeature> reader = getReader(filter);
  try {
    while (reader.hasNext()) {
      SimpleFeature feature = reader.next();
      //
      // Use native locking?
      //
      if (canLock()) {
        doUnlockInternal(typeName, feature);
      } else {
        getDataStore()
            .getLockingManager()
            .unLockFeatureID(typeName, feature.getID(), transaction, lock);
      }
    }
  } finally {
    reader.close();
  }
}
origin: org.geotools/gt-directory

/**
 * @see org.geotools.data.LockingManager#release(java.lang.String,
 *      org.geotools.data.Transaction)
 */
public boolean release(String authID, Transaction transaction)
  throws IOException {
  Iterator i = dataStores.values().iterator();
  while (i.hasNext()) {
    AbstractFileDataStore afds = (AbstractFileDataStore) i.next();
    if ((afds.getLockingManager() != null)
        && afds.getLockingManager().exists(authID)) {
      return afds.getLockingManager().release(authID, transaction);
    }
  }
  return false;
}
origin: org.geotools/gt-directory

public boolean refresh(String authID, Transaction transaction)
  throws IOException {
  List<DataStore> stores = cache.getDataStores();
  for (DataStore store : stores) {
    if ((store.getLockingManager() != null)
        && store.getLockingManager().exists(authID)) {
      return store.getLockingManager().refresh(authID, transaction);
    }
  }
  return false;
}
origin: org.geotools/gt-main

/**
 * Check if a lock exists in any of the DataStores.
 * 
 * @param lockID
 */
public boolean lockExists(String lockID) {
  if (lockID == null){
    return false;
  }
  LockingManager lockManager;
  for ( DataAccess<?,?> access : repository.values() ){
    DataStore store = (DataStore) access;
    lockManager = store.getLockingManager();
    if (lockManager == null){
      continue; // did not support locking
    }
    if (lockManager.exists(lockID)) {
      return true;
    }
  }
  return false;
}
origin: org.geotools/gt2-main

if( lockManager == null ) continue; // did not support locking
if( lockManager.release( lockID, transaction )){
  release = true;    
origin: geotools/geotools

private void createLock() throws IOException {
  dataStore
      .getLockingManager()
      .lockFeatureID(
          SAMPLE_FEATURE_NAME,
          SAMPLE_FEATURE_ID,
          tx,
          new FeatureLock(SAMPLE_FEATURE_ID, 10000000L));
}
origin: org.geotools/gt-directory

/**
 * @see org.geotools.data.LockingManager#unLockFeatureID(java.lang.String,
 *      java.lang.String, org.geotools.data.Transaction,
 *      org.geotools.data.FeatureLock)
 */
public void unLockFeatureID(String typeName, String authID,
  Transaction transaction, FeatureLock featureLock)
  throws IOException {
  AbstractFileDataStore afds = (AbstractFileDataStore) dataStores.get(typeName);
  if ((afds != null) && (afds.getLockingManager() != null)) {
    afds.getLockingManager().unLockFeatureID(typeName, authID,
      transaction, featureLock);
  }
}
origin: org.geotools/gt-directory

public boolean release(String authID, Transaction transaction)
  throws IOException {
  List<DataStore> stores = cache.getDataStores();
  for (DataStore store : stores) {
    if ((store.getLockingManager() != null)
        && store.getLockingManager().exists(authID)) {
      return store.getLockingManager().release(authID, transaction);
    }
  }
  return false;
}
org.geotools.dataLockingManager

Javadoc

This class describes a featureID based locking service.

ContentFeatureSource, and others, may use this API to request locks on the basis of FeatureID.

This class is also used as a public api to manage locks.

Most used methods

  • lockFeatureID
    FeatureID based locking.
  • unLockFeatureID
    FeatureID based unlocking.
  • exists
    Check if any locks exist held by the authorization lockID. (remember that the lock may have expired)
  • release
    Release locks held by the authorization lockID. (remember that the lock may have expired)
  • refresh
    Refresh locks held by the authorization lockID. All features locked with the provied lockID will be

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Notification (javax.management)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top Sublime Text plugins
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