mx.udlap.kjProtocol.kbinds
Class KSocket

java.lang.Object
  extended byjava.net.Socket
      extended bymx.udlap.kjProtocol.kbinds.KSocket

public class KSocket
extends java.net.Socket

Socket connected to a Kannel bearerbox (Typically)

Author:
Oscar Medina Duarte

Constructor Summary
KSocket()
          Wrapper constructor for the Socket super class
KSocket(java.net.InetAddress address, int port)
          Wrapper constructor for the Socket super class
KSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort)
          Wrapper constructor for the Socket super class
KSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddr, int localPort, java.lang.String boxc_id)
          Constructor for the KSocket object
KSocket(java.net.InetAddress address, int port, java.lang.String boxc_id)
          Constructor for the KSocket object
KSocket(java.lang.String boxc_id)
          Constructor for the KSocket object
KSocket(java.lang.String host, int port)
          Wrapper constructor for the Socket super class
KSocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort)
          Wrapper constructor for the Socket super class
KSocket(java.lang.String host, int port, java.net.InetAddress localAddr, int localPort, java.lang.String boxc_id)
          Constructor for the KSocket object
KSocket(java.lang.String host, int port, java.lang.String boxc_id)
          Constructor for the KSocket object
 
Method Summary
 java.lang.String getBoxc_id()
          Gets the boxc_id attribute of the KSocket object
 void kconnect()
          Initiates a session with a bearer box.
 void kconnect(java.lang.String boxc_id)
          Initiates a session with a bearer box.
static void main(java.lang.String[] args)
          Testing class
 void setBoxc_id(java.lang.String boxc_id)
          Sets the boxc_id attribute of the KSocket object
 
Methods inherited from class java.net.Socket
bind, close, connect, connect, getChannel, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KSocket

public KSocket()
Wrapper constructor for the Socket super class


KSocket

public KSocket(java.net.InetAddress address,
               int port)
        throws java.io.IOException
Wrapper constructor for the Socket super class

Parameters:
address - Description of the Parameter
port - Description of the Parameter
Throws:
java.io.IOException - Exception thrown when

KSocket

public KSocket(java.net.InetAddress address,
               int port,
               java.net.InetAddress localAddr,
               int localPort)
        throws java.io.IOException
Wrapper constructor for the Socket super class

Parameters:
address - Description of the Parameter
port - Description of the Parameter
localAddr - Description of the Parameter
localPort - Description of the Parameter
Throws:
java.io.IOException - Exception thrown when

KSocket

public KSocket(java.lang.String host,
               int port)
        throws java.net.UnknownHostException,
               java.io.IOException
Wrapper constructor for the Socket super class

Parameters:
host - Description of the Parameter
port - Description of the Parameter
Throws:
java.net.UnknownHostException - Exception thrown when
java.io.IOException - Exception thrown when

KSocket

public KSocket(java.lang.String host,
               int port,
               java.net.InetAddress localAddr,
               int localPort)
        throws java.io.IOException
Wrapper constructor for the Socket super class

Parameters:
host - Description of the Parameter
port - Description of the Parameter
localAddr - Description of the Parameter
localPort - Description of the Parameter
Throws:
java.io.IOException - Exception thrown when

KSocket

public KSocket(java.lang.String boxc_id)
Constructor for the KSocket object

This constructor sets the boxc_id attribute to be used by void kconnect()

Parameters:
boxc_id - Description of the Parameter

KSocket

public KSocket(java.net.InetAddress address,
               int port,
               java.lang.String boxc_id)
        throws java.io.IOException
Constructor for the KSocket object

This constructor sets the boxc_id attribute to be used by void kconnect() and sends AdminKMessage to Kannel box to initiate a session.

Parameters:
address - Description of the Parameter
port - Description of the Parameter
boxc_id - Description of the Parameter
Throws:
java.io.IOException - Exception thrown when

KSocket

public KSocket(java.net.InetAddress address,
               int port,
               java.net.InetAddress localAddr,
               int localPort,
               java.lang.String boxc_id)
        throws java.io.IOException
Constructor for the KSocket object

This constructor sets the boxc_id attribute to be used by void kconnect() and sends AdminKMessage to Kannel box to initiate a session.

Parameters:
address - Description of the Parameter
port - Description of the Parameter
localAddr - Description of the Parameter
localPort - Description of the Parameter
boxc_id - Description of the Parameter
Throws:
java.io.IOException - Exception thrown when

KSocket

public KSocket(java.lang.String host,
               int port,
               java.lang.String boxc_id)
        throws java.net.UnknownHostException,
               java.io.IOException
Constructor for the KSocket object

This constructor sets the boxc_id attribute to be used by void kconnect() and sends AdminKMessage to Kannel box to initiate a session.

Parameters:
host - Description of the Parameter
port - Description of the Parameter
boxc_id - Description of the Parameter
Throws:
java.net.UnknownHostException - Exception thrown when
java.io.IOException - Exception thrown when

KSocket

public KSocket(java.lang.String host,
               int port,
               java.net.InetAddress localAddr,
               int localPort,
               java.lang.String boxc_id)
        throws java.io.IOException
Constructor for the KSocket object

This constructor sets the boxc_id attribute to be used by void kconnect() and sends AdminKMessage to Kannel box to initiate a session.

Parameters:
host - Description of the Parameter
port - Description of the Parameter
localAddr - Description of the Parameter
localPort - Description of the Parameter
boxc_id - Description of the Parameter
Throws:
java.io.IOException - Exception thrown when
Method Detail

setBoxc_id

public void setBoxc_id(java.lang.String boxc_id)
Sets the boxc_id attribute of the KSocket object

Parameters:
boxc_id - The new boxc_id value

getBoxc_id

public java.lang.String getBoxc_id()
Gets the boxc_id attribute of the KSocket object

Returns:
The boxc_id value

kconnect

public void kconnect(java.lang.String boxc_id)
              throws java.io.IOException
Initiates a session with a bearer box.

Parameters:
boxc_id - Description of the Parameter
Throws:
java.io.IOException - Exception thrown when

kconnect

public void kconnect()
              throws java.io.IOException
Initiates a session with a bearer box.

Throws:
java.io.IOException - Exception thrown when

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Testing class

Parameters:
args - Description of the Parameter
Throws:
java.lang.Exception - Exception thrown when