package eu.dnetlib.rmi.objects.is;

import java.util.Map;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Subscription {

	private String id;
	private String serviceId;
	private Operation operation;
	private String table;
	private Map<String, Object> condition;

	public Subscription() {}

	public Subscription(final String id, final String serviceId, final Operation operation, final String table, final Map<String, Object> condition) {
		this.id = id;
		this.setServiceId(serviceId);
		this.operation = operation;
		this.table = table;
		this.condition = condition;
	}

	public String getId() {
		return id;
	}

	public void setId(final String id) {
		this.id = id;
	}

	public String getServiceId() {
		return serviceId;
	}

	public void setServiceId(final String serviceId) {
		this.serviceId = serviceId;
	}

	public Operation getOperation() {
		return operation;
	}

	public void setOperation(final Operation operation) {
		this.operation = operation;
	}

	public String getTable() {
		return table;
	}

	public void setTable(final String table) {
		this.table = table;
	}

	public Map<String, Object> getCondition() {
		return condition;
	}

	public void setCondition(final Map<String, Object> condition) {
		this.condition = condition;
	}

	@Override
	public int hashCode() {
		return id.hashCode();
	}

}
