Package org.globus.ftp

# Class Session

java.lang.Object
org.globus.ftp.Session

Direct Known Subclasses:
  `GridFTPSession`

public class Session extends Object
Represents parameters of an FTP session between a client and a server. For instance, a third party transfer will be represented by two sessions: one between the client and the server A, and the other between the client and the server B.
Public static variables are interpreted as follows:

- prefix TYPE denotes transfer type
- prefix MODE denotes transfer mode
- prefix SERVER denotes server mode

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`authorized`
`static final int`
`DEFAULT_MAX_WAIT`
`static final int`
`DEFAULT_WAIT_DELAY`
`FeatureList`
`featureList`
`int`
`maxWait`
This variable directly affects only the client.
`static final int`
`MODE_BLOCK`
`static final int`
`MODE_STREAM`
`int`
`protectionBufferSize`
`static final int`
`SERVER_ACTIVE`
`static final int`
`SERVER_DEFAULT`
`static final int`
`SERVER_PASSIVE`
`HostPort`
`serverAddress`
`int`
`serverMode`
Can be SERVER_PASSIVE, SERVER_ACTIVE, or SERVER_DEFAULT.
`int`
`transferMode`
`int`
`transferType`
`static final int`
`TYPE_ASCII`
`static final int`
`TYPE_EBCDIC`
`static final int`
`TYPE_IMAGE`
`static final int`
`TYPE_LOCAL`
`int`
`waitDelay`
This variable directly affects only the client.

## Constructor Summary

Constructors
Constructor
Description
`Session()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`compareServerMode(Session other)`
checks that active / passive sides are correctly set
`protected void`
`compareTransferParams(Session other)`
defines how to compare parameters: authorized, PBSZ, MODE, TYPE
`void`
`matches(Session other)`
Ensures that settings of 2 servers match each other so that the servers are capable of performing a transfer between themselves.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### TYPE_IMAGE

public static final int TYPE_IMAGE

See Also:
  - Constant Field Values

### TYPE_ASCII

public static final int TYPE_ASCII

See Also:
  - Constant Field Values

### TYPE_LOCAL

public static final int TYPE_LOCAL

See Also:
  - Constant Field Values

### TYPE_EBCDIC

public static final int TYPE_EBCDIC

See Also:
  - Constant Field Values

### MODE_STREAM

public static final int MODE_STREAM

See Also:
  - Constant Field Values

### MODE_BLOCK

public static final int MODE_BLOCK

See Also:
  - Constant Field Values

### SERVER_PASSIVE

public static final int SERVER_PASSIVE

See Also:
  - Constant Field Values

### SERVER_ACTIVE

public static final int SERVER_ACTIVE

See Also:
  - Constant Field Values

### SERVER_DEFAULT

public static final int SERVER_DEFAULT

See Also:
  - Constant Field Values

### transferMode

public int transferMode

### transferType

public int transferType

### serverMode

public int serverMode
Can be SERVER_PASSIVE, SERVER_ACTIVE, or SERVER_DEFAULT. The latter means that the mode has not been set explicitly, so the server should act as default: passive on the standard port L-1.

### protectionBufferSize

public int protectionBufferSize

### authorized

public boolean authorized

### featureList

public FeatureList featureList

### serverAddress

public HostPort serverAddress

### DEFAULT_MAX_WAIT

public static final int DEFAULT_MAX_WAIT

See Also:
  - Constant Field Values

### DEFAULT_WAIT_DELAY

public static final int DEFAULT_WAIT_DELAY

See Also:
  - Constant Field Values

### maxWait

public int maxWait
This variable directly affects only the client. After requesting data transfer, client will wait on the control channel maxWait miliseconds, polling for replies every waitDelay seconds. If reply does not arrive after maxWait, client will abort.

### waitDelay

public int waitDelay
This variable directly affects only the client. After requesting data transfer, client will wait on the control channel maxWait miliseconds, polling for replies every waitDelay seconds. If reply does not arrive after maxWait, client will abort.

## Constructor Details

### Session

public Session()

## Method Details

### matches

public void matches(Session other) throws ClientException
Ensures that settings of 2 servers match each other so that the servers are capable of performing a transfer between themselves. The parameters of both sessions must either both be set correctly, or both undefined.
Detailed rules: Two sessions match if their transfer type, mode, and protection buffer sizes match. Additionally, if one party is passive, the other must be active. If any of the variables are set to SERVER_DEFAULT, sessions are considered matching.

Throws:
  `ClientException` - if sessions do not match

### compareTransferParams

protected void compareTransferParams(Session other) throws ClientException
defines how to compare parameters: authorized, PBSZ, MODE, TYPE

Throws:
  `ClientException`

### compareServerMode

protected void compareServerMode(Session other) throws ClientException
checks that active / passive sides are correctly set

Throws:
  `ClientException`