org.jboss.mq.il.http
Class HTTPServerIL

java.lang.Object
  extended byorg.jboss.mq.il.http.HTTPServerIL
All Implemented Interfaces:
java.io.Serializable, ServerIL (src)

public class HTTPServerIL
extends java.lang.Object
implements java.io.Serializable, ServerIL (src)

Client proxy to the server. For each request, an HTTP or HTTPS request is created, and posted to the given URL. The URL is supplied in the HTTPServerILService MBean configuration, or automatically generated by as localhost here, but can be overridden on the client side by specifying a property name for the URL value, which will be resolved to a system property on the client side.

See Also:
Serialized Form

Constructor Summary
HTTPServerIL(java.lang.String url)
           
 
Method Summary
 void acknowledge(ConnectionToken (src)  dc, AcknowledgementRequest (src)  item)
          #Description of the Method
 void addMessage(ConnectionToken (src)  dc, SpyMessage (src)  message)
          Adds a message to the destination specifyed in the message.
 java.lang.String authenticate(java.lang.String userName, java.lang.String password)
          Authenticate the user.
 SpyMessage (src) [] browse(ConnectionToken (src)  dc, Destination (src)  dest, java.lang.String selector)
          #Description of the Method
 void checkID(java.lang.String ID)
          Check if clientID is a valid ID.
 java.lang.String checkUser(java.lang.String userName, java.lang.String password)
          Get a clientID for a given user/password.
 ServerIL (src) cloneServerIL()
          #Description of the Method
 void connectionClosing(ConnectionToken (src)  dc)
          The client is closing the connection.
 Queue (src) createQueue(ConnectionToken (src)  dc, java.lang.String dest)
          #Description of the Method
 Topic (src) createTopic(ConnectionToken (src)  dc, java.lang.String dest)
          #Description of the Method
 void deleteTemporaryDestination(ConnectionToken (src)  dc, SpyDestination (src)  dest)
          #Description of the Method
 void destroySubscription(ConnectionToken (src)  dc, DurableSubscriptionID (src)  id)
          Unsubscribe from a durable subscription.
 java.lang.String getID()
          Get a clientID from the server.
 TemporaryQueue (src) getTemporaryQueue(ConnectionToken (src)  dc)
          Gets the TemporaryQueue attribute of the ServerIL object
 TemporaryTopic (src) getTemporaryTopic(ConnectionToken (src)  dc)
          Gets the TemporaryTopic attribute of the ServerIL object
 void ping(ConnectionToken (src)  dc, long clientTime)
          Ping the server.
 SpyMessage (src) receive(ConnectionToken (src)  dc, int subscriberId, long wait)
          Get a message synchronously.
 void setConnectionToken(ConnectionToken (src)  newConnectionToken)
           
 void setEnabled(ConnectionToken (src)  dc, boolean enabled)
          Sets the Enabled attribute of the ServerIL object
 void subscribe(ConnectionToken (src)  dc, Subscription (src)  s)
           
 void transact(ConnectionToken (src)  dc, TransactionRequest (src)  t)
          #Description of the Method
 void unsubscribe(ConnectionToken (src)  dc, int subscriptionId)
          Remove a consumer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPServerIL

public HTTPServerIL(java.lang.String url)
             throws java.lang.Exception
Method Detail

acknowledge

public void acknowledge(ConnectionToken (src)  dc,
                        AcknowledgementRequest (src)  item)
                 throws java.lang.Exception
Description copied from interface: ServerIL (src)
#Description of the Method

Specified by:
acknowledge in interface ServerIL (src)
Parameters:
dc - Description of Parameter
item - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

addMessage

public void addMessage(ConnectionToken (src)  dc,
                       SpyMessage (src)  message)
                throws java.lang.Exception
Description copied from interface: ServerIL (src)
Adds a message to the destination specifyed in the message.

Specified by:
addMessage in interface ServerIL (src)
Parameters:
dc - The feature to be added to the Message attribute
message - The feature to be added to the Message attribute
Throws:
java.lang.Exception - Description of Exception

authenticate

public java.lang.String authenticate(java.lang.String userName,
                                     java.lang.String password)
                              throws java.lang.Exception
Description copied from interface: ServerIL (src)
Authenticate the user. If using a securityManager the user will be autenticated by that.

Specified by:
authenticate in interface ServerIL (src)
Parameters:
userName - a username.
password - a password.
Returns:
a sessionid, valid only for the life of this connection.
Throws:
java.lang.Exception - Description of Exception

browse

public SpyMessage (src) [] browse(ConnectionToken (src)  dc,
                           Destination (src)  dest,
                           java.lang.String selector)
                    throws java.lang.Exception
Description copied from interface: ServerIL (src)
#Description of the Method

Specified by:
browse in interface ServerIL (src)
Parameters:
dc - Description of Parameter
dest - Description of Parameter
selector - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

checkID

public void checkID(java.lang.String ID)
             throws java.lang.Exception
Description copied from interface: ServerIL (src)
Check if clientID is a valid ID. This method should be called when the client tries to set its own clientID. It is up to the server side components to update the ConectionToken if this method returns normaly.

Specified by:
checkID in interface ServerIL (src)
Parameters:
ID - a clientID set by the client.
Throws:
java.lang.Exception - if the clientID was not vallid.

checkUser

public java.lang.String checkUser(java.lang.String userName,
                                  java.lang.String password)
                           throws java.lang.Exception
Description copied from interface: ServerIL (src)
Get a clientID for a given user/password. May also be used for autentication if StateManager is used as authenticator.

Specified by:
checkUser in interface ServerIL (src)
Parameters:
userName - a valid user name that the StateManager knows about.
password - a password
Returns:
a preconfigured clientID or null.
Throws:
java.lang.Exception - Description of Exception

