001package jmri.jmrit.dispatcher;
002
003public class TaskAllocateRelease {
004
005    TaskAllocateRelease(TaskAction action) {
006        act = action;
007    }
008
009    TaskAllocateRelease(TaskAction action, String trainName) {
010        act = action;
011        this.trainName = trainName;
012    }
013
014    TaskAllocateRelease(TaskAction action, AllocatedSection aSection, boolean termTrain) {
015        act = action;
016        allocatedSection = aSection;
017        terminateingTrain = termTrain;
018    }
019    
020    TaskAllocateRelease(TaskAction action, AllocationRequest aRequest) {
021        act = action;
022        allocationRequest = aRequest;
023    }
024
025
026    private TaskAction act;
027    private String trainName = null;
028    private AllocatedSection allocatedSection = null;
029    private AllocationRequest allocationRequest = null;
030    
031    private boolean terminateingTrain = false;
032
033    public enum TaskAction {
034        SCAN_REQUESTS,
035        RELEASE_RESERVED,
036        RELEASE_ONE,
037        AUTO_RELEASE,
038        ABORT,
039        ALLOCATE_IMMEDIATE;
040    }
041
042    public TaskAction getAction() {
043        return act;
044    }
045
046    public String getTrainName() {
047        return trainName;
048    }
049
050    public AllocatedSection getAllocatedSection() {
051        return allocatedSection;
052    }
053
054    public boolean getTerminatingTrain() {
055        return terminateingTrain;
056    }
057    
058    public AllocationRequest getAllocationRequest() {
059        return allocationRequest;
060    }
061    
062}