public abstract class JmsExtenderHook
extends java.lang.Object
Constructor and Description |
---|
JmsExtenderHook() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDedicatedBrokerConnectionName(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String clientId)
Dedicated JMS broker connection name mangling or decoration function.
|
java.lang.String |
getDurableSubscriptionName(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String clientId,
java.lang.String sessionGuid,
java.lang.String subscriptionName,
java.lang.String topicName)
Durable subscription name mangling or decoration function.
|
void |
init(java.io.File configDir)
Hook initialization.
|
void |
onConnectionClose(java.lang.String connectionId)
User connection close notification.
|
boolean |
onConnectionRequest(java.lang.String connectionId,
java.lang.String user,
java.lang.String password,
java.util.Map clientContext,
java.lang.String clientPrincipal)
User connection and authentication request.
|
boolean |
onDedicatedBrokerConnectionRequest(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String clientId)
Dedicated JMS broker connection request.
|
void |
onDurableSubscriptionClose(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String clientId,
java.lang.String sessionGuid,
java.lang.String subscriptionName,
java.lang.String topicName)
Durable subscription consumer close notification.
|
boolean |
onDurableSubscriptionRequest(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String clientId,
java.lang.String sessionGuid,
java.lang.String subscriptionName,
java.lang.String topicName)
Durable subscription request.
|
void |
onMessageConsumerClose(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid,
java.lang.String destinationName,
boolean destinationIsTopic)
Message consumer close notification.
|
boolean |
onMessageConsumerRequest(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid,
java.lang.String destinationName,
boolean destinationIsTopic)
Message consumer creation request.
|
void |
onMessageProducerClose(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid,
java.lang.String destinationName,
boolean destinationIsTopic)
Message producer close notification.
|
boolean |
onMessageProducerRequest(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid,
java.lang.String destinationName,
boolean destinationIsTopic)
Message producer creation request.
|
java.lang.String |
onObjectMessagePayloadClassRequest(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid,
java.lang.String destinationName,
boolean destinationIsTopic,
java.lang.String classFullyQualifiedName)
Object message payload class request.
|
java.lang.Object |
onObjectMessagePayloadRequest(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid,
java.lang.String destinationName,
boolean destinationIsTopic,
java.lang.Object payload)
Object message payload request.
|
void |
onSessionClose(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid)
Session close notification.
|
void |
onSessionOpen(java.lang.String connectionId,
java.lang.String jmsConnector,
java.lang.String sessionGuid)
Session open notification.
|
public void init(java.io.File configDir) throws HookException
configDir
- the directory where the JMS Connectors configuration is located.HookException
- in case the initialization can't complete successfully.
In this case the JMS Extender will abort and the Lightstreamer sever will fail
the initialization too.public boolean onConnectionRequest(java.lang.String connectionId, java.lang.String user, java.lang.String password, java.util.Map clientContext, java.lang.String clientPrincipal) throws HookException
use_client_auth
and force_client_auth
parameters).
Default implementation simply returns true
.connectionId
- the unique identifier of the user's connection.user
- the name of the user trying to connect.password
- the password of the user trying to connect.clientContext
- a key-value map containing properties of the user's
request; available keys are:"REMOTE_IP"
- a string representation of the remote IP related
to the current connection; it may be a proxy address.
"REMOTE_PORT"
- string representation of the remote port
related to the current connection.
"USER_AGENT"
- the user-agent as declared in the current
connection HTTP header.
"FORWARDING_INFO"
- the comma-separated list of addresses
forwarded by intermediaries, obtained from the X-Forwarded-For HTTP header,
related to the current connection; intermediate proxies usually set this
header to supply connection routing information. Note that if the number of
forwards to be considered local to the Server environment has been specified
through the skip_local_forwards
configuration element, in order
to better determine the remote address, then these forwards will not be
included in the list.
"LOCAL_SERVER"
- the name of the specific server socket
that handles the current connection, as configured through the
http_server
or https_server
element.
"HTTP_HEADERS"
- a map object that contains a name-value
pair for each header found in the HTTP request that originated the call.
clientPrincipal
- the identification name reported in the client
TLS/SSL certificate supplied on the socket connection used to issue the
request that originated the call; it can be null if client has not
authenticated itself or the authentication has failed.HookException
- in case the authentication can't complete successfully,
(the user will be denied the connection).public void onConnectionClose(java.lang.String connectionId)
connectionId
- the unique identifier of the user's connection.public boolean onDedicatedBrokerConnectionRequest(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String clientId) throws HookException
true
.connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is trying
to open a dedicated JMS broker connection on.clientId
- the client ID specified by the user for the JMS broker connection
(already mangled and/or decorated by getDedicatedBrokerConnectionName(java.lang.String, java.lang.String, java.lang.String)
).HookException
- in case of a specific error
(the connection will be denied and the exception forwarded to the client).public void onSessionOpen(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid)
connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user opened the
session on.sessionGuid
- the GUID of the user's JMS session.public void onSessionClose(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid)
connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the session was opened on.sessionGuid
- the GUID of the user's JMS session.public boolean onMessageConsumerRequest(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid, java.lang.String destinationName, boolean destinationIsTopic) throws HookException
true
.connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is trying
to create the consumer on.sessionGuid
- the GUID of the user's JMS session.destinationName
- the name of the destination addressed by the consumer.destinationIsTopic
- true if the destination is a topic.HookException
- in case of a specific error
(the creation will be denied and the exception forwarded to the client).public void onMessageConsumerClose(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid, java.lang.String destinationName, boolean destinationIsTopic)
connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the consumer was opened on.sessionGuid
- the GUID of the user's JMS session.destinationName
- the name of the destination addressed by the consumer.destinationIsTopic
- true if the destination is a topic.public boolean onDurableSubscriptionRequest(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String clientId, java.lang.String sessionGuid, java.lang.String subscriptionName, java.lang.String topicName) throws HookException
true
.connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is trying
to open the durable subscription on.clientId
- the client ID specified by the user for the JMS connection.sessionGuid
- the GUID of the user's JMS session.subscriptionName
- the name of the durable subscription
(already mangled and/or decorated by getDurableSubscriptionName(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
).topicName
- the name of the topic addressed by the durable subscription.HookException
- in case of a specific error
(the subscription will be denied and the exception forwarded to the client).public void onDurableSubscriptionClose(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String clientId, java.lang.String sessionGuid, java.lang.String subscriptionName, java.lang.String topicName)
connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user opened the durable
subscription on.clientId
- the client ID specified by the user for the JMS connection.sessionGuid
- the GUID of the user's JMS session.subscriptionName
- the name of the durable subscription.topicName
- the name of the topic addressed by the durable subscription.public boolean onMessageProducerRequest(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid, java.lang.String destinationName, boolean destinationIsTopic) throws HookException
true
.connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is trying
to create the producer on.sessionGuid
- the GUID of the user's JMS session.destinationName
- the name of the destination addressed by the producer.destinationIsTopic
- true if the destination is a topic.HookException
- in case of a specific error
(the creation will be denied and the exception forwarded to the client).public void onMessageProducerClose(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid, java.lang.String destinationName, boolean destinationIsTopic)
connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the producer was opened on.sessionGuid
- the GUID of the user's JMS session.destinationName
- the name of the destination addressed by the producer.destinationIsTopic
- true if the destination is a topic.public java.lang.String onObjectMessagePayloadClassRequest(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid, java.lang.String destinationName, boolean destinationIsTopic, java.lang.String classFullyQualifiedName) throws HookException
classFullyQualifiedName
.connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is tryingsessionGuid
- the GUID of the user's JMS session.destinationName
- the name of the destination addressed by the producer.destinationIsTopic
- true if the destination is a topic.classFullyQualifiedName
- requested fully qualified name of the class for the object message payload.HookException
- in case of a specific error
(the request will be denied and the exception forwarded to the client).public java.lang.Object onObjectMessagePayloadRequest(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String sessionGuid, java.lang.String destinationName, boolean destinationIsTopic, java.lang.Object payload) throws HookException
payload
.connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is tryingsessionGuid
- the GUID of the user's JMS session.destinationName
- the name of the destination addressed by the producer.destinationIsTopic
- true if the destination is a topic.payload
- requested object message payload.HookException
- in case of a specific error
(the request will be denied and the exception forwarded to the client).public java.lang.String getDedicatedBrokerConnectionName(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String clientId)
connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is trying
to open a dedicated JMS broker connection on.clientId
- the client ID specified by the user for the JMS broker connection.public java.lang.String getDurableSubscriptionName(java.lang.String connectionId, java.lang.String jmsConnector, java.lang.String clientId, java.lang.String sessionGuid, java.lang.String subscriptionName, java.lang.String topicName)
connectionId
- the unique identifier of the user's connection.jmsConnector
- the name of the JMS Connector the user is trying
to open the durable subscription on.clientId
- the client ID specified by the user for the JMS connection.sessionGuid
- the GUID of the user's JMS session.subscriptionName
- the name of the durable subscription specified
by the client.topicName
- the name of the topic addressed by the durable subscription.