Package org.jivesoftware.whack
Class ExternalComponent
java.lang.Object
org.jivesoftware.whack.ExternalComponent
- All Implemented Interfaces:
org.xmpp.component.Component
ExternalComponents are responsible for connecting and authenticating with a remote server and
for sending and processing received packets. In fact, an ExternalComponent is a wrapper on a
Component that provides remote connection capabilities. The actual processing of the packets is
done by the wrapped Component.
- Author:
- Gaston Dombiak
-
Constructor Summary
ConstructorsConstructorDescriptionExternalComponent(org.xmpp.component.Component component, ExternalComponentManager manager) ExternalComponent(org.xmpp.component.Component component, ExternalComponentManager manager, int maxThreads) ExternalComponent(org.xmpp.component.Component component, ExternalComponentManager manager, ExecutorService threadPool) -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidGenerates a connection with the server and tries to authenticate.voidNotification message that the connection with the server was lost unexpectedly.org.xmpp.component.ComponentReturns the domain provided by this component in the connected server.getName()Returns the subdomain provided by this component in the connected server.voidinitialize(org.xmpp.packet.JID jid, org.xmpp.component.ComponentManager componentManager) voidprocessPacket(org.xmpp.packet.Packet packet) voidsend(org.xmpp.packet.Packet packet) voidshutdown()voidstart()
-
Constructor Details
-
ExternalComponent
-
ExternalComponent
public ExternalComponent(org.xmpp.component.Component component, ExternalComponentManager manager, ExecutorService threadPool) -
ExternalComponent
public ExternalComponent(org.xmpp.component.Component component, ExternalComponentManager manager, int maxThreads)
-
-
Method Details
-
connect
@Deprecated public void connect(String host, int port, String subdomain) throws org.xmpp.component.ComponentException Deprecated.Generates a connection with the server and tries to authenticate. If an error occurs in any of the steps then a ComponentException is thrown.- Parameters:
host- the host to connect with.port- the port to use.subdomain- the subdomain that this component will be handling.- Throws:
org.xmpp.component.ComponentException- if an error happens during the connection and authentication steps.
-
connect
public void connect(String host, int port, String subdomain, boolean startEncrypted) throws org.xmpp.component.ComponentException Generates a connection with the server and tries to authenticate. If an error occurs in any of the steps then a ComponentException is thrown.- Parameters:
host- the host to connect with.port- the port to use.subdomain- the subdomain that this component will be handling.startEncrypted- true if sockets are started in TLS/SSL mode, otherwise false.- Throws:
org.xmpp.component.ComponentException- if an error happens during the connection and authentication steps.
-
getComponent
public org.xmpp.component.Component getComponent() -
getName
- Specified by:
getNamein interfaceorg.xmpp.component.Component
-
getDescription
- Specified by:
getDescriptionin interfaceorg.xmpp.component.Component
-
getDomain
Returns the domain provided by this component in the connected server. The domain is composed by the subdomain plus the domain of the server. E.g. conference.jivesoftware.com. The domain may change after a connection has been established with the server.- Returns:
- the domain provided by this component in the connected server.
-
getSubdomain
Returns the subdomain provided by this component in the connected server. E.g. conference.- Returns:
- the subdomain provided by this component in the connected server.
-
processPacket
public void processPacket(org.xmpp.packet.Packet packet) - Specified by:
processPacketin interfaceorg.xmpp.component.Component
-
send
public void send(org.xmpp.packet.Packet packet) -
initialize
public void initialize(org.xmpp.packet.JID jid, org.xmpp.component.ComponentManager componentManager) throws org.xmpp.component.ComponentException - Specified by:
initializein interfaceorg.xmpp.component.Component- Throws:
org.xmpp.component.ComponentException
-
start
public void start()- Specified by:
startin interfaceorg.xmpp.component.Component
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceorg.xmpp.component.Component
-
connectionLost
public void connectionLost()Notification message that the connection with the server was lost unexpectedly. We will try to reestablish the connection for ever until the connection has been reestablished or this thread has been stopped.
-