package com.portfoliomanager.akka;

import java.io.Serializable;
import java.util.concurrent.ConcurrentHashMap;

public class Work implements Serializable{
	private final String akkaWorkId;
	public static ConcurrentHashMap<Integer,String> workNumberToWorkIdMap = new ConcurrentHashMap<Integer, String>();
	
	public Work(String akkaWorkId){
		if(workNumberToWorkIdMap.contains(akkaWorkId)){
			try {
				throw new RuntimeException("WorkId already exists");
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		this.akkaWorkId = akkaWorkId;
	}
	
	public String getWorkId(){
		return akkaWorkId;
	}
}
