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; } }