Class FileTransferProxy
java.lang.Object
org.jivesoftware.openfire.container.BasicModule
org.jivesoftware.openfire.filetransfer.proxy.FileTransferProxy
- All Implemented Interfaces:
ChannelHandler<org.xmpp.packet.Packet>,Module,DiscoInfoProvider,DiscoItemsProvider,ServerItemsProvider,RoutableChannelHandler
public class FileTransferProxy
extends BasicModule
implements ServerItemsProvider, DiscoInfoProvider, DiscoItemsProvider, RoutableChannelHandler
Manages the transferring of files between two remote entities on the jabber network.
This class acts independently as a Jabber component from the rest of the server, according to
the Jabber SOCKS5 bytestreams protocol.
- Author:
- Alexander Wenckus
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanWhether or not the file transfer proxy is enabled by default.static final intThe default port of the file transfer proxystatic final StringThe JiveProperty relating to the port the proxy is operating on.static final StringThe JiveProperty relating to whether or not the file transfer proxy is enabled.static final StringName of the property that hardcodes the external IP that is being listened on. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroys the module.voidenableFileTransferProxy(boolean isEnabled) org.xmpp.packet.JIDReturns the XMPP address.Set<org.xmpp.forms.DataForm>getExtendedInfos(String name, String node, org.xmpp.packet.JID senderJID) Returns a collection of XDataForm with the extended information about the entity or an empty collection if none.getFeatures(String name, String node, org.xmpp.packet.JID senderJID) Returns an Iterator (of String) with the supported features.Iterator<org.dom4j.Element>getIdentities(String name, String node, org.xmpp.packet.JID senderJID) Returns an Iterator (of Element) with the target entity's identities.getInfo()getItems()Returns an Iterator (of DiscoServerItem) with the items associated with the server or null if none.Returns an Iterator (of DiscoItem) with the target entity's items or null if none.intReturns the port that the file transfer proxy is opertating on.Returns the fully-qualifed domain name of this chat service.booleanhandleIQ(org.xmpp.packet.IQ packet) booleanReturns true if we can provide information related to the requested name and node.voidinitialize(XMPPServer server) Initializes the basic module.booleanReturns true if the file transfer proxy is currently enabled and false if it is not.voidprocess(org.xmpp.packet.Packet packet) Process an XMPP packet.voidsetProxyPort(int port) Sets the port that the proxy operates on.voidstart()Starts the basic module.voidstop()Stops the basic module.Methods inherited from class org.jivesoftware.openfire.container.BasicModule
getName
-
Field Details
-
JIVEPROPERTY_PROXY_ENABLED
The JiveProperty relating to whether or not the file transfer proxy is enabled.- See Also:
-
JIVEPROPERTY_PORT
The JiveProperty relating to the port the proxy is operating on. Changing this value requires a restart of the proxy.- See Also:
-
PROPERTY_EXTERNALIP
Name of the property that hardcodes the external IP that is being listened on.- See Also:
-
DEFAULT_IS_PROXY_ENABLED
public static final boolean DEFAULT_IS_PROXY_ENABLEDWhether or not the file transfer proxy is enabled by default.- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORTThe default port of the file transfer proxy- See Also:
-
-
Constructor Details
-
FileTransferProxy
public FileTransferProxy()
-
-
Method Details
-
handleIQ
- Throws:
UnauthorizedException
-
getInfo
-
initialize
Description copied from class:BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
- Specified by:
initializein interfaceModule- Overrides:
initializein classBasicModule- Parameters:
server- the server hosting this module.
-
start
public void start()Description copied from class:BasicModuleStarts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
- Specified by:
startin interfaceModule- Overrides:
startin classBasicModule
-
stop
public void stop()Description copied from class:BasicModuleStops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
- Specified by:
stopin interfaceModule- Overrides:
stopin classBasicModule
-
destroy
public void destroy()Description copied from class:BasicModuleDestroys the module.
Does nothing in the basic module.
- Specified by:
destroyin interfaceModule- Overrides:
destroyin classBasicModule
-
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
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 org.xmpp.packet.JID getAddress()Description copied from interface:RoutableChannelHandlerReturns 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:
getAddressin interfaceRoutableChannelHandler- Returns:
- the XMPP address.
-
getItems
Description copied from interface:ServerItemsProviderReturns an Iterator (of DiscoServerItem) with the items associated with the server or null if none.- Specified by:
getItemsin interfaceServerItemsProvider- 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, org.xmpp.packet.JID senderJID) Description copied from interface:DiscoInfoProviderReturns an Iterator (of Element) with the target entity's identities. Each Element must include the category, type and name attributes of the entity.- Specified by:
getIdentitiesin interfaceDiscoInfoProvider- 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
Description copied from interface:DiscoInfoProviderReturns 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:
getFeaturesin interfaceDiscoInfoProvider- 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.
-
getExtendedInfos
public Set<org.xmpp.forms.DataForm> getExtendedInfos(String name, String node, org.xmpp.packet.JID senderJID) Description copied from interface:DiscoInfoProviderReturns a collection of XDataForm with the extended information about the entity or an empty collection if none. Each bit of information about the entity must be included as a value of a field of the form.- Specified by:
getExtendedInfosin interfaceDiscoInfoProvider- Parameters:
name- the recipient JID's name.node- the requested disco node.senderJID- the XMPPAddress of user that sent the disco info request.- Returns:
- A collection of XDataForms with the extended information about the entity or an empty collection if none.
-
hasInfo
Description copied from interface:DiscoInfoProviderReturns true if we can provide information related to the requested name and node. For example, if the requested name refers to a non-existent 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:
hasInfoin interfaceDiscoInfoProvider- 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
Description copied from interface:DiscoItemsProviderReturns an Iterator (of DiscoItem) with the target entity's items or null if none. Each DiscoItem 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:
getItemsin interfaceDiscoItemsProvider- 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 DiscoItem) with the target entity's items or null if none.
-
process
Description copied from interface:ChannelHandlerProcess an XMPP packet.- Specified by:
processin interfaceChannelHandler<org.xmpp.packet.Packet>- 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).
-