stsci.factory
Class WebFactory

java.lang.Object
  |
  +--stsci.factory.Factory
        |
        +--stsci.factory.WebFactory
Direct Known Subclasses:
ArcObjFactory, GenericFactory, PlanarImageFactory, PlateFactory

public abstract class WebFactory
extends Factory

Read objects from a web feed, Subclasses must implement certain abstract methods to make this work e.g. getUrl and nextObj. This just handles opening the stream from the url instaed of from disk e.g. open is overridden here.


Field Summary
protected  boolean local
           
 
Fields inherited from class stsci.factory.Factory
dstream, finished, name, opened
 
Constructor Summary
WebFactory()
           
WebFactory(java.lang.String url)
           
 
Method Summary
 boolean finished()
          Is the factory exhausted.
abstract  java.lang.String getCmd()
          The id and different parameters to the command will be differnt for each system.
abstract  java.lang.String getURL()
          The id and different parameters to the web page will be differnt for each system.
 void open()
          Override open to open the url.
 boolean openCmd(java.lang.String cmd)
          Run a given command and parse the output.
 boolean openURL(java.lang.String url)
          Open given url in the dstream member.
 void setLocal()
          Set this factory to use a local command instead of a web page
protected  void skipToData()
          Skip down the data stream to where the data is by defulat this is until we hit a PRE tag - but sub-classes may override this.
 
Methods inherited from class stsci.factory.Factory
nextObj, openDisk, setFinished
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

local

protected boolean local
Constructor Detail

WebFactory

public WebFactory(java.lang.String url)

WebFactory

public WebFactory()
Method Detail

setLocal

public void setLocal()
Set this factory to use a local command instead of a web page

getURL

public abstract java.lang.String getURL()
The id and different parameters to the web page will be differnt for each system. This abstarct method will be called to get the URL which should be opened.

openURL

public boolean openURL(java.lang.String url)
Open given url in the dstream member. This is a convenience funtion.

skipToData

protected void skipToData()
Skip down the data stream to where the data is by defulat this is until we hit a PRE tag - but sub-classes may override this.

open

public void open()
Override open to open the url. This calls getURL so the subclass can specify the exact URL it needs.
Overrides:
open in class Factory

finished

public boolean finished()
Description copied from class: Factory
Is the factory exhausted. typically a client will have a while !finished loop on the factory. In this case this will be when the dstream is no longer ready.
Overrides:
finished in class Factory

openCmd

public boolean openCmd(java.lang.String cmd)
Run a given command and parse the output.

getCmd

public abstract java.lang.String getCmd()
The id and different parameters to the command will be differnt for each system. This abstarct method will be called to get the Command which should be executed.