public class FileTransferProxy extends BasicModule implements ServerItemsProvider, DiscoInfoProvider, DiscoItemsProvider, RoutableChannelHandler
| Modifier and Type | Field and Description |
|---|---|
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.
|
static String |
PROPERTY_EXTERNALIP
Name of the property that hardcodes the external IP that is being listened on.
|
| Constructor and Description |
|---|
FileTransferProxy() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroys the module.
|
void |
enableFileTransferProxy(boolean isEnabled) |
org.xmpp.packet.JID |
getAddress()
Returns the XMPP address.
|
org.xmpp.forms.DataForm |
getExtendedInfo(String name,
String node,
org.xmpp.packet.JID senderJID)
Returns an XDataForm with the extended information about the entity or null if none.
|
Iterator<String> |
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.
|
IQHandlerInfo |
getInfo() |
Iterator<DiscoServerItem> |
getItems()
Returns an Iterator (of DiscoServerItem) with the items associated with the server or null
if none.
|
Iterator<DiscoItem> |
getItems(String name,
String node,
org.xmpp.packet.JID senderJID)
Returns an Iterator (of DiscoItem) 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(org.xmpp.packet.IQ packet) |
boolean |
hasInfo(String name,
String node,
org.xmpp.packet.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(org.xmpp.packet.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.
|
getNamepublic static final String JIVEPROPERTY_PROXY_ENABLED
public static final String JIVEPROPERTY_PORT
public static final String PROPERTY_EXTERNALIP
public static final boolean DEFAULT_IS_PROXY_ENABLED
public static final int DEFAULT_PORT
public boolean handleIQ(org.xmpp.packet.IQ packet)
throws UnauthorizedException
UnauthorizedExceptionpublic IQHandlerInfo getInfo()
public void initialize(XMPPServer server)
BasicModuleInitializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize in interface Moduleinitialize in class BasicModuleserver - the server hosting this module.public void start()
BasicModuleStarts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start in interface Modulestart in class BasicModulepublic void stop()
BasicModuleStops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop in interface Modulestop in class BasicModulepublic void destroy()
BasicModuleDestroys the module.
Does nothing in the basic module.
destroy in interface Moduledestroy in class BasicModulepublic void enableFileTransferProxy(boolean isEnabled)
public boolean isProxyEnabled()
public void setProxyPort(int port)
port - The port.public int getProxyPort()
public String getServiceDomain()
public org.xmpp.packet.JID getAddress()
RoutableChannelHandlergetAddress in interface RoutableChannelHandlerpublic Iterator<DiscoServerItem> getItems()
ServerItemsProvidergetItems in interface ServerItemsProviderpublic Iterator<org.dom4j.Element> getIdentities(String name, String node, org.xmpp.packet.JID senderJID)
DiscoInfoProvidergetIdentities in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.public Iterator<String> getFeatures(String name, String node, org.xmpp.packet.JID senderJID)
DiscoInfoProvidergetFeatures in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.public org.xmpp.forms.DataForm getExtendedInfo(String name, String node, org.xmpp.packet.JID senderJID)
DiscoInfoProvidergetExtendedInfo in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.public boolean hasInfo(String name, String node, org.xmpp.packet.JID senderJID)
DiscoInfoProviderhasInfo in interface DiscoInfoProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco info request.public Iterator<DiscoItem> getItems(String name, String node, org.xmpp.packet.JID senderJID)
DiscoItemsProvidergetItems in interface DiscoItemsProvidername - the recipient JID's name.node - the requested disco node.senderJID - the XMPPAddress of user that sent the disco items request.public void process(org.xmpp.packet.Packet packet)
throws UnauthorizedException,
PacketException
ChannelHandlerprocess in interface ChannelHandler<org.xmpp.packet.Packet>packet - a packet to process.UnauthorizedException - if not allowed to process the packet.PacketException - thrown if the packet is malformed (results in the sender's
session being shutdown).Copyright © 2003-2008 Jive Software.