dods.servers.netcdf
Class NcDataset

java.lang.Object
  extended by dods.servers.agg.Dataset
      extended by dods.servers.netcdf.NcDataset
All Implemented Interfaces:
GuardedDataset

public class NcDataset
extends Dataset


Nested Class Summary
static class NcDataset.NetcdfFactory
          This is public as an artifact of implementing an interface.
 
Method Summary
static Dataset acquire(String extPath, String intPath, InvCatalog.Dataset invDS, boolean block)
          This finds the named dataset and gets a lock on it.
 void close()
           
static Iterator getCache()
           
static int getCacheSize()
          get current size of the cache.
protected  DDS getClientDDS()
           
 DAS getDAS()
          Get the DAS for this Dataset.
 ServerDDS getDDS()
          Get the DDS for this Dataset.
 NetcdfFile getNetcdfFile()
           
 boolean isClosed()
           
static void setCacheMax(int maxCached)
          set the size of the open dataset cache.
static void setWaitTime(long wait)
          set maximum time to wait before opening another copy of the dataset.
 
Methods inherited from class dods.servers.agg.Dataset
acquire, attempt, getCatalogDataset, getExternalPath, getInternalPath, isLockedByMe, release, setDebug, whoHasLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCacheMax

public static void setCacheMax(int maxCached)
set the size of the open dataset cache. Default is 100.


setWaitTime

public static void setWaitTime(long wait)
set maximum time to wait before opening another copy of the dataset.

Parameters:
wait - : time in msec

getCacheSize

public static int getCacheSize()
get current size of the cache.


getCache

public static Iterator getCache()

acquire

public static Dataset acquire(String extPath,
                              String intPath,
                              InvCatalog.Dataset invDS,
                              boolean block)
                       throws IOException
This finds the named dataset and gets a lock on it. This is the only way to obtain an NcDataset object. WARNING: you better call ds.release() when you are done or you are SOL!!!

Parameters:
extPath - : external URL of dataset
intPath - : internal URL of dataset
invDS - : InvCatalog.Dataset object
block - : if true, dont return till acquired. if false, return if cannot acquire
Returns:
locked dataset, or null if no room in cache for it (can only happen if block == false)
Throws:
IOException

getDDS

public ServerDDS getDDS()
Description copied from interface: GuardedDataset
Get the DDS for this Dataset.

Specified by:
getDDS in interface GuardedDataset
Specified by:
getDDS in class Dataset
Returns:
the ServerDDS

getDAS

public DAS getDAS()
Description copied from interface: GuardedDataset
Get the DAS for this Dataset.

Specified by:
getDAS in interface GuardedDataset
Specified by:
getDAS in class Dataset
Returns:
the DAS

getClientDDS

protected DDS getClientDDS()
Specified by:
getClientDDS in class Dataset

close

public void close()
           throws IOException
Specified by:
close in class Dataset
Throws:
IOException

isClosed

public boolean isClosed()

getNetcdfFile

public NetcdfFile getNetcdfFile()