|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Transport
This interface provides a protocol independent network transport layer required by Odette FTP peer entities to with each via the underlying OSI model Network Service provider.
Method Summary | |
---|---|
boolean |
connect(NetworkAddress address)
Setup a network connection with another Odette FTP peer entity. |
boolean |
connect(java.lang.String address)
Setup a connection with another Odette FTP peer entity. |
void |
disconnect()
Terminate the ongoing connection. |
java.lang.String |
getLocalAddress()
Returns local address used to fulfill Odette FTP session variables. |
java.lang.String |
getRemoteAddress()
Returns remote address used to fulfill Odette FTP session variables. |
boolean |
isConnected()
Tells whether the underlying network protocol is connected. |
int |
receive(java.nio.ByteBuffer dst)
Receive a sequence of bytes from the underlying transport implementation of network protocol. |
int |
send(java.nio.ByteBuffer src)
Send a sequence of bytes through this transport implementation, of the underlying network protocol, from the given buffer. |
int |
send(java.nio.ByteBuffer[] srcs)
Sent a sequence of bytes through this transport implementation, of the underlying network protocol, from a subsequence of the given buffers. |
Method Detail |
---|
boolean connect(NetworkAddress address) throws OdetteFTPException
address
- A protocol specific NetworkAddress
implementation with the network location of the target entity.
true
when connection is established with success
ConnectionException
- If the transport instance is already connected.
AddressException
- For unresolved or unsupported address types
OdetteFTPException
- Thrown by unexpected exceptionboolean connect(java.lang.String address) throws OdetteFTPException
address
- A String representation of the network location of the target
entity of the underlying transport protocol. The value is
parsed by the corresponding NetworkAddress
implementation of that protocol.
true
when connection is established with success
ConnectionException
- If the transport instance is already connected.
AddressException
- For unresolved or unsupported address types.
OdetteFTPException
- Thrown for unexpected failuresvoid disconnect() throws OdetteFTPException
OdetteFTPException
java.lang.String getLocalAddress() throws OdetteFTPException
odette.calling-address
"
property. The Responder Odette FTP entity use this method to fill
the "odette.called-address
" property.
OdetteFTPException
java.lang.String getRemoteAddress() throws OdetteFTPException
odette.called-address
".
The Responder Odette FTP entity use this method to fill the "odette.calling-address
"
property.
OdetteFTPException
boolean isConnected() throws OdetteFTPException
true
if this transport implementation is
connected.
OdetteFTPException
int receive(java.nio.ByteBuffer dst) throws OdetteFTPException
An attempt is made to receive up to r bytes from the channel,
where r is the number of bytes remaining in the buffer, that is,
dst.remaining()
, at the moment this method is invoked.
dst
- The buffer into which bytes are to be transferred
-1
if the channel has reached end-of-stream
NotConnectedException
- Transport not yet connected
OdetteFTPException
- Thrown by unexpected exceptionint send(java.nio.ByteBuffer src) throws OdetteFTPException
An attempt is made to send up to r bytes to the channel, where
r is the number of bytes remaining in the buffer, that is,
dst.remaining()
, at the moment this method is invoked.
src
- The buffer from which bytes are to be retrieved
NotConnectedException
- Transport not yet connected
OdetteFTPException
- Thrown by unexpected exceptionint send(java.nio.ByteBuffer[] srcs) throws OdetteFTPException
srcs
- The sequence of buffers from which bytes are to be retrieved
OdetteFTPException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |