All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tomakehurst.crashlab.saboteur.Fault Maven / Gradle / Ivy

The newest version!
package com.tomakehurst.crashlab.saboteur;

import com.fasterxml.jackson.annotation.JsonGetter;

public abstract class Fault {

    public enum Direction { IN, OUT }
    public enum Type { NETWORK_FAILURE, SERVICE_FAILURE, FIREWALL_TIMEOUT, DELAY, PACKET_LOSS;}
    public enum Protocol { TCP, UDP }

    protected String name;
    protected Direction direction;
    protected Protocol protocol;
    protected int toPort;

    public String getName() {
        return name;
    }

    public Direction getDirection() {
        return direction;
    }

    public Protocol getProtocol() {
        return protocol;
    }

    @JsonGetter("to_port")
    public int getToPort() {
        return toPort;
    }

    public abstract Type getType();

    public  T setName(String name) {
        this.name = name;
        return (T) this;
    }

    public  T setDirection(Direction direction) {
        this.direction = direction;
        return (T) this;
    }

    public  T setProtocol(Protocol protocol) {
        this.protocol = protocol;
        return (T) this;
    }

    public  T setToPort(int toPort) {
        this.toPort = toPort;
        return (T) this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy