edu.ucsb.nceas.metacat
Class DataFileServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--edu.ucsb.nceas.metacat.DataFileUploadInterface
              |
              +--edu.ucsb.nceas.metacat.DataFileServer
All Implemented Interfaces:
java.lang.Runnable

public class DataFileServer
extends edu.ucsb.nceas.metacat.DataFileUploadInterface


Field Summary
protected  java.net.Socket s
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DataFileServer(int port, java.lang.String user, java.lang.String sess_id)
           
 
Method Summary
 void getFile(int port, java.lang.String user, java.lang.String sess_id)
           
static java.net.Socket getSocket(java.lang.String host, int port)
          attempts to connect a socket, returns null if it is not successful returns the connected socket if it is successful.
static boolean portIsAvailable(int port)
          returns true if the port specified is not in use.
 void run()
          This method is invoked when this class is broken off into a new thread
 void updateDB(java.lang.String accnum, java.lang.String filename, java.lang.String userOwner)
          Updates xml_documents with the new data document information
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s

protected java.net.Socket s
Constructor Detail

DataFileServer

public DataFileServer(int port,
                      java.lang.String user,
                      java.lang.String sess_id)
Method Detail

getFile

public void getFile(int port,
                    java.lang.String user,
                    java.lang.String sess_id)

run

public void run()
This method is invoked when this class is broken off into a new thread
Overrides:
run in class java.lang.Thread

getSocket

public static java.net.Socket getSocket(java.lang.String host,
                                        int port)
attempts to connect a socket, returns null if it is not successful returns the connected socket if it is successful.

portIsAvailable

public static boolean portIsAvailable(int port)
returns true if the port specified is not in use. false otherwise

updateDB

public void updateDB(java.lang.String accnum,
                     java.lang.String filename,
                     java.lang.String userOwner)
Updates xml_documents with the new data document information
Parameters:
accnum - the accession number of the new data file
filename - the filename of the new data file
userOwner - the document's owner's username


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.