Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.filetransfer.proxy
Class FileTransferProxy

java.lang.Object
  extended by org.jivesoftware.wildfire.container.BasicModule
      extended by org.jivesoftware.wildfire.filetransfer.proxy.FileTransferProxy
All Implemented Interfaces:
ChannelHandler, Module, DiscoInfoProvider, DiscoItemsProvider, ServerItemsProvider, RoutableChannelHandler

public class FileTransferProxy
extends BasicModule
implements ServerItemsProvider, DiscoInfoProvider, DiscoItemsProvider, RoutableChannelHandler

Manages the transfering of files between two remote entities on the jabber network. This class acts independtly as a Jabber component from the rest of the server, according to the Jabber SOCKS5 bytestreams protocol.

Author:
Alexander Wenckus

Field Summary
static boolean DEFAULT_IS_PROXY_ENABLED
          Whether or not the file transfer proxy is enabled by default.
static int DEFAULT_PORT
          The default port of the file transfer proxy
static String JIVEPROPERTY_PORT
          The JiveProperty relating to the port the proxy is operating on.
static String JIVEPROPERTY_PROXY_ENABLED
          The JiveProperty relating to whether or not the file treansfer proxy is enabled.
 
Constructor Summary
FileTransferProxy()
           
 
Method Summary
 void destroy()
          Destroys the module.
 void enableFileTransferProxy(boolean isEnabled)
           
 JID getAddress()
          Returns the XMPP address.
 XDataFormImpl getExtendedInfo(String name, String node, JID senderJID)
          Returns an XDataForm with the extended information about the entity or null if none.
 Iterator<String> getFeatures(String name, String node, JID senderJID)
          Returns an Iterator (of String) with the supported features.
 Iterator<org.dom4j.Element> getIdentities(String name, String node, JID senderJID)
          Returns an Iterator (of Element) with the target entity's identities.
 IQHandlerInfo getInfo()
           
 Iterator<DiscoServerItem> getItems()
          Returns an Iterator (of DiscoServerItem) with the items associated with the server or null if none.
 Iterator<org.dom4j.Element> getItems(String name, String node, JID senderJID)
          Returns an Iterator (of Element) with the target entity's items or null if none.
 int getProxyPort()
          Returns the port that the file transfer proxy is opertating on.
 String getServiceDomain()
          Returns the fully-qualifed domain name of this chat service.
 boolean handleIQ(IQ packet)
           
 boolean hasInfo(String name, String node, JID senderJID)
          Returns true if we can provide information related to the requested name and node.
 void initialize(XMPPServer server)
          Initializes the basic module.
 boolean isProxyEnabled()
          Returns true if the file transfer proxy is currently enabled and false if it is not.
 void process(Packet packet)
          Process an XMPP packet.
 void setProxyPort(int port)
          Sets the port that the proxy operates on.
 void start()
          Starts the basic module.
 void stop()
          Stops the basic module.
 
Methods inherited from class org.jivesoftware.wildfire.container.BasicModule
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JIVEPROPERTY_PROXY_ENABLED

public static final String JIVEPROPERTY_PROXY_ENABLED
The JiveProperty relating to whether or not the file treansfer proxy is enabled.

See Also:
Constant Field Values

JIVEPROPERTY_PORT

public static final String JIVEPROPERTY_PORT
The JiveProperty relating to the port the proxy is operating on. Changing this value requires a restart of the proxy.

See Also:
Constant Field Values

DEFAULT_IS_PROXY_ENABLED

public static final boolean DEFAULT_IS_PROXY_ENABLED
Whether or not the file transfer proxy is enabled by default.

See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
The default port of the file transfer proxy

See Also:
Constant Field Values
Constructor Detail

FileTransferProxy

public FileTransferProxy()
Method Detail

handleIQ

public boolean handleIQ(IQ packet)
                 throws UnauthorizedException
Throws:
UnauthorizedException

getInfo

public IQHandlerInfo getInfo()

initialize

public void initialize(XMPPServer server)
Description copied from class: BasicModule

Initializes the basic module.

Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.

Specified by:
initialize in interface Module
Overrides:
initialize in class BasicModule
Parameters:
server - the server hosting this module.

start

public void start()
Description copied from class: BasicModule

Starts the basic module.

Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.

Specified by:
start in interface Module
Overrides:
start in class BasicModule

