namespace Akenti class URLConnectionImpl

A URLConnectionImpl is an abstract class that holds a URL and its connection state, and input and/or output streams

Public Methods

virtual ~URLConnectionImpl ()
Destructor
const URL& getURL () const
Returns the url
void setDoInput (bool doInput)
Sets the connection to do input
bool getDoInput () const
Returns an indication if this connection can be used for input
void setDoOutput (bool doOutput)
Sets the connection to do output
bool getDoOutput () const
Returns an indication if this connection can be used for output
bool isConnected () const
Determines if there is a connection or not
void connect ()
Establishs a connection by calling the subclass doOpen method
void close ()
Closes the connection by calling doClose in the subclass
InputStream& getInputStream ()
Returns the input stream
OutputStream& getOutputStream ()
Returns the output stream
string getContent ()
Returns the content of the input stream by calling the subclass method doGetContent that know how to read for this type of protocol
virtual string paramString () const
Returns a string representation for URLConnectionImpl which is used for debugging purposes

Protected Methods

URLConnectionImpl (const URL& url)
Create this object
virtual void doOpen ()
To open the connection
virtual string doGetContent (InputStream &is)
To get the content from the input stream
virtual void doClose ()
Closes the connection
virtual InputStream doGetInputStream ()
Returns the input stream Must be implemented by the subclasses
virtual OutputStream doGetOutputStream ()
Returns the output stream

Documentation

A URLConnectionImpl is an abstract class that holds a URL and its connection state, and input and/or output streams. The open, close, getInputSream, getOutputStream and getContent calls are implmented by the protocol-specific ConnectionImpls which are implemented in the same files as the protocol-specific URLHandlerImpls.
virtual ~URLConnectionImpl()
Destructor

const URL& getURL() const
Returns the url
Returns:
the url

void setDoInput(bool doInput)
Sets the connection to do input. Must be called before connect.
Throws:
Error if setDoInput: illegal operation if it is already connected
Parameters:
doInput - if true, connection is going to be used for input, if false, it will not.

bool getDoInput() const
Returns an indication if this connection can be used for input.
Returns:
true if this connection can be used for input, otherwise false

void setDoOutput(bool doOutput)
Sets the connection to do output. Must be called before connect.
Throws:
Error if setDoOutput: illegal operation if it is already connected.
Parameters:
doOutput - if true, connection is going to be used for output, if false, it will not

bool getDoOutput() const
Returns an indication if this connection can be used for output.
Returns:
true if this connection can be used for output, otherwise false

bool isConnected() const
Determines if there is a connection or not
Returns:
true if there is connection, false otherwise

void connect()
Establishs a connection by calling the subclass doOpen method. Sets isConnected to true.
Throws:
Error if a connection already existed
Error if an illegal operation if neither DoInput or DoOutput has been set
See Also:
doOpen() in the subclass for each protocol - part of the subclass URLHandlerImpl.
setConnected(bool);

void close()
Closes the connection by calling doClose in the subclass.
Throws:
Error if the connection is not open
See Also:
doClose()
setConnected(bool)

InputStream& getInputStream()
Returns the input stream. The first time this is called, it calls doGetInputStream in the subclass to open an input stream specific the the protocol type. It then saves the streamObject util a close is called.
Throws:
Error if the connection is not open
Error if the getInputStream is not set for input
Returns:
the input stream

OutputStream& getOutputStream()
Returns the output stream. The first time this is called, it calls doGetOutputStream in the subclass to open an output stream specific the the protocol type. It then saves the streamObject util a close is called.
Throws:
Error if the connection is not open
Error if the getOutputStream is not set for output
Returns:
the output stream

string getContent()
Returns the content of the input stream by calling the subclass method doGetContent that know how to read for this type of protocol.
Returns:
the content of the input stream

virtual string paramString() const
Returns a string representation for URLConnectionImpl which is used for debugging purposes.
Returns:
debugging info

URLConnectionImpl(const URL& url)
Create this object. Defaults to allowing both input and output.
Parameters:
url - the url to make connection

virtual void doOpen()
To open the connection. Must be implemented by the subclasses.

virtual string doGetContent(InputStream &is)
To get the content from the input stream. Must be implemented by the subclasses.
Returns:
the content of the input stream
Parameters:
is - the input stream

virtual void doClose()
Closes the connection. Must be implemented by the subclasses.

virtual InputStream doGetInputStream()
Returns the input stream Must be implemented by the subclasses.
Returns:
the input stream

virtual OutputStream doGetOutputStream()
Returns the output stream. Must be implemented by the subclasses.
Returns:
the output stream


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/11/01
See Also:
URL
InputStream
OutputStream

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de