org.mule.transport.legstar.http
Class LegstarHttpConnector

java.lang.Object
  extended by org.mule.transport.AbstractConnector
      extended by org.mule.transport.tcp.TcpConnector
          extended by org.mule.transport.http.HttpConnector
              extended by org.mule.transport.legstar.http.LegstarHttpConnector
All Implemented Interfaces:
EventListener, WorkListener, org.mule.api.lifecycle.Disposable, org.mule.api.lifecycle.Initialisable, org.mule.api.lifecycle.Lifecycle, org.mule.api.lifecycle.LifecycleStateEnabled, org.mule.api.lifecycle.Startable, org.mule.api.lifecycle.Stoppable, org.mule.api.NameableObject, org.mule.api.NamedObject, org.mule.api.transport.Connectable, org.mule.api.transport.Connector, LegstarConnector

public class LegstarHttpConnector
extends org.mule.transport.http.HttpConnector
implements LegstarConnector

LegstarConnector is essentially and HttpConnector with transformers to handle to special LegStar messaging to wrap mainframe data. The LegStar support for HTTP must be installed on the mainframe @see http://www.legsem.com/legstar/legstar-chttprt.


Field Summary
static String LEGSTARHTTP
          Protocol name.
 
Fields inherited from class org.mule.transport.http.HttpConnector
clientConnectionManager, COOKIE_SPEC_NETSCAPE, COOKIE_SPEC_RFC2109, DEFAULT_HTTP_GET_BODY_PARAM_PROPERTY, HTTP, HTTP_CONTEXT_PATH_PROPERTY, HTTP_CONTEXT_URI_PROPERTY, HTTP_COOKIE_SPEC_PROPERTY, HTTP_COOKIES_PROPERTY, HTTP_CUSTOM_HEADERS_MAP_PROPERTY, HTTP_DISABLE_STATUS_CODE_EXCEPTION_CHECK, HTTP_ENABLE_COOKIES_PROPERTY, HTTP_ENCODE_PARAMVALUE, HTTP_GET_BODY_PARAM_PROPERTY, HTTP_HEADERS, HTTP_INBOUND_PROPERTIES, HTTP_METHOD_PROPERTY, HTTP_PARAMS_PROPERTY, HTTP_POST_BODY_PARAM_PROPERTY, HTTP_PREFIX, HTTP_QUERY_PARAMS, HTTP_QUERY_STRING, HTTP_RELATIVE_PATH_PROPERTY, HTTP_REQUEST_PATH_PROPERTY, HTTP_REQUEST_PROPERTY, HTTP_SERVLET_REQUEST_PROPERTY, HTTP_SERVLET_RESPONSE_PROPERTY, HTTP_STATUS_PROPERTY, HTTP_VERSION_PROPERTY, ROOT_PATH
 
Fields inherited from class org.mule.transport.tcp.TcpConnector
CLIENT, DEFAULT_BACKLOG, DEFAULT_BUFFER_SIZE, DEFAULT_SO_LINGER, DEFAULT_SOCKET_TIMEOUT, DEFAULT_WAIT_TIMEOUT, KEEP_SEND_SOCKET_OPEN_PROPERTY, SERVER, TCP
 
Fields inherited from class org.mule.transport.AbstractConnector
createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, logger, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, PROPERTY_POLLING_FREQUENCY, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect
 
Fields inherited from interface org.mule.transport.legstar.LegstarConnector
HOST_CHARSET_PROPERTY, HOST_PASSWORD_PROPERTY, HOST_USERID_PROPERTY
 
Fields inherited from interface org.mule.api.transport.Connector
INT_VALUE_NOT_SET
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
LegstarHttpConnector(org.mule.api.MuleContext context)
           
 
Method Summary
 HostCredentials getHostCredentials(org.mule.api.MuleMessage message)
          Credentials can be set at the connector level or passed as properties in incoming messages.
 String getHostPassword()
           
 String getHostUserID()
           
 String getProtocol()
          
 void setHostPassword(String password)
           
 void setHostUserID(String userID)
           
protected  void setupClientAuthorization(org.mule.api.MuleEvent event, org.apache.commons.httpclient.HttpMethod httpMethod, org.apache.commons.httpclient.HttpClient client, org.mule.api.endpoint.ImmutableEndpoint endpoint)
           We override this method from HttpConnector in order to provide basic authentication using the host credentials setup at the connector level or passed as message properties.
 
