package ua.be.wee.model.pt;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

import javax.persistence.Entity;
import javax.persistence.Id;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
@JsonTypeInfo(
		  use = JsonTypeInfo.Id.NAME, 
		  include = JsonTypeInfo.As.PROPERTY, 
		  property = "type")
@JsonSubTypes({ 
		  @Type(value = EndActivityEvent.class), 
		  @Type(value = StartActivityEvent.class),
		  @Type(value = EndTraceEvent.class)
		})
@Entity
public abstract class Event {
	
	public static final String START_TRACE_IRI = "http://ua.be/sdo2l/vocabulary/formalisms/processtraces#StartTraceEvent";
	public static final String END_TRACE_IRI = "http://ua.be/sdo2l/vocabulary/formalisms/processtraces#EndTraceEvent";
	public static final String START_ACTIVITY_IRI = "http://ua.be/sdo2l/vocabulary/formalisms/processtraces#StartActivityEvent";
	public static final String END_ACTIVITY_IRI = "http://ua.be/sdo2l/vocabulary/formalisms/processtraces#EndActivityEvent";
	public static final String ARTIFACT_IRI = "http://ua.be/sdo2l/vocabulary/formalisms/processtraces#Artifact";
	
	@Id
	private String iri;
	
	private Timestamp timestamp;
	
	public String getIri() {
		return iri;
	}
	
	public void setIri(String iri) {
		this.iri = iri;
	}

	public Timestamp getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Timestamp timestamp) {
		this.timestamp = timestamp;
	}
	
	public String getTimestampF() {
		return new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(timestamp);
	}

	
	
	
	

}
