org.cip4.elk.impl.jmf
Class SyncHttpOutgoingJMFDispatcher

java.lang.Object
  extended by org.cip4.elk.impl.jmf.SyncHttpOutgoingJMFDispatcher
All Implemented Interfaces:
org.cip4.elk.jmf.OutgoingJMFDispatcher
Direct Known Subclasses:
AsyncHttpOutgoingJMFDispatcher

public class SyncHttpOutgoingJMFDispatcher
extends java.lang.Object
implements org.cip4.elk.jmf.OutgoingJMFDispatcher

An outgoing JMF dispatcher that sends JMF over HTTP synchronously. A call to dispatchJMFdoes not return until the message has been delivered or an exception is thrown.

Version:
$Id: SyncHttpOutgoingJMFDispatcher.java,v 1.10 2006/11/17 14:32:39 buckwalter Exp $
Author:
Claes Buckwalter (clabu@itn.liu.se)

Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
SyncHttpOutgoingJMFDispatcher(org.cip4.elk.device.DeviceConfig config)
          Constructs a new outgoing dispatcher that supports 5 concurrent HTTP connections.
SyncHttpOutgoingJMFDispatcher(org.cip4.elk.device.DeviceConfig config, int maxConnections)
          Constructs a new outgoing dispatcher with the specified configuration.
 
Method Summary
 void dispatchJDF(org.cip4.jdflib.node.JDFNode jdf, java.lang.String url)
          Sends a HTTP POST request containing the specified JDF document to the specified URL.
 org.cip4.jdflib.jmf.JDFResponse dispatchJMF(org.cip4.jdflib.jmf.JDFJMF jmf, java.lang.String url)
          Sends a HTTP POST request containing the specified JMF message to the specified URL.
 void dispatchSignal(org.cip4.jdflib.jmf.JDFJMF jmfSignal, java.lang.String url)
          Sends a HTTP POST request containing the specified JMF Signal message.
 org.apache.commons.httpclient.methods.PostMethod postData(org.cip4.jdflib.core.JDFElement jdf, java.lang.String url)
          Sends a HTTP POST with the request-body containing the specified JDF element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log
Constructor Detail

SyncHttpOutgoingJMFDispatcher

public SyncHttpOutgoingJMFDispatcher(org.cip4.elk.device.DeviceConfig config)
Constructs a new outgoing dispatcher that supports 5 concurrent HTTP connections. This dispatcher gets its proxy settings from the Config object. If no proxy settings are configured in the Config object no proxy will be used.

Parameters:
config - a configuration containing optional proxy settings

SyncHttpOutgoingJMFDispatcher

public SyncHttpOutgoingJMFDispatcher(org.cip4.elk.device.DeviceConfig config,
                                     int maxConnections)
Constructs a new outgoing dispatcher with the specified configuration. This dispatcher gets its proxy settings from the Config object. If no proxy settings are configured in the Config object no proxy will be used.

Parameters:
config - a configuration containing optional proxy settings
maxConnections - the maximum number of concurrent HTTP connections
See Also:
org.cip4.elk.Config
Method Detail

dispatchJMF

public org.cip4.jdflib.jmf.JDFResponse dispatchJMF(org.cip4.jdflib.jmf.JDFJMF jmf,
                                                   java.lang.String url)
Sends a HTTP POST request containing the specified JMF message to the specified URL.

Specified by:
dispatchJMF in interface org.cip4.elk.jmf.OutgoingJMFDispatcher

dispatchJDF

public void dispatchJDF(org.cip4.jdflib.node.JDFNode jdf,
                        java.lang.String url)
Sends a HTTP POST request containing the specified JDF document to the specified URL.

Specified by:
dispatchJDF in interface org.cip4.elk.jmf.OutgoingJMFDispatcher

dispatchSignal

public void dispatchSignal(org.cip4.jdflib.jmf.JDFJMF jmfSignal,
                           java.lang.String url)
Sends a HTTP POST request containing the specified JMF Signal message.

Specified by:
dispatchSignal in interface org.cip4.elk.jmf.OutgoingJMFDispatcher

postData

public org.apache.commons.httpclient.methods.PostMethod postData(org.cip4.jdflib.core.JDFElement jdf,
                                                                 java.lang.String url)
                                                          throws java.io.IOException
Sends a HTTP POST with the request-body containing the specified JDF element. If the JDF element is a JMF message the request-header Content-type is set to application/vnd.cip4-jmf+xml; charset=UTF-8; otherwise application/vnd.cip4-jdf+xml; charset=UTF-8 is used.

Parameters:
jdf - the JDF/JMF to send in request body
url - the URL to post to
Returns:
The object representing the HTTP POST used. This can be used to retrieve the responses headers and body.
Throws:
java.io.IOException - if an IO error occurred
See Also:
PostMethod


Copyright © 2004-2009 CIP4. All Rights Reserved.