Methods inherited from class org.mule.transport.http.HttpConnector
connect, disconnect, doClientConnect, doDispose, doInitialise, doStart, doStop, findReceiverByStem, getClientConnectionManager, getCookieSpec, getProxyHostname, getProxyPassword, getProxyPort, getProxyUsername, getReceiverKey, getReceivers, getServerSocket, isEnableCookies, isProxyNtlmAuthentication, lookupReceiver, lookupReceiver, normalizeUrl, registerListener, setClientConnectionManager, setCookieSpec, setEnableCookies, setProxyHostname, setProxyNtlmAuthentication, setProxyPassword, setProxyPort, setProxyUsername
 
Methods inherited from class org.mule.transport.tcp.TcpConnector
configureSocket, doConnect, doDisconnect, getBacklog, getBufferSize, getClientSoTimeout, getDispatchers, getKeepAliveMonitor, getKeepAliveTimeout, getOutputStream, getReceiveBacklog, getReceiveBufferSize, getSendBufferSize, getServerSocketFactory, getServerSoTimeout, getSocket, getSocketFactory, getSocketMaxWait, getSocketSoLinger, getSocketsPoolMaxActive, getSocketsPoolMaxIdle, getSocketsPoolMaxWait, getSocketsPoolNumActive, getTcpProtocol, isKeepAlive, isKeepSendSocketOpen, isResponseEnabled, isReuseAddress, isSendTcpNoDelay, setBacklog, setBufferSize, setClientSoTimeout, setDispatcherFactory, setKeepAlive, setKeepAliveTimeout, setKeepSendSocketOpen, setReceiveBacklog, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSendTcpNoDelay, setServerSocketFactory, setServerSoTimeout, setSocketFactory, setSocketMaxWait, setSocketSoLinger, setTcpProtocol, setTimeout
 
Methods inherited from class org.mule.transport.AbstractConnector
clearDispatchers, clearRequesters, configureDispatcherPool, connect, createDefaultRedeliveryPolicy, createDispatcherMessageProcessor, createMuleMessageFactory, createOperationResource, createReceiver, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOperationResourceFactory, getOutboundExchangePatterns, getOutputStream, getReceiver, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, getTransactionalResource, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isConnecting, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isInitialised, isInitialStateStopped, isStarted, isStarting, isStopped, isStopping, isValidateConnections, lookupReceiver, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, setConnected, setConnecting, setCreateMultipleTransactedReceivers, setDispatcherPoolFactory, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setInitialStateStopped, setMaxDispatchersActive, setMaxRequestersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterPoolMaxWait, setRequesterPoolWhenExhaustedAction, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, shutdownScheduler, start, startAfterConnect, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, validateConnection, workAccepted, workCompleted, workRejected, workStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEGSTARHTTP

public static final String LEGSTARHTTP
Protocol name.

See Also:
Constant Field Values
Constructor Detail

LegstarHttpConnector

public LegstarHttpConnector(org.mule.api.MuleContext context)
Parameters:
context - the Mule context.
Method Detail

getProtocol

public final String getProtocol()

Specified by:
getProtocol in interface org.mule.api.transport.Connector
Overrides:
getProtocol in class org.mule.transport.http.HttpConnector

getHostCredentials

public HostCredentials getHostCredentials(org.mule.api.MuleMessage message)
Credentials can be set at the connector level or passed as properties in incoming messages.

The dynamic credentials passed in message properties take precedence over any connector property.

Specified by:
getHostCredentials in interface LegstarConnector
Parameters:
message - the incoming mule message
Returns:
a set of host credentials

getHostUserID

public String getHostUserID()
Specified by:
getHostUserID in interface LegstarConnector
Returns:
the host user ID

getHostPassword

public String getHostPassword()
Specified by:
getHostPassword in interface LegstarConnector
Returns:
the host Password

setHostUserID

public void setHostUserID(String userID)
Specified by:
setHostUserID in interface LegstarConnector
Parameters:
userID - the host user ID to set

setHostPassword

public void setHostPassword(String password)
Specified by:
setHostPassword in interface LegstarConnector
Parameters:
password - the host Password to set

setupClientAuthorization

protected void setupClientAuthorization(org.mule.api.MuleEvent event,
                                        org.apache.commons.httpclient.HttpMethod httpMethod,
                                        org.apache.commons.httpclient.HttpClient client,
                                        org.mule.api.endpoint.ImmutableEndpoint endpoint)
                                 throws UnsupportedEncodingException
We override this method from HttpConnector in order to provide basic authentication using the host credentials setup at the connector level or passed as message properties. We do that only if authentication was not setup any other way.

Overrides:
setupClientAuthorization in class org.mule.transport.http.HttpConnector
Throws:
UnsupportedEncodingException


Copyright © 2013 LegSem. All Rights Reserved.