org.apache.servicemix.xmpp
Class XMPPSenderEndpoint

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.ProviderEndpoint
              extended by org.apache.servicemix.xmpp.XMPPSenderEndpoint
All Implemented Interfaces:
Endpoint, XMPPEndpointType

public class XMPPSenderEndpoint
extends ProviderEndpoint
implements XMPPEndpointType

This endpoint sends XMPP messages from the NMR to a specified target (user or room)

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
XMPPSenderEndpoint()
           
 
Method Summary
 java.lang.String getHost()
           
 XMPPMarshalerSupport getMarshaler()
           
 java.lang.String getParticipant()
           
 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()
           
protected  void processInOnly(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage in)
           
protected  void processInOut(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage in, javax.jbi.messaging.NormalizedMessage out)
           
 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 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 setParticipant(java.lang.String participant)
          Specify here an optional participant to send messages to.
 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.ProviderEndpoint
activate, deactivate, getRole, process
 
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

XMPPSenderEndpoint

public XMPPSenderEndpoint()
Method Detail

validate

public void validate()
              throws javax.jbi.management.DeploymentException
Specified by:
validate in interface Endpoint
Overrides:
validate in class AbstractEndpoint
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

processInOnly

protected void processInOnly(javax.jbi.messaging.MessageExchange exchange,
                             javax.jbi.messaging.NormalizedMessage in)
                      throws java.lang.Exception
Overrides:
processInOnly in class ProviderEndpoint
Throws:
java.lang.Exception

processInOut

protected void processInOut(javax.jbi.messaging.MessageExchange exchange,
                            javax.jbi.messaging.NormalizedMessage in,
                            javax.jbi.messaging.NormalizedMessage out)
                     throws java.lang.Exception
Overrides:
processInOut in class ProviderEndpoint
Throws:
java.lang.Exception

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)

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

getParticipant

public java.lang.String getParticipant()

setParticipant

public void setParticipant(java.lang.String participant)

Specify here an optional participant to send messages to. You have to define a room or participant in order to have send function working.

Parameters:
participant - the receiver of the message (for example: joe@jabber.org)


Copyright © 2005-2015 FuseSource. All Rights Reserved.