package org.ovirt.engine.core.common.job;

import org.ovirt.engine.core.compat.NGuid;

/**
 * Represents an external system task associated with a Step.
 */
public class ExternalSystem {

    /**
     * An external Id which associated with the step (e.g. VDSM Task Id)
     */
    private NGuid externalId;

    /**
     * An external system type (e.g. VDSM) which its execution unit is identified by {@link #externalId}
     */
    private ExternalSystemType externalSystemType;

    public NGuid getId() {
        return externalId;
    }

    public void setId(NGuid externalId) {
        this.externalId = externalId;
    }

    public ExternalSystemType getType() {
        return externalSystemType;
    }

    public void setType(ExternalSystemType externalSystemType) {
        this.externalSystemType = externalSystemType;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((externalId == null) ? 0 : externalId.hashCode());
        result = prime * result + ((externalSystemType == null) ? 0 : externalSystemType.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof ExternalSystem)) {
            return false;
        }
        ExternalSystem other = (ExternalSystem) obj;
        if (externalId == null) {
            if (other.externalId != null) {
                return false;
            }
        } else if (!externalId.equals(other.externalId)) {
            return false;
        }
        if (externalSystemType != other.externalSystemType) {
            return false;
        }
        return true;
    }

}

@@ -36,16 +36,46 @@
 n.job;%0A%0A
+import java.io.Serializable;%0A%0A
 import o
@@ -109,16 +109,16 @@
 .NGuid;%0A
-
 %0A/**%0A * 
@@ -208,17 +208,174 @@
 lSystem 
-%7B
+implements Serializable%7B%0A%0A    /**%0A     * Automatic generated serial version ID%0A     */%0A    private static final long serialVersionUID = -4875960108024526122L;
 %0A%0A    /*

Implement Serializable by ExternalSystem