ImportJobDescriptor.java 3.58 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package eu.simstadt.nf;

import java.io.File;

/**
 * Every instance of this class describes an import job for the novaFACTORY. Instances of JobBuilder
 * take JobDescriptions and build XML import job files out of it.
 * 
 * @author Marcel Bruse
 */
public class ImportJobDescriptor implements JobDescriptor {

	/** The version of the novaFACTORY XML export job format. */
	public static final String IMPORT_JOB_VERSION = "1.0.0";
	
	/** The default level on which your CityGML will be stored within the nF. */
	public static final String DEFAULT_LEVEL = "GML";
	
	/** The CityGML file which should be imported through a import job. */
	private File cityGMLFile;
	
	/** The nF product (Produkt) which will keep our CityGML. */
	private String product;
	
	/** The nF leaf (Blatt) of the nF product. */
	private String leaf; 
	
	/** The nF level (Ebene) of the nF product. */
	private String level;
	
	/** The operation to be performed for the feature objects of the CityGML file. */
	private String operation;
	
	/**
	 * @return Returns the nF product which will keep our CityGML.
	 */
	public String getProduct() {
		return product;
	}	
	
	/**
	 * Sets the nF product for this import job.
	 * 
	 * @param product The product of our import job.
	 */
	public void setProduct(String product) {
		this.product = product;
	}
	
	/**
	 * @return Returns the nF leaf of the nF product.
	 */
	public String getLeaf() {
		return leaf;
	}
	
	/**
	 * Sets the nF leaf for the nF product.
	 * 
	 * @param leaf The leaf for the nF product.
	 */
	public void setLeaf(String leaf) {
		this.leaf = leaf;
	}
	
	/**
	 * @return Returns the level of the product.
	 */
	public String getLevel() {
		return level;
	}
	
	/**
	 * Sets the nF level for the nF product.
	 * 
	 * @param level The level for the nF product.
	 */
	public void setLevel(String level) {
		this.level = level;
	}
	
	/**
	 * @return Returns the CityGML file which should be imported through a import job.
	 */
	public File getCityGMLFile() {
		return cityGMLFile;
	}
	
	/**
	 * Sets the CityGML file which should be imported through a import job.
	 * 
	 * @param cityGMLFile The CityGML file which should be imported through a import job.
	 */
	public void setCityGMLFile(File cityGMLFile) {
		this.cityGMLFile = cityGMLFile;
	}
	
	/**
	 * @return Returns the operation which should be conducted for the features of the CityGML file.
	 */
	public String getOperation() {
		return operation;
	}
	
	/**
	 * Sets the operation which should be conducted for the feature objects of the CityGML file.
	 * 
	 * @param operation The operation which should be conducted for the feature object of the CityGML file.
	 */
	public void setOperation(String operation) {
		this.operation = operation;
	}
	
	/**
	 * @return Returns the supported nF job version. This enables your job builder instance to check if
	 * the job version is compatible with itself.
	 */
	@Override
	public String supportsJobVersion() {
		return IMPORT_JOB_VERSION;
	}
	
	/**
	 * This is just a prototype for presentation purposes.
	 */
	public static ImportJobDescriptor getDefaultDescriptor() {
		ImportJobDescriptor descriptor = new ImportJobDescriptor();
		descriptor.setLevel(DEFAULT_LEVEL);
		return descriptor;
	}

	/**
	 * @return Returns true, if product, leaf, level and CityGML file are present.
	 */
	public boolean isValid() {
		boolean result = true;
		if (product.isEmpty()
				&& leaf.isEmpty()
				&& level.isEmpty()
				&& !cityGMLFile.canRead()) {
			result = false;
		}
		return result;
	}

}