// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/passenger/api/Person.java
// public class Person extends DTO {
// 
// 	public String id;
// 	
// 	public String firstName;
// 	public String lastName;
// 	
// 	public String email;
// 
// 	// urls to picture/website
// 	public String picture;
// 	public String website;
// 	
// 	// for "networking" applications?
// 	public String company;
// 	public String phone;
// 	
// }
// 
// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/passenger/api/PersonDatabase.java
// public interface PersonDatabase {
// 
// 	Person register(String email, String firstName, String lastName);
// 	
// 	Person register(String email, String firstName, String lastName, String company, String phone, String picture, String website);
// 	
// 	List<Person> getPersons();
// 	
// 	Person getPerson(String id);
// 	
// }


import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import osgi.enroute.dto.api.DTOs;
import osgi.enroute.dto.api.TypeReference;
import osgi.enroute.trains.passenger.api.Person;
import osgi.enroute.trains.passenger.api.PersonDatabase;
package osgi.enroute.trains.person.provider;




/**
 * 
 */
@Component(name = "osgi.enroute.trains.person")
public class PersonImpl implements PersonDatabase {

	// for now just keep in memory
	// TODO persist this?
// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/passenger/api/Person.java
// public class Person extends DTO {
// 
// 	public String id;
// 	
// 	public String firstName;
// 	public String lastName;
// 	
// 	public String email;
// 
// 	// urls to picture/website
// 	public String picture;
// 	public String website;
// 	
// 	// for "networking" applications?
// 	public String company;
// 	public String phone;
// 	
// }
// 
// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/passenger/api/PersonDatabase.java
// public interface PersonDatabase {
// 
// 	Person register(String email, String firstName, String lastName);
// 	
// 	Person register(String email, String firstName, String lastName, String company, String phone, String picture, String website);
// 	
// 	List<Person> getPersons();
// 	
// 	Person getPerson(String id);
// 	
// }


// Path: osgi.enroute.trains.person.provider/src/osgi/enroute/trains/person/provider/PersonImpl.java
import java.net.URL;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import osgi.enroute.dto.api.DTOs;
import osgi.enroute.dto.api.TypeReference;
import osgi.enroute.trains.passenger.api.Person;
import osgi.enroute.trains.passenger.api.PersonDatabase;

package osgi.enroute.trains.person.provider;




/**
 * 
 */
@Component(name = "osgi.enroute.trains.person")
public class PersonImpl implements PersonDatabase {

	// for now just keep in memory
	// TODO persist this?
	private Map<String, Person> persons = new ConcurrentHashMap<>();