Connector.java 3.91 KB
Newer Older
1
package eu.simstadt.nf4j;
2
3
4
5
6
7

import java.io.File;

/**
 * NFConnector lets you communicate with your novaFACTORY (nF) server instance.
 * 
bruse's avatar
bruse committed
8
9
10
 * @param <I> The import job implementation which can be handled by the connector.
 * @param <E> The export job implementation which can be handled by the connector.
 * 
11
12
 * @author Marcel Bruse
 */
bruse's avatar
bruse committed
13
public interface Connector<I extends ImportJob<?>, E extends ExportJob<?>> {
14
15
16
17
18
19
20
	
	/**
	 * Callers of this NFConnector want to know the actual version of the novaFACTORY and the versions of its
	 * HTTP/FTP/WPS/etc. interfaces against which this interface has been implemented.
	 * 
	 * The various NovaFACTORY interfaces may change over time. Such changes force the SimStadt programmers to
	 * implement different versions of this NFConnector interface while keeping old implementations due to 
21
	 * backward compatibility.
22
23
24
25
26
27
	 * 
	 * @return The supported version of the novaFACTORY.
	 */
	public String supportsNFVersion();
	
	/**
28
	 * Sends an export job to nF. The job has to be passed to the nF in an appropriate XML job file.
29
	 * The DTD of the XML format can be obtained from the nF installation or documentation.
30
31
32
33
34
	 * The contents of the XML job file are detailed in the job's descriptor instance. This method is supposed to
	 * update the status of the job and the job id.
	 *  
	 * @param job The nF export job with description. If the job description is invalid, you will receive an
	 * InvalidJobDescriptorException.
35
	 */
bruse's avatar
bruse committed
36
	public void sendAndUpdateExportJob(E exportJob)
37
			throws InvalidJobDescriptorException, FailedTransmissionException;
38
39
	
	/**
40
41
42
	 * Sends an import job to nF. A given import job descriptor has to describe the import job file. This 
	 * method has to build the file and to zip it. The zip file has to obey the internal structure defined
	 * in the nF manuals. Short description:
43
	 * 
44
45
46
47
48
49
50
	 * Import jobs enable you to add, alter and delete CityGML top level objects (like buildings) in the nF.
	 * Every import job file has to contain a start file. Start files control the import process through their
	 * file names and their contents. The name of a start file has the following structure
	 * 
	 *     <Product>_<Tile>.start
	 *     
	 * The start file should contain the level to which your manipulated CityGML should be imported. Your CityGML
51
	 * file and the ZIP archive to be sent has to be named after the following naming convention:
52
53
54
55
56
57
58
59
60
61
62
	 * 
	 *     <Product>_<Tile>_<Level>_<Operation>.gml
	 *    
	 * Here operation can be ...
	 * - 'REP': Replaces whole existing buildings only,
	 * - 'REPUPD': Replaces whole existing buildings and adds new buildings, 
	 * - 'UPD': Update, same as REP,
	 * - 'CHG': Change, same as REPUPD,
	 * - 'DEL': Deletes the geometry of a particular LOD,
	 * - 'DELALL': Deletes a whole building
	 * 
63
	 * @param job The nF import job to be sent. It has to contain a valid description.
64
	 */
bruse's avatar
bruse committed
65
	public void sendAndUpdateImportJob(I importJob) 
66
			throws InvalidJobDescriptorException, FailedTransmissionException;
67
68
69
70
71
72
73
	
	/**
	 * Returns the status of any existing export nF job.
	 * 
	 * @param jobId The id of the export job for which you want to request the status.
	 * @return The status of any existing export nF job.
	 */
bruse's avatar
bruse committed
74
	public E requestExportJob(int jobId) throws FailedTransmissionException;
75
76
77
78
79
80

	/**
	 * Returns the status of any existing import nF job.
	 * 
	 * @param jobId The id of the import job for which you want to request the status.
	 * @return The status of any existing import nF job.
81
	 */
bruse's avatar
bruse committed
82
	public I requestImportJob(int jobId) throws FailedTransmissionException;
83
84
85
86
87
88
89
	
	/**
	 * Downloads the result for a given nF export job and hands over the corresponding file handle.
	 * 
	 * @param jobId The id of the export job for which the result should be loaded.
	 * @return A file handle to the result of the nF export job. 
	 */
bruse's avatar
bruse committed
90
	public File requestExportJobResult(E exportJob) throws FailedTransmissionException;
91
92

}