dods.servers.agg
Class DODSDataset

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

public class DODSDataset
extends Dataset

This is a proxy for a dataset on another DODS server.

Version:
$Id: DODSDataset.java,v 1.3 2004/02/06 15:23:49 donm Exp $
Author:
John Caron

Nested Class Summary
static class DODSDataset.DODSFactory
          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.
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 unlimited.


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 you got it. if false, return if cannot acquire
Returns:
locked dataset, or null if no room in cache for it.
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()
Specified by:
close in class Dataset