org.apache.servicemix.xmpp
Class XMPPReceiverEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ConsumerEndpoint
              extended by org.apache.servicemix.xmpp.XMPPReceiverEndpoint
All Implemented Interfaces:
Endpoint, XMPPEndpointType, org.jivesoftware.smack.PacketListener

public class XMPPReceiverEndpoint
extends ConsumerEndpoint
implements XMPPEndpointType, org.jivesoftware.smack.PacketListener

This endpoint receives XMPP messages and events and sends them as xml message into the NMR to the defined target

Author:
lhein

Field Summary
 
Fields inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
logger
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, service, serviceUnit
 
Constructor Summary
XMPPReceiverEndpoint()
           
 
Method Summary
 org.jivesoftware.smack.filter.PacketFilter getFilter()
           
 java.lang.String getHost()
           
 XMPPMarshalerSupport getMarshaler()
           
 java.lang.String getPassword()
           
 int getPort()
           
 java.lang.String getProxyHost()
           
 java.lang.String getProxyPass()
           
 java.lang.String getProxyPort()
           
 java.lang.String getProxyType()
           
 java.lang.String getProxyUser()
           
 java.lang.String getResource()
           
 java.lang.String getRoom()
           
 java.lang.String getUser()
           
 boolean isCreateAccount()
           
 boolean isLogin()
           
 void process(javax.jbi.messaging.MessageExchange exchange)
           
 void processPacket(org.jivesoftware.smack.packet.Packet packet)
           
 void setCreateAccount(boolean createAccount)
          Specify here if you want to create an account for the user if the user is currently not existing on the XMPP server.
 void setFilter(org.jivesoftware.smack.filter.PacketFilter filter)
          Here you can define a PacketFilter to use for filtering XMPP packets.
 void setHost(java.lang.String host)
          With that method you can specify the host name of the XMPP server as hostname or ip address.
 void setLogin(boolean login)
          Here you can specify if the user should login to the server or not.
 void setMarshaler(XMPPMarshalerSupport marshaler)
          With this method you can specify a marshaler class which provides the logic for converting an xmpp message into a normalized message.
 void setPassword(java.lang.String password)
          This method sets the password for connecting to the XMPP server.
 void setPort(int port)
          This method will set the port number for the XMPP connection.
 void setProxyHost(java.lang.String proxyHost)
          Here you can specify the hostname or ip address of a proxy to be used to connect to the XMPP server.
 void setProxyPass(java.lang.String proxyPass)
          If your proxy needs authentication you can specify here the user password.
 void setProxyPort(java.lang.String proxyPort)
          Here you can specify the port of the proxy server.
 void setProxyType(java.lang.String proxyType)
          Here you can specify the type of proxy you have.
 void setProxyUser(java.lang.String proxyUser)
          If your proxy needs authentication you can specify here the user name.
 void setResource(java.lang.String resource)
          Specify here the resource string to submit to the XMPP server.
 void setRoom(java.lang.String room)
          Specify here an optional room to join.
 void setUser(java.lang.String user)
          This method if used to specify the user name to use for connecting to the XMPP server.
 void start()
           
 void stop()
           
 void validate()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.ConsumerEndpoint
activate, configureExchangeTarget, deactivate, getLocationURI, getRole, getTargetEndpoint, getTargetInterface, getTargetOperation, getTargetService, getTargetUri, setTargetEndpoint, setTargetInterface, setTargetOperation, setTargetService, setTargetUri
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
done, fail, getChannel, getContext, getExchangeFactory, send, sendSync
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMPPReceiverEndpoint

public XMPPReceiverEndpoint()
Method Detail

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Specified by:
validate in interface Endpoint
Overrides:
validate in class ConsumerEndpoint
Throws:
javax.jbi.management.DeploymentException

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Endpoint
Overrides:
start in class SimpleEndpoint
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Endpoint
Overrides:
stop in class SimpleEndpoint
Throws:
java.lang.Exception

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws java.lang.Exception
Specified by:
process in interface Endpoint
Specified by:
process in class AbstractEndpoint
Throws:
java.lang.Exception

processPacket

public void processPacket(org.jivesoftware.smack.packet.Packet packet)
Specified by:
processPacket in interface org.jivesoftware.smack.PacketListener