stop

public void stop()
Description copied from class: BasicModule

Stops the basic module.

Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.

Specified by:
stop in interface Module
Overrides:
stop in class BasicModule

destroy

public void destroy()
Description copied from class: BasicModule

Destroys the module.

Does nothing in the basic module.

Specified by:
destroy in interface Module
Overrides:
destroy in class BasicModule

enableFileTransferProxy

public void enableFileTransferProxy(boolean isEnabled)

isProxyEnabled

public boolean isProxyEnabled()
Returns true if the file transfer proxy is currently enabled and false if it is not.

Returns:
Returns true if the file transfer proxy is currently enabled and false if it is not.

setProxyPort

public void setProxyPort(int port)
Sets the port that the proxy operates on. This requires a restart of the file transfer proxy.

Parameters:
port - The port.

getProxyPort

public int getProxyPort()
Returns the port that the file transfer proxy is opertating on.

Returns:
Returns the port that the file transfer proxy is opertating on.

getServiceDomain

public String getServiceDomain()
Returns the fully-qualifed domain name of this chat service. The domain is composed by the service name and the name of the XMPP server where the service is running.

Returns:
the file transfer server domain (service name + host name).

getAddress

public JID getAddress()
Description copied from interface: RoutableChannelHandler
Returns the XMPP address. The address is used by services like the core server packet router to determine if a packet should be sent to the handler. Handlers that are working on behalf of the server should use the generic server hostname address (e.g. server.com).

Specified by:
getAddress in interface RoutableChannelHandler
Returns:
the XMPP address.

getItems

public Iterator<DiscoServerItem> getItems()
Description copied from interface: ServerItemsProvider
Returns an Iterator (of DiscoServerItem) with the items associated with the server or null if none.

Specified by:
getItems in interface ServerItemsProvider
Returns:
an Iterator (of DiscoServerItem) with the items associated with the server or null if none.

getIdentities

public Iterator<org.dom4j.Element> getIdentities(String name,
                                                 String node,
                                                 JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns an Iterator (of Element) with the target entity's identities. Each Element must include the categoty, type and name attributes of the entity.

Specified by:
getIdentities in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
an Iterator (of Element) with the target entity's identities.

getFeatures

public Iterator<String> getFeatures(String name,
                                    String node,
                                    JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns an Iterator (of String) with the supported features. The features to include are the features offered and supported protocols by the target entity identified by the requested name and node.

Specified by:
getFeatures in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
an Iterator (of String) with the supported features.

getExtendedInfo

public XDataFormImpl getExtendedInfo(String name,
                                     String node,
                                     JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns an XDataForm with the extended information about the entity or null if none. Each bit of information about the entity must be included as a value of a field of the form.

Specified by:
getExtendedInfo in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
an XDataForm with the extended information about the entity or null if none.

hasInfo

public boolean hasInfo(String name,
                       String node,
                       JID senderJID)
Description copied from interface: DiscoInfoProvider
Returns true if we can provide information related to the requested name and node. For example, if the requested name refers to a non-existant MUC room then the answer will be false. In case that the sender of the disco request is not authorized to discover this information an UnauthorizedException will be thrown.

Specified by:
hasInfo in interface DiscoInfoProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco info request.
Returns:
true if we can provide information related to the requested name and node.

getItems

public Iterator<org.dom4j.Element> getItems(String name,
                                            String node,
                                            JID senderJID)
Description copied from interface: DiscoItemsProvider
Returns an Iterator (of Element) with the target entity's items or null if none. Each Element must include a JID attribute and may include the name and node attributes of the entity. In case that the sender of the disco request is not authorized to discover items an UnauthorizedException will be thrown.

Specified by:
getItems in interface DiscoItemsProvider
Parameters:
name - the recipient JID's name.
node - the requested disco node.
senderJID - the XMPPAddress of user that sent the disco items request.
Returns:
an Iterator (of Element) with the target entity's items or null if none.

process

public void process(Packet packet)
             throws UnauthorizedException,
                    PacketException
Description copied from interface: ChannelHandler
Process an XMPP packet.

Specified by:
process in interface ChannelHandler
Parameters:
packet - a packet to process.
Throws:
UnauthorizedException - if not allowed to process the packet.
PacketException - thrown if the packet is malformed (results in the sender's session being shutdown).

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.