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.
|
getName
public 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
UnauthorizedException
public IQHandlerInfo getInfo()
public void initialize(XMPPServer server)
BasicModule
Initializes the basic module.
Inheriting classes that choose to override this method MUST call this initialize() method before accessing BasicModule resources.
initialize
in interface Module
initialize
in class BasicModule
server
- the server hosting this module.public void start()
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
public void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
public void destroy()
BasicModule
Destroys the module.
Does nothing in the basic module.
destroy
in interface Module
destroy
in class BasicModule
public 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()
RoutableChannelHandler
getAddress
in interface RoutableChannelHandler
public Iterator<DiscoServerItem> getItems()
ServerItemsProvider
getItems
in interface ServerItemsProvider
public Iterator<org.dom4j.Element> getIdentities(String name, String node, org.xmpp.packet.JID senderJID)
DiscoInfoProvider
getIdentities
in interface DiscoInfoProvider
name
- 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)
DiscoInfoProvider
getFeatures
in interface DiscoInfoProvider
name
- 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)
DiscoInfoProvider
getExtendedInfo
in interface DiscoInfoProvider
name
- 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)
DiscoInfoProvider
hasInfo
in interface DiscoInfoProvider
name
- 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)
DiscoItemsProvider
getItems
in interface DiscoItemsProvider
name
- 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
ChannelHandler
process
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.