de.jw.cloud42.core.endpoint
Class Cloud42Endpoint

java.lang.Object
  extended by de.jw.cloud42.core.endpoint.Cloud42Endpoint
All Implemented Interfaces:
javax.xml.ws.Provider<javax.xml.transform.Source>

@WebServiceProvider
@BindingType(value="http://www.w3.org/2004/08/wsdl/http")
@ServiceMode(value=MESSAGE)
public class Cloud42Endpoint
extends java.lang.Object
implements javax.xml.ws.Provider<javax.xml.transform.Source>

This is an endpoint with a HTTP binding to receive POST notification messages sent from an AMI instance to Cloud42. Per default, it listens to http://localhost:8084/messages, but the address can be changed using the Web Service interface of Cloud42. It uses JAX-WS for a RESTful web service implementation. Incoming messages are parsed into de.jw.cloud42.core.eventing.Message objects using JAXB. Important: Note that the HTTP content type explicitly must be set to text/xml so that a message can be parsed correctly.

Author:
fbitzer

Field Summary
protected  javax.xml.ws.WebServiceContext wsContext
           
 
Method Summary
 java.lang.String getAddress()
          Reads the address of the Cloud42 endpoint from the configuration entry in the database.
static Cloud42Endpoint getInstance()
          Singleton method.
 javax.xml.transform.Source invoke(javax.xml.transform.Source request)
          Invoke method of web service.
 void setAddress(java.lang.String newAddress)
          Set address of Cloud42 endpoint.
 void startEndpoint()
          Create Cloud42 endpoint with HTTP Binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wsContext

protected javax.xml.ws.WebServiceContext wsContext
Method Detail

getInstance

public static Cloud42Endpoint getInstance()
Singleton method.

Returns:
current instance.

invoke

public javax.xml.transform.Source invoke(javax.xml.transform.Source request)
Invoke method of web service. Process incoming message.

Specified by:
invoke in interface javax.xml.ws.Provider<javax.xml.transform.Source>

startEndpoint

public void startEndpoint()
Create Cloud42 endpoint with HTTP Binding. Address is read from settings. If an endpoint is running, it is closed first.

Parameters:
args -

getAddress

public java.lang.String getAddress()
Reads the address of the Cloud42 endpoint from the configuration entry in the database. If no settings entry exists, a default value is returned and saved to database.

Returns:
Address of Cloud42 endpoint for incoming notifications.

setAddress

public void setAddress(java.lang.String newAddress)
Set address of Cloud42 endpoint. Causes restart of endpoint with new address.

Parameters:
newAddress - the address to set.


Copyright © 2010 just works! Software. All Rights Reserved.