getMarshaler

public XMPPMarshalerSupport getMarshaler()

setMarshaler

public void setMarshaler(XMPPMarshalerSupport marshaler)

With this method you can specify a marshaler class which provides the logic for converting an xmpp message into a normalized message. This class has to implement the interface XMPPMarshalerSupport or another class which implements it. If you don't specify a marshaler, the DefaultXMPPMarshaler will be used.

Parameters:
marshaler - a class which implements XMPPMarshalerSupport

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

With that method you can specify the host name of the XMPP server as hostname or ip address.

Parameters:
host - the hostname or ip address of the XMPP server

getPort

public int getPort()

setPort

public void setPort(int port)

This method will set the port number for the XMPP connection. If nothing is defined the default XMPP port number 5222 will be used.

Parameters:
port - the port number of the XMPP server

getUser

public java.lang.String getUser()

setUser

public void setUser(java.lang.String user)

This method if used to specify the user name to use for connecting to the XMPP server. It is not required that this user already exists but if not then the server should allow registration of new users and this user should not already exist with another password.

Parameters:
user - the name of the user to use for connecting. for example: joe

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

This method sets the password for connecting to the XMPP server.

Parameters:
password - the password for connecting to the XMPP server

getResource

public java.lang.String getResource()

setResource

public void setResource(java.lang.String resource)

Specify here the resource string to submit to the XMPP server. Usually you define the identifier of the XMPP client here.

Parameters:
resource - the resource identifier (for example: servicemix-xmpp)

getProxyHost

public java.lang.String getProxyHost()

setProxyHost

public void setProxyHost(java.lang.String proxyHost)

Here you can specify the hostname or ip address of a proxy to be used to connect to the XMPP server. If you don't define this no proxy is used.

Parameters:
proxyHost - the hostname or ip address of the proxy to use

getProxyPort

public java.lang.String getProxyPort()

setProxyPort

public void setProxyPort(java.lang.String proxyPort)

Here you can specify the port of the proxy server. If you do not define this the default port (3128) will be used.

Parameters:
proxyPort - the default proxy port number (default: 3128)

getProxyUser

public java.lang.String getProxyUser()

setProxyUser

public void setProxyUser(java.lang.String proxyUser)

If your proxy needs authentication you can specify here the user name. Leave this undefined if your proxy does not need authentication.

Parameters:
proxyUser - the name of the user to authenticate with the proxy

getProxyPass

public java.lang.String getProxyPass()

setProxyPass

public void setProxyPass(java.lang.String proxyPass)

If your proxy needs authentication you can specify here the user password. Leave this undefined if your proxy does not need authentication.

Parameters:
proxyPass - the password of the user to authenticate with the proxy

getProxyType

public java.lang.String getProxyType()

setProxyType

public void setProxyType(java.lang.String proxyType)

Here you can specify the type of proxy you have. Possible values are: NONE, HTTP, SOCKS4, SOCKS5

Parameters:
proxyType - the type of proxy (NONE, HTTP, SOCKS4, SOCKS5)

isLogin

public boolean isLogin()

setLogin

public void setLogin(boolean login)

Here you can specify if the user should login to the server or not. Not logging in means that endpoint itself will be created but it will be inactive.

Parameters:
login - a flag if the process should login to the XMPP account (true / false)

getFilter

public org.jivesoftware.smack.filter.PacketFilter getFilter()

setFilter

public void setFilter(org.jivesoftware.smack.filter.PacketFilter filter)

Here you can define a PacketFilter to use for filtering XMPP packets.

Parameters:
filter - a PacketFilter to use for filtering XMPP packets

isCreateAccount

public boolean isCreateAccount()

setCreateAccount

public void setCreateAccount(boolean createAccount)

Specify here if you want to create an account for the user if the user is currently not existing on the XMPP server.

Parameters:
createAccount - flag if an account should be created if the user doesn't exist (true / false)

getRoom

public java.lang.String getRoom()

setRoom

public void setRoom(java.lang.String room)

Specify here an optional room to join. If set, the user will join that room and listens to messages there.

Parameters:
room - the room to join or null if no room should be joined


Copyright © 2005-2015 FuseSource. All Rights Reserved.