public class AisReaders extends Object
AisReader, AisTcpReader, AisUdpReader,
and AisReaderGroup classes defined in this package.| Constructor and Description |
|---|
AisReaders() |
| Modifier and Type | Method and Description |
|---|---|
static AisDirectoryReader |
createDirectoryReader(String dir,
String pattern,
boolean recursive)
Reader that recursively reads files matching pattern in directories with root dir
|
static AisReaderGroup |
createGroup(String name,
List<String> sources)
Equivalent to
parseSource(String) except that it will parse an array of sources. |
static AisReaderGroup |
createGroupFromDefaultsSource()
Creates a default group from reader available in the system property ais.default.sources
|
static AisTcpReader |
createReader(String commaHostPort)
Creates a
AisTcpReader from a list of one or more hosts. |
static AisTcpReader |
createReader(String hostname,
int port)
Create reader ais tcp reader.
|
static AisReader |
createReaderFromFile(String filename)
Creates a
AisReader from a file. |
static AisReader |
createReaderFromInputStream(InputStream inputStream)
Create reader from input stream ais reader.
|
static AisUdpReader |
createUdpReader(int port)
Creates a
AisUdpReader listening on port for any interface |
static AisUdpReader |
createUdpReader(String address,
int port)
Creates a
AisUdpReader listening on ip and port |
static String[] |
getDefaultSources()
Returns the default sources configured for the system.
|
static void |
manageGroup(AisReaderGroup group)
Manage group.
|
public static AisReaderGroup createGroup(String name, List<String> sources)
parseSource(String) except that it will parse an array of sources. Returning a map making
sure there all source names are uniquename - the namesources - the sourcespublic static AisReaderGroup createGroupFromDefaultsSource()
#getDefaultSources()#getDefaultSources()public static AisTcpReader createReader(String commaHostPort)
AisTcpReader from a list of one or more hosts. On the form: host1:port1,...,hostN:portNcommaHostPort - the comma host portpublic static AisTcpReader createReader(String hostname, int port)
hostname - the hostnameport - the portpublic static AisUdpReader createUdpReader(int port)
AisUdpReader listening on port for any interfaceport - the portpublic static AisUdpReader createUdpReader(String address, int port)
AisUdpReader listening on ip and portaddress - the addressport - the portpublic static AisReader createReaderFromInputStream(InputStream inputStream)
inputStream - the input streampublic static AisReader createReaderFromFile(String filename) throws IOException
AisReader from a file. If the file has '.zip' or '.gz' suffix the file will treated as a zip file or
gzip file respectively.filename - the filenameIOException - the io exceptionpublic static AisDirectoryReader createDirectoryReader(String dir, String pattern, boolean recursive) throws IOException
dir - the dirpattern - E.g. *.txt or *.gzrecursive - Apply to all sub directories depth firstIOException - the io exceptionpublic static String[] getDefaultSources()
public static void manageGroup(AisReaderGroup group) throws JMException
group - the groupJMException - the jm exceptionCopyright © 2011–2019 Danish Maritime Authority. All rights reserved.