Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## network
Class FanInClient

    java.lang.Object
      java.lang.Thread
          network.FanInClient

All Implemented Interfaces:
  java.lang.Runnable

    public class FanInClient

extends java.lang.Thread

Purpose of this class is to provide services necessary for fan-in implementation of Reed-Solomon code. FanInClient listens and accepts data fragment, e.g. part of original file or one of its checksums. In eighter case, fragment is stored in repository and is downloaded or uploaded. Although this variant of client is more resource intensive than BroadcastClient it is less prone to network outages. In case any of FanIn clients comes down, other remain unaffected and it is sufficient to find other suitable FanIn clients, e.g. repository hosts. Client uses utility wide configuration read by ConfigurationReader, which must be initialized before this class is constructed.

See Also:
  `ConfigurationReader`

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Thread
`java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

Field Summary

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`FanInClient(java.lang.String fragmentName, java.net.Socket socket)` Constructs FanInClient listenning on specified port.

Method Summary
`int` | `getPort()` Returns port on which client listens.
`void` | `run()` Fires method responsible for listening for incoming traffic.
`void` | `setTimeout(int timeout)` Tries to set SO_TIMEOUT of socket waiting for connection.

Methods inherited from class java.lang.Thread
`activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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`

Constructor Detail

### FanInClient

    public FanInClient(java.lang.String fragmentName,
                       java.net.Socket socket)

  Constructs FanInClient listenning on specified port.

  Parameters:
    `fragmentName` - filename of checksum or part of file to be received
    `socket` - to listen on

Method Detail

### setTimeout

    public void setTimeout(int timeout)
                    throws java.net.SocketException

  Tries to set SO_TIMEOUT of socket waiting for connection.

  Parameters:
    `timeout` - timeout in miliseconds
  Throws:
    `java.net.SocketException` - if error in underlying protocol

### getPort

    public int getPort()

  Returns port on which client listens.

  Returns:
    port number

### run

    public void run()

  Fires method responsible for listening for incoming traffic.

  Specified by:
    `run` in interface `java.lang.Runnable`
  Overrides:
    `run` in class `java.lang.Thread`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD