org.jdesktop.ws
Class HttpService

java.lang.Object
  extended by org.jdesktop.beans.AbstractBean
      extended by org.jdesktop.ws.BaseService
          extended by org.jdesktop.ws.AbstractHttpService
              extended by org.jdesktop.ws.HttpService

public class HttpService
extends AbstractHttpService

An HTTP based REST web service.


Constructor Summary
HttpService()
           
 
Method Summary
protected  SwingWorker createWorker()
           
protected  void doSend()
          Invoked by this AbstractHttpService, this method performs the actual send operation.
 Request getRequest()
          Gets the Request used by this service.
 Response getResponse()
          Gets the response, if there is one.
 Session.SecurityLevel getSecurityLevel()
          Gets the security level used with this service.
 void setRequest(Request r)
          Sets the Request to use with this service.
 void setSecurityLevel(Session.SecurityLevel level)
          Sets the security level.
 
Methods inherited from class org.jdesktop.ws.AbstractHttpService
doAbort, getSession, setState
 
Methods inherited from class org.jdesktop.ws.BaseService
abort, addAbortListener, addDoneListener, addFailureListener, done, fail, fireOnEDT, getProgress, getState, removeAbortListener, removeDoneListener, removeFailureListener, send, setProgress
 
Methods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpService

public HttpService()
Method Detail

getRequest

public final Request getRequest()
Gets the Request used by this service. This will never return null.

Returns:

setRequest

public void setRequest(Request r)
Sets the Request to use with this service. If null, then a new Request will be created, ensuring that it is never null. This will fire a property change event.

Parameters:
r -

getResponse

public final Response getResponse()
Gets the response, if there is one. This may return null if the state is anything other than DONE. It will not ever be null if the state is DONE.

Returns:

getSecurityLevel

public final Session.SecurityLevel getSecurityLevel()
Gets the security level used with this service. There are three levels of security. The first is "high", which is the default in Java (though not in this class). High security requires that the web server have a certificate signed by a trusted certificate root, such as Verisign. The second level of security is "medium", and is the default for this class. Medium level security means that if a certificate is from a trusted root, then it is trusted. Otherwise, the user is prompted to accept the certificate. This is essentially the mode supported by web browsers. The third level of security is "low" in which case the user will never be prompted. Obviously this is only good for testing (if that) and should never be used when deployed. Note that changing the security level requires priviledges, and thus your app needs to be signed.

Returns:

setSecurityLevel

public void setSecurityLevel(Session.SecurityLevel level)
Sets the security level. This cannot be null.


doSend

protected void doSend()
Description copied from class: BaseService
Invoked by this AbstractHttpService, this method performs the actual send operation. This method must not block.

Overrides:
doSend in class AbstractHttpService

createWorker

protected SwingWorker createWorker()
Specified by:
createWorker in class AbstractHttpService