Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.net
Class ServerSocketReader

    java.lang.Object
      org.jivesoftware.openfire.net.SocketReader
          org.jivesoftware.openfire.net.ServerSocketReader

All Implemented Interfaces:
  Runnable

    public class ServerSocketReader

extends SocketReader

A SocketReader specialized for server connections. This reader will be used when the open stream contains a jabber:server namespace. Server-to-server communication requires two TCP connections between the servers where one is used for sending packets whilst the other connection is used for receiving packets. The connection used for receiving packets will use a ServerSocketReader since the other connection will not receive packets.

The received packets will be routed using another thread to ensure that many received packets could be routed at the same time. To avoid creating new threads every time a packet is received each `ServerSocketReader` instance uses a `ThreadPoolExecutor`. By default the maximum number of threads that the executor may have is 50. However, this value may be modified by changing the property xmpp.server.processing.max.threads.

Author:
  Gaston Dombiak

Field Summary

Fields inherited from class org.jivesoftware.openfire.net.SocketReader
`connection, open, serverName, session`

Constructor Summary
`ServerSocketReader(PacketRouter router, RoutingTable routingTable, String serverName, Socket socket, SocketConnection connection, boolean useBlockingMode)`

Method Summary
`String` | `getExtraNamespaces()`
`protected void` | `processIQ(org.xmpp.packet.IQ packet)` Processes the packet in another thread if the packet has not been rejected.
`protected void` | `processMessage(org.xmpp.packet.Message packet)` Processes the packet in another thread if the packet has not been rejected.
`protected void` | `processPresence(org.xmpp.packet.Presence packet)` Processes the packet in another thread if the packet has not been rejected.
`protected boolean` | `processUnknowPacket(org.dom4j.Element doc)` Remote servers may send subsequent db:result packets so we need to process them in order to validate new domains.
`protected void` | `shutdown()` Notification message indicating that the SocketReader is shutting down.

Methods inherited from class org.jivesoftware.openfire.net.SocketReader
`createSession, process, run`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ServerSocketReader

    public ServerSocketReader(PacketRouter router,
                              RoutingTable routingTable,
                              String serverName,
                              Socket socket,
                              SocketConnection connection,
                              boolean useBlockingMode)

Method Detail

### processIQ

    protected void processIQ(org.xmpp.packet.IQ packet)
                      throws UnauthorizedException

  Processes the packet in another thread if the packet has not been rejected.

  Overrides:
    `processIQ` in class `SocketReader`
  Parameters:
    `packet` - the received packet.
  Throws:
    `UnauthorizedException` - if the connection required security but was not secured.

### processPresence

    protected void processPresence(org.xmpp.packet.Presence packet)
                            throws UnauthorizedException

  Processes the packet in another thread if the packet has not been rejected.

  Overrides:
    `processPresence` in class `SocketReader`
  Parameters:
    `packet` - the received packet.
  Throws:
    `UnauthorizedException` - if the connection required security but was not secured.

### processMessage

    protected void processMessage(org.xmpp.packet.Message packet)
                           throws UnauthorizedException

  Processes the packet in another thread if the packet has not been rejected.

  Overrides:
    `processMessage` in class `SocketReader`
  Parameters:
    `packet` - the received packet.
  Throws:
    `UnauthorizedException` - if the connection required security but was not secured.

### processUnknowPacket

    protected boolean processUnknowPacket(org.dom4j.Element doc)

  Remote servers may send subsequent db:result packets so we need to process them in order to validate new domains.

  Parameters:
    `doc` - the unknown DOM element that was received
  Returns:
    true if the packet is a db:result packet otherwise false.

### shutdown

    protected void shutdown()

  Description copied from class: `SocketReader`
  Notification message indicating that the SocketReader is shutting down. The thread will stop reading and processing new requests. Subclasses may want to redefine this message for releasing any resource they might need.

  Overrides:
    `shutdown` in class `SocketReader`

### getExtraNamespaces

    public String getExtraNamespaces()

  Overrides:
    `getExtraNamespaces` in class `SocketReader`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.