org.ow2.petals.bc.sftp
Class SFTPUtil

java.lang.Object
  extended by org.ow2.petals.bc.sftp.SFTPUtil

public class SFTPUtil
extends java.lang.Object

This class intends to provide some useful methods like a message exchange fault setter.

Author:
Charles Casadei - eBM WebSourcing

Constructor Summary
SFTPUtil()
           
 
Method Summary
static void addRootElement(org.w3c.dom.Document document, javax.xml.namespace.QName rootElement)
          Add a root element to the given document.
static boolean checkMEP(org.ow2.petals.component.framework.api.message.Exchange exchange, boolean isInOnly, boolean isRobustInOnly, boolean isInOptionalOut, boolean isInOut)
          Checks if the MEP of the given message exchange is valid against the given configuration.
static java.lang.String generateFileNameList(java.util.List<java.lang.String> names, javax.xml.namespace.QName operation)
          Generates an XML payload from an operation name an a list of filenames.
static org.w3c.dom.Document generateMTOMListResponse(java.util.List<java.lang.String> names, javax.xml.namespace.QName operation)
          Generate a MTOM response for a list of files.
static org.w3c.dom.Document generateMTOMResponse(java.lang.String names, javax.xml.namespace.QName operation)
          Generate a MTOM response for a single file.
static java.lang.String getValidMepMessageForOperation(java.lang.String operation, org.ow2.petals.component.framework.api.Message.MEPConstants... mep)
          Build a message to indicate the mep available for this operation.
static void setConfigurationFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange, java.lang.String configurationError)
          Sets a ConfigurationFault on the given message exchange.
static void setIOFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange, java.lang.String ioMessage)
          Sets an IOFault on the given message exchange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SFTPUtil

public SFTPUtil()
Method Detail

generateFileNameList

public static java.lang.String generateFileNameList(java.util.List<java.lang.String> names,
                                                    javax.xml.namespace.QName operation)
Generates an XML payload from an operation name an a list of filenames.

Parameters:
names - filenames which will be contained in the XML payload
operation - the operation which requested to build a filelist
Returns:
an XML payload containing a list of filenames

generateMTOMListResponse

public static org.w3c.dom.Document generateMTOMListResponse(java.util.List<java.lang.String> names,
                                                            javax.xml.namespace.QName operation)
Generate a MTOM response for a list of files.

Parameters:
names -
operation -
Returns:

generateMTOMResponse

public static org.w3c.dom.Document generateMTOMResponse(java.lang.String names,
                                                        javax.xml.namespace.QName operation)
Generate a MTOM response for a single file.

Parameters:
names -
operation -
Returns:

setIOFaultOnExchange

public static void setIOFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange,
                                        java.lang.String ioMessage)
                                 throws javax.jbi.messaging.MessagingException
Sets an IOFault on the given message exchange.

Parameters:
exchange -
ioMessage -
Throws:
javax.jbi.messaging.MessagingException

setConfigurationFaultOnExchange

public static void setConfigurationFaultOnExchange(org.ow2.petals.component.framework.api.message.Exchange exchange,
                                                   java.lang.String configurationError)
                                            throws javax.jbi.messaging.MessagingException
Sets a ConfigurationFault on the given message exchange.

Parameters:
exchange -
configurationError -
Throws:
javax.jbi.messaging.MessagingException

checkMEP

public static final boolean checkMEP(org.ow2.petals.component.framework.api.message.Exchange exchange,
                                     boolean isInOnly,
                                     boolean isRobustInOnly,
                                     boolean isInOptionalOut,
                                     boolean isInOut)
Checks if the MEP of the given message exchange is valid against the given configuration.

Parameters:
exchange - a message exchange
isInOnly - if the InOnly MEP is supported
isRobustInOnly - if the RobustInOnly MEP is supported
isInOptionalOut - if the InOptionalOut MEP is supported
isInOut - if the InOut MEP is supported
Returns:
true if the MEP is valid against the given configuration

addRootElement

public static final void addRootElement(org.w3c.dom.Document document,
                                        javax.xml.namespace.QName rootElement)
Add a root element to the given document.

Parameters:
document -
rootElement -

getValidMepMessageForOperation

public static java.lang.String getValidMepMessageForOperation(java.lang.String operation,
                                                              org.ow2.petals.component.framework.api.Message.MEPConstants... mep)
Build a message to indicate the mep available for this operation. TODO : Move it in the cdk api.

Parameters:
operation -
mep -
Returns:


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.