All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.asg.generator.meta.MetaFederationModule Maven / Gradle / Ivy

package net.anotheria.asg.generator.meta;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class MetaFederationModule extends MetaModule {

	private List federatedModules;
	private Map> mappings;
	
	public MetaFederationModule(){
		this(null);
	}
	
	public MetaFederationModule(String name){
		super(name);
		setStorageType( StorageType.FEDERATION);
		federatedModules = new ArrayList();
		mappings = new HashMap>();
	}
	
	public void addFederatedModule(String aKey, String aName){
		federatedModules.add(new FederatedModuleDef(aKey, aName));
	}
	
	
	public List getFederatedModules() {
		return federatedModules;
	}

	public void setFederatedModules(List federatedModules) {
		this.federatedModules = federatedModules;
	}
	
	public void addMapping(FederatedDocumentMapping mapping){
		List mappingsForDocument = mappings.get(mapping.getSourceDocument());
		if (mappingsForDocument==null){
			mappingsForDocument = new ArrayList();
			mappings.put(mapping.getSourceDocument(), mappingsForDocument);
		}
		mappingsForDocument.add(mapping);
	}
	
	public List getMappingsForDocument(String documentName){
		List ret = mappings.get(documentName);
		return ret == null ? new ArrayList() : ret;
	}

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy