public class URLOutputNode extends Node
This Node
writes out incoming streams the specified URL.
SEQUENCE_NUMBER
this will be replaced by a sequential number per
stream (i.e. 0..n ).STREAMDESCRIPTOR_FILENAME
this will be replaced by the filename that
the StreamDescriptor
provides for particular stream.
See: StreamDescriptor.getFileName()
Currently, the only supported protocols are:
file
ftp
As this node is a data sink it must not have a successor.
Modifier and Type | Class and Description |
---|---|
static interface |
URLOutputNode.StreamListener
This listener will be informed whenever a
Stream has been successfully written
on the server side. |
Node.Cardinality
Modifier and Type | Field and Description |
---|---|
static String |
SEQUENCE_NUMBER
Pattern that will be replaced by a sequence number.
|
static String |
STREAMDESCRIPTOR_FILENAME
Pattern that will be replaced by the filename given in the
StreamDescriptor . |
static String[] |
SUPPORTED_PROTOCOLS
Protocols supported by this node.
|
Constructor and Description |
---|
URLOutputNode() |
Modifier and Type | Method and Description |
---|---|
void |
addStreamListener(URLOutputNode.StreamListener listener)
Adds a listener to be informed about a
Stream been written |
URL |
generateEffectiveURL(StreamDescriptor sd,
String seqNumber)
Creates an URL for a
Stream to write as specified in this node and replaces all
patterns. |
String |
getFileNamePattern() |
Node.Cardinality |
getOutputCardinality()
Return the output cardinality of this node, i.e.
|
URL |
getUrlPath() |
String |
getWorkerClassName()
Return the node's associated
NodeWorker full qualified class's
name. |
protected void |
initialize(CommunicationSide side) |
boolean |
isAllowOverwrite() |
void |
removeStreamListener(URLOutputNode.StreamListener listener)
Removes a
URLOutputNode.StreamListener for the events. |
void |
setAllowOverwrite(boolean allowOverwrite)
Flag if it's allowed to overwrite already existing files (default:
false ). |
void |
setFileNamePattern(String fileNamePattern)
Set a pattern for the filename.
|
void |
setUrlPath(URL url)
Set the path of the
URL (without the filename) |
void |
validate()
Tests if all parameters are valid.
|
protected void |
validateConfiguration() |
addTransportReceiver, appendSuccessor, apply, equals, getInputCardinality, getJob, getPredecessors, getSubsidiaryNodes, getSuccessors, getTransportSender, getUUID, hashCode, prependPredecessor, remove
public static final String SEQUENCE_NUMBER
public static final String STREAMDESCRIPTOR_FILENAME
StreamDescriptor
.public static final String[] SUPPORTED_PROTOCOLS
public URL generateEffectiveURL(StreamDescriptor sd, String seqNumber) throws MalformedURLException
Stream
to write as specified in this node and replaces all
patterns.sd
- The StreamDescriptorseqNumber
- The sequence number of the StreamMalformedURLException
- If the given parameters are not validpublic void validate() throws IllegalArgumentException
IllegalArgumentException
- if any of the parameters is not valid.public String getWorkerClassName()
Node
Return the node's associated
NodeWorker
full qualified class's
name. By default, the worker class name is
This behavior can be overridden in concrete subclasses.
getWorkerClassName
in class Node
protected void initialize(CommunicationSide side)
initialize
in class Node
public String getFileNamePattern()
public void setFileNamePattern(String fileNamePattern) throws MalformedURLException, URISyntaxException
Set a pattern for the filename.
Legal place holders are SEQUENCE_NUMBER
and STREAMDESCRIPTOR_FILENAME
.
fileNamePattern
- The pattern to setURISyntaxException
MalformedURLException
public boolean isAllowOverwrite()
public void setAllowOverwrite(boolean allowOverwrite)
Flag if it's allowed to overwrite already existing files (default: false
). In such
a case an error with MessageID JS.SERVER.NODES-OVERWRITE_FORBIDDEN
will be raised.
Implementation node: This flag is only respected when using the protocol
file
.
allowOverwrite
- files are allowed be be overwritten iff set to true
public URL getUrlPath()
public void setUrlPath(URL url) throws MalformedURLException, URISyntaxException
Set the path of the URL
(without the filename)
url
- the base URL.MalformedURLException
URISyntaxException
public Node.Cardinality getOutputCardinality()
Node
getOutputCardinality
in class Node
protected void validateConfiguration() throws ConfigurationException
validateConfiguration
in class Node
ConfigurationException
public void addStreamListener(URLOutputNode.StreamListener listener)
Stream
been writtenlistener
- The listener to addpublic void removeStreamListener(URLOutputNode.StreamListener listener)
URLOutputNode.StreamListener
for the events.listener
- The listener to removeCopyright © 2017 levigo holding gmbh. All rights reserved.