// Path: src/main/java/com/modelsolv/kaboom/model/canonical/CanonicalDataType.java
// public interface CanonicalDataType {
// 	
// 	public String getName();
// 	
// 	public void setName(String name);
// 	
// 	public Iterable<CDMProperty> getProperties();
// 	
// 	public CDMProperty getProperty(String propName);
// 	
// 	public boolean hasProperty(CDMProperty property);
// 	
// 	public CanonicalDataType withPrimitive(String name, PrimitiveDataType type);
// 	
// 	public CanonicalDataType withPrimitive(String name, PrimitiveDataType type, Cardinality cardinality);
// 
// 	public CanonicalDataType withReference(String name, CanonicalDataType type);
// 
// 	public CanonicalDataType withReference(String name, CanonicalDataType type, Cardinality cardinality);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ObjectResourceDefinition.java
// public interface ObjectResourceDefinition extends ResourceDefinition {
// 
// 	// write-once properties, should be passed in ctor
// 	public String getURITemplate();
// 
// 	/**
// 	 * @return the ResourceDataModel bound to this class of resources.
// 	 */
// 	public ResourceDataModel getResourceDataModel();
// 
// 	// read-writable properties
// 
// 	public String getName();
// 
// 	public void setName(String name);
// 
// 	public ObjectResourceDefinition withName(String name);
// 
// 	public void bindTemplateParameter(String parameter, CDMProperty property);
// 	
// 	public ObjectResourceDefinition withTemplateParameter(String parameter, CDMProperty property);
// 
// 	/**
// 	 * Factory method to create or retrieve an individual Resource bound to the
// 	 * canonicalObject. The canonicalObject must confirm to the
// 	 * ResourceDataModel. This method is responsible for populating the resource
// 	 * URI and any other required properties of the Resource.
// 	 * 
// 	 * @param canonicalObject
// 	 * @return
// 	 */
// 	public ObjectResource getResource(Object canonicalObject, CanonicalObjectReader reader);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ObjectResourceDefinitionRegistry.java
// public interface ObjectResourceDefinitionRegistry {
// 
// 	// TODO: Check use of Singleton pattern, consider DI/Resource Locator.
// 	public static ObjectResourceDefinitionRegistry INSTANCE = new ObjectResourceDefinitionRegistryImpl();
// 
// 	/**
// 	 * Register a ResourceDataModel. Registering an ObjectResourceDefinition
// 	 * with a duplicate name, ResourceDataModel or CanonicalDataType will remove
// 	 * the previous entry from the registry, and add this one in its place.
// 	 * 
// 	 * @param rdm
// 	 * @param definition
// 	 */
// 	public void registerDefinition(ObjectResourceDefinition definition);
// 
// 	/**
// 	 * Retrieve an ObjectResourceDefinition by its name.
// 	 * 
// 	 * @param name
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getResourceDefinition(String name);
// 
// 	/**
// 	 * Retrieve an ObjectResourceDefinition by its associated ResourceDataModel.
// 	 * 
// 	 * @param name
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getResourceDefinition(ResourceDataModel rdm);
// 
// 	/**
// 	 * Retrieve an ObjectResourceDefinition by its associated CanonicalDataType.
// 	 * 
// 	 * @param name
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getResourceDefinition(CanonicalDataType canonicalDataType);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ResourceDataModel.java
// public interface ResourceDataModel {
// 
// 	public CanonicalDataType getCanonicalDataType();
// 
// 	public void setCanonicalDataType(CanonicalDataType type);
// 
// 	public ResourceDataModel withCanonicalDataType(CanonicalDataType type);
// 
// 	public Iterable<RDMProperty> getIncludedProperties();
// 
// 	// Add a list of CDM properties from the CanonicalDataType
// 	public ResourceDataModel includingProperties(CDMProperty... properties);
// 
// 	public ResourceDataModel includingProperties(String... properties);
// 
// 	// Add Primitive Property from CDM Property
// 	public RDMPrimitiveProperty addPrimitiveProperty(
// 			CDMPrimitiveProperty property);
// 
// 	// Add Primitive Property directly, chainable, builder style
// 	public ResourceDataModel withPrimitiveProperty(
// 			RDMPrimitiveProperty property);
// 
// 	// Add ReferenceLink from CDMReferenceProperty
// 	public ReferenceLink addReferenceLink(CDMReferenceProperty property);
// 
// 	// Add ReferenceLink Directly, chainable, builder style
// 	public ResourceDataModel withReferenceLink(ReferenceLink refLink);
// 
// 	// Add ReferenceEmbed from CDMReferenceProperty
// 	public ReferenceEmbed addReferenceEmbed(CDMReferenceProperty property);
// 
// 	// Add ReferenceEmbed Directly, chainable, builder style
// 	public ResourceDataModel withReferenceEmbed(ReferenceEmbed refEmbed);
// }