cloneServerIL

public ServerIL (src)  cloneServerIL()
                       throws java.lang.Exception
Description copied from interface: ServerIL (src)
#Description of the Method

Specified by:
cloneServerIL in interface ServerIL (src)
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

connectionClosing

public void connectionClosing(ConnectionToken (src)  dc)
                       throws java.lang.Exception
Description copied from interface: ServerIL (src)
The client is closing the connection.

Specified by:
connectionClosing in interface ServerIL (src)
Parameters:
dc - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

createQueue

public Queue (src)  createQueue(ConnectionToken (src)  dc,
                         java.lang.String dest)
                  throws java.lang.Exception
Description copied from interface: ServerIL (src)
#Description of the Method

Specified by:
createQueue in interface ServerIL (src)
Parameters:
dc - Description of Parameter
dest - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

createTopic

public Topic (src)  createTopic(ConnectionToken (src)  dc,
                         java.lang.String dest)
                  throws java.lang.Exception
Description copied from interface: ServerIL (src)
#Description of the Method

Specified by:
createTopic in interface ServerIL (src)
Parameters:
dc - Description of Parameter
dest - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

deleteTemporaryDestination

public void deleteTemporaryDestination(ConnectionToken (src)  dc,
                                       SpyDestination (src)  dest)
                                throws java.lang.Exception
Description copied from interface: ServerIL (src)
#Description of the Method

Specified by:
deleteTemporaryDestination in interface ServerIL (src)
Parameters:
dc - Description of Parameter
dest - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

destroySubscription

public void destroySubscription(ConnectionToken (src)  dc,
                                DurableSubscriptionID (src)  id)
                         throws java.lang.Exception
Description copied from interface: ServerIL (src)
Unsubscribe from a durable subscription.

Specified by:
destroySubscription in interface ServerIL (src)
Parameters:
id - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

getID

public java.lang.String getID()
                       throws java.lang.Exception
Description copied from interface: ServerIL (src)
Get a clientID from the server. It is up to the server side components to update the ConectionToken if this method returns normaly.

Specified by:
getID in interface ServerIL (src)
Returns:
an internally generated clientID.
Throws:
java.lang.Exception - Description of Exception

getTemporaryQueue

public TemporaryQueue (src)  getTemporaryQueue(ConnectionToken (src)  dc)
                                 throws java.lang.Exception
Description copied from interface: ServerIL (src)
Gets the TemporaryQueue attribute of the ServerIL object

Specified by:
getTemporaryQueue in interface ServerIL (src)
Parameters:
dc - Description of Parameter
Returns:
The TemporaryQueue value
Throws:
java.lang.Exception - Description of Exception

getTemporaryTopic

public TemporaryTopic (src)  getTemporaryTopic(ConnectionToken (src)  dc)
                                 throws java.lang.Exception
Description copied from interface: ServerIL (src)
Gets the TemporaryTopic attribute of the ServerIL object

Specified by:
getTemporaryTopic in interface ServerIL (src)
Parameters:
dc - Description of Parameter
Returns:
The TemporaryTopic value
Throws:
java.lang.Exception - Description of Exception

ping

public void ping(ConnectionToken (src)  dc,
                 long clientTime)
          throws java.lang.Exception
Description copied from interface: ServerIL (src)
Ping the server.

Specified by:
ping in interface ServerIL (src)
Parameters:
dc - Description of Parameter
clientTime - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

receive

public SpyMessage (src)  receive(ConnectionToken (src)  dc,
                          int subscriberId,
                          long wait)
                   throws java.lang.Exception
Description copied from interface: ServerIL (src)
Get a message synchronously.

Specified by:
receive in interface ServerIL (src)
Parameters:
dc - Description of Parameter
subscriberId - Description of Parameter
wait - Description of Parameter
Returns:
Description of the Returned Value
Throws:
java.lang.Exception - Description of Exception

setConnectionToken

public void setConnectionToken(ConnectionToken (src)  newConnectionToken)
                        throws java.lang.Exception
Specified by:
setConnectionToken in interface ServerIL (src)
Parameters:
newConnectionToken - org.jboss.mq.ConnectionToken
Throws:
java.lang.Exception - The exception description.

setEnabled

public void setEnabled(ConnectionToken (src)  dc,
                       boolean enabled)
                throws java.lang.Exception
Description copied from interface: ServerIL (src)
Sets the Enabled attribute of the ServerIL object

Specified by:
setEnabled in interface ServerIL (src)
Parameters:
dc - The new Enabled value
enabled - The new Enabled value
Throws:
java.lang.Exception - Description of Exception

subscribe

public void subscribe(ConnectionToken (src)  dc,
                      Subscription (src)  s)
               throws java.lang.Exception
Specified by:
subscribe in interface ServerIL (src)
Parameters:
dc - org.jboss.mq.ConnectionToken
s - org.jboss.mq.Subscription
Throws:
java.lang.Exception - The exception description.

transact

public void transact(ConnectionToken (src)  dc,
                     TransactionRequest (src)  t)
              throws java.lang.Exception
Description copied from interface: ServerIL (src)
#Description of the Method

Specified by:
transact in interface ServerIL (src)
Parameters:
dc - Description of Parameter
t - Description of Parameter
Throws:
java.lang.Exception - Description of Exception

unsubscribe

public void unsubscribe(ConnectionToken (src)  dc,
                        int subscriptionId)
                 throws java.lang.Exception
Description copied from interface: ServerIL (src)
Remove a consumer. Is NOT the same as the topic session unsubscribe.

Specified by:
unsubscribe in interface ServerIL (src)
Parameters:
dc - Description of Parameter
subscriptionId - Description of Parameter
Throws:
java.lang.Exception - Description of Exception