tigase.xmpp
Class XMPPIOService<RefObject>

java.lang.Object
  extended by tigase.net.IOService<RefObject>
      extended by tigase.xmpp.XMPPIOService<RefObject>
Type Parameters:
RefObject - is a reference object stored by this service. This is e reference to higher level data object keeping more information about the connection.
All Implemented Interfaces:
Callable<IOService<?>>, TLSEventHandler
Direct Known Subclasses:
BoshIOService, ComponentIOService, S2SIOService, WebSocketXMPPIOService

public class XMPPIOService<RefObject>
extends IOService<RefObject>

Describe class XMPPIOService here. Created: Tue Feb 7 07:15:02 2006

Version:
$Rev$
Author:
Artur Hefczyc

Field Summary
static String ACK_NAME
          Field description
static String CROSS_DOMAIN_POLICY_FILE_PROP_KEY
          Field description
static String CROSS_DOMAIN_POLICY_FILE_PROP_VAL
          Field description
static String ID_ATT
          Field description
protected  tigase.xml.SimpleParser parser
          Field description
static String REQ_NAME
          Field description
 ReentrantLock writeInProgress
          Field description
 
Fields inherited from class tigase.net.IOService
cb, CERT_CHECK_RESULT, decoder, encoder, HOSTNAME_KEY, partialCharacterBytes, PORT_TYPE_PROP_KEY, SESSION_ID_KEY, SSL_PROTOCOLS_KEY
 
Constructor Summary
XMPPIOService()
          Creates a new XMPPIOService instance.
 
Method Summary
 void addPacketToSend(Packet packet)
          Method addPacketToSend adds new data which will be processed during next run.
protected  void addReceivedPacket(Packet packet)
          Method addReceivedPacket puts processing results to queue.
 boolean checkData(char[] data)
           
 long getPacketsReceived(boolean reset)
          Method description
 long getPacketsSent(boolean reset)
          Method description
 Queue<Packet> getReceivedPackets()
          Method description
 long getTotalPacketsReceived()
          Method description
 long getTotalPacketsSent()
          Method description
 String getUserJid()
           
 Map<String,Packet> getWaitingForAct()
          Method description
 String getXMLNS()
          Method description
protected  void processSocketData()
          Describe processSocketData method here.
 void processWaitingPackets()
          Describe processWaitingPackets method here.
protected  int receivedPackets()
          Method description
 void setAckMode(boolean white_char_ack, boolean xmpp_ack, boolean strict)
          Method description
 void setIOServiceListener(XMPPIOServiceListener servList)
          Method description
 void setUserJid(String jid)
          Method description
 void setXMLNS(String xmlns)
          Method description
 void stop()
          Describe stop method here.
 String toString()
          Method description
 void writeRawData(String data)
          Method description
protected  void xmppStreamClosed()
          Method description
 void xmppStreamOpen(String data)
          Method description
protected  void xmppStreamOpened(Map<String,String> attribs)
          Method description
 
Methods inherited from class tigase.net.IOService
accept, byteOrder, call, connectionType, debug, debug, forceStop, getBuffOverflow, getBytesReceived, getBytesSent, getConnectionId, getDataReceiver, getLastTransferTime, getLocalAddress, getPeersJIDsFromCert, getReadCounters, getRefObject, getRemoteAddress, getSessionData, getSocketChannel, getStatistics, getTotalBuffOverflow, getTotalBytesReceived, getTotalBytesSent, getUniqueId, getWriteCounters, getX509TrustManagers, handshakeCompleted, isConnected, isInputBufferEmpty, readBytes, readCompleted, readData, setConnectionId, setDataReceiver, setIOServiceListener, setRefObject, setSessionData, setX509TrustManagers, startSSL, startTLS, startZLib, waitingToRead, waitingToSend, waitingToSendSize, writeBytes, writeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACK_NAME

public static final String ACK_NAME
Field description

See Also:
Constant Field Values

CROSS_DOMAIN_POLICY_FILE_PROP_KEY

public static final String CROSS_DOMAIN_POLICY_FILE_PROP_KEY
Field description

See Also:
Constant Field Values

CROSS_DOMAIN_POLICY_FILE_PROP_VAL

public static final String CROSS_DOMAIN_POLICY_FILE_PROP_VAL
Field description

See Also:
Constant Field Values

ID_ATT

public static final String ID_ATT
Field description

See Also:
Constant Field Values

REQ_NAME

public static final String REQ_NAME
Field description

See Also:
Constant Field Values

parser

protected tigase.xml.SimpleParser parser
Field description


writeInProgress

public ReentrantLock writeInProgress
Field description

Constructor Detail

XMPPIOService

public XMPPIOService()
Creates a new XMPPIOService instance.

Method Detail

setAckMode

public void setAckMode(boolean white_char_ack,
                       boolean xmpp_ack,
                       boolean strict)
Method description

Parameters:
white_char_ack -
xmpp_ack -
strict -

getPacketsSent

public long getPacketsSent(boolean reset)
Method description

Parameters:
reset -
Returns:

getTotalPacketsSent

public long getTotalPacketsSent()
Method description

Returns:

getPacketsReceived

public long getPacketsReceived(boolean reset)
Method description

Parameters:
reset -
Returns:

getTotalPacketsReceived

public long getTotalPacketsReceived()
Method description

Returns:

addPacketToSend

public void addPacketToSend(Packet packet)
Method addPacketToSend adds new data which will be processed during next run. Data are kept in proper order like in FIFO queue.

Parameters:
packet - a Packet value of data to process.

getReceivedPackets

public Queue<Packet> getReceivedPackets()
Method description

Returns:

getWaitingForAct

public Map<String,Packet> getWaitingForAct()
Method description

Returns:

getXMLNS

public String getXMLNS()
Method description

Returns:

processWaitingPackets

public void processWaitingPackets()
                           throws IOException
Describe processWaitingPackets method here.

Specified by:
processWaitingPackets in class IOService<RefObject>
Throws:
IOException

setIOServiceListener

public void setIOServiceListener(XMPPIOServiceListener servList)
Method description

Parameters:
servList -

setXMLNS

public void setXMLNS(String xmlns)
Method description

Parameters:
xmlns -

stop

public void stop()
Describe stop method here.

Overrides:
stop in class IOService<RefObject>

writeRawData

public void writeRawData(String data)
                  throws IOException
Method description

Parameters:
data -
Throws:
IOException

xmppStreamOpen

public void xmppStreamOpen(String data)
Method description

Parameters:
data -

addReceivedPacket

protected void addReceivedPacket(Packet packet)
Method addReceivedPacket puts processing results to queue. The processing results are usually data (messages) which has been just received from socket.

Parameters:
packet - a Packet value of processing results.

processSocketData

protected void processSocketData()
                          throws IOException
Describe processSocketData method here.

Specified by:
processSocketData in class IOService<RefObject>
Throws:
IOException - if an error occurs

checkData

public boolean checkData(char[] data)
                  throws IOException
Parameters:
data -
Returns:
Throws:
IOException

receivedPackets

protected int receivedPackets()
Method description

Specified by:
receivedPackets in class IOService<RefObject>
Returns:

xmppStreamClosed

protected void xmppStreamClosed()
Method description


xmppStreamOpened

protected void xmppStreamOpened(Map<String,String> attribs)
Method description

Parameters:
attribs -

setUserJid

public void setUserJid(String jid)
Method description

Parameters:
jid -

getUserJid

public String getUserJid()

toString

public String toString()
Method description

Overrides:
toString in class IOService<RefObject>
Returns:


Copyright © 2013 Tigase. All rights reserved.