import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import com.modelsolv.kaboom.model.canonical.CanonicalDataType;
import com.modelsolv.kaboom.model.resource.ObjectResourceDefinition;
import com.modelsolv.kaboom.model.resource.ObjectResourceDefinitionRegistry;
import com.modelsolv.kaboom.model.resource.ResourceDataModel;
/*******************************************************************************
 * Copyright (c) 2014 ModelSolv, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     ModelSolv, Inc. - initial API and implementation.
 *******************************************************************************/
package com.modelsolv.kaboom.model.resource.nativeImpl;



public class ObjectResourceDefinitionRegistryImpl implements
		ObjectResourceDefinitionRegistry {

	private Map<String, ObjectResourceDefinition> nameMap = new HashMap<String, ObjectResourceDefinition>();
	private Map<CanonicalDataType, ObjectResourceDefinition> cdtMap = new HashMap<CanonicalDataType, ObjectResourceDefinition>();
// Path: src/main/java/com/modelsolv/kaboom/model/canonical/CanonicalDataType.java
// public interface CanonicalDataType {
// 	
// 	public String getName();
// 	
// 	public void setName(String name);
// 	
// 	public Iterable<CDMProperty> getProperties();
// 	
// 	public CDMProperty getProperty(String propName);
// 	
// 	public boolean hasProperty(CDMProperty property);
// 	
// 	public CanonicalDataType withPrimitive(String name, PrimitiveDataType type);
// 	
// 	public CanonicalDataType withPrimitive(String name, PrimitiveDataType type, Cardinality cardinality);
// 
// 	public CanonicalDataType withReference(String name, CanonicalDataType type);
// 
// 	public CanonicalDataType withReference(String name, CanonicalDataType type, Cardinality cardinality);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ObjectResourceDefinition.java
// public interface ObjectResourceDefinition extends ResourceDefinition {
// 
// 	// write-once properties, should be passed in ctor
// 	public String getURITemplate();
// 
// 	/**
// 	 * @return the ResourceDataModel bound to this class of resources.
// 	 */
// 	public ResourceDataModel getResourceDataModel();
// 
// 	// read-writable properties
// 
// 	public String getName();
// 
// 	public void setName(String name);
// 
// 	public ObjectResourceDefinition withName(String name);
// 
// 	public void bindTemplateParameter(String parameter, CDMProperty property);
// 	
// 	public ObjectResourceDefinition withTemplateParameter(String parameter, CDMProperty property);
// 
// 	/**
// 	 * Factory method to create or retrieve an individual Resource bound to the
// 	 * canonicalObject. The canonicalObject must confirm to the
// 	 * ResourceDataModel. This method is responsible for populating the resource
// 	 * URI and any other required properties of the Resource.
// 	 * 
// 	 * @param canonicalObject
// 	 * @return
// 	 */
// 	public ObjectResource getResource(Object canonicalObject, CanonicalObjectReader reader);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ObjectResourceDefinitionRegistry.java
// public interface ObjectResourceDefinitionRegistry {
// 
// 	// TODO: Check use of Singleton pattern, consider DI/Resource Locator.
// 	public static ObjectResourceDefinitionRegistry INSTANCE = new ObjectResourceDefinitionRegistryImpl();
// 
// 	/**
// 	 * Register a ResourceDataModel. Registering an ObjectResourceDefinition
// 	 * with a duplicate name, ResourceDataModel or CanonicalDataType will remove
// 	 * the previous entry from the registry, and add this one in its place.
// 	 * 
// 	 * @param rdm
// 	 * @param definition
// 	 */
// 	public void registerDefinition(ObjectResourceDefinition definition);
// 
// 	/**
// 	 * Retrieve an ObjectResourceDefinition by its name.
// 	 * 
// 	 * @param name
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getResourceDefinition(String name);
// 
// 	/**
// 	 * Retrieve an ObjectResourceDefinition by its associated ResourceDataModel.
// 	 * 
// 	 * @param name
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getResourceDefinition(ResourceDataModel rdm);
// 
// 	/**
// 	 * Retrieve an ObjectResourceDefinition by its associated CanonicalDataType.
// 	 * 
// 	 * @param name
// 	 * @return
// 	 */
// 	public ObjectResourceDefinition getResourceDefinition(CanonicalDataType canonicalDataType);
// 
// }
// 
// Path: src/main/java/com/modelsolv/kaboom/model/resource/ResourceDataModel.java
// public interface ResourceDataModel {
// 
// 	public CanonicalDataType getCanonicalDataType();
// 
// 	public void setCanonicalDataType(CanonicalDataType type);
// 
// 	public ResourceDataModel withCanonicalDataType(CanonicalDataType type);
// 
// 	public Iterable<RDMProperty> getIncludedProperties();
// 
// 	// Add a list of CDM properties from the CanonicalDataType
// 	public ResourceDataModel includingProperties(CDMProperty... properties);
// 
// 	public ResourceDataModel includingProperties(String... properties);
// 
// 	// Add Primitive Property from CDM Property
// 	public RDMPrimitiveProperty addPrimitiveProperty(
// 			CDMPrimitiveProperty property);
// 
// 	// Add Primitive Property directly, chainable, builder style
// 	public ResourceDataModel withPrimitiveProperty(
// 			RDMPrimitiveProperty property);
// 
// 	// Add ReferenceLink from CDMReferenceProperty
// 	public ReferenceLink addReferenceLink(CDMReferenceProperty property);
// 
// 	// Add ReferenceLink Directly, chainable, builder style
// 	public ResourceDataModel withReferenceLink(ReferenceLink refLink);
// 
// 	// Add ReferenceEmbed from CDMReferenceProperty
// 	public ReferenceEmbed addReferenceEmbed(CDMReferenceProperty property);
// 
// 	// Add ReferenceEmbed Directly, chainable, builder style
// 	public ResourceDataModel withReferenceEmbed(ReferenceEmbed refEmbed);
// }


// Path: src/main/java/com/modelsolv/kaboom/model/resource/nativeImpl/ObjectResourceDefinitionRegistryImpl.java
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import com.modelsolv.kaboom.model.canonical.CanonicalDataType;
import com.modelsolv.kaboom.model.resource.ObjectResourceDefinition;
import com.modelsolv.kaboom.model.resource.ObjectResourceDefinitionRegistry;
import com.modelsolv.kaboom.model.resource.ResourceDataModel;

/*******************************************************************************
 * Copyright (c) 2014 ModelSolv, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     ModelSolv, Inc. - initial API and implementation.
 *******************************************************************************/
package com.modelsolv.kaboom.model.resource.nativeImpl;



public class ObjectResourceDefinitionRegistryImpl implements
		ObjectResourceDefinitionRegistry {

	private Map<String, ObjectResourceDefinition> nameMap = new HashMap<String, ObjectResourceDefinition>();
	private Map<CanonicalDataType, ObjectResourceDefinition> cdtMap = new HashMap<CanonicalDataType, ObjectResourceDefinition>();
	private Map<ResourceDataModel, ObjectResourceDefinition> rdmMap = new HashMap<ResourceDataModel, ObjectResourceDefinition>();