Project

General

Profile

Download (3.35 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.io.specimen.abcd206.in;
11

    
12
import java.io.ByteArrayOutputStream;
13
import java.io.PrintStream;
14
import java.net.URI;
15
import java.util.ArrayList;
16
import java.util.HashSet;
17
import java.util.List;
18
import java.util.Set;
19

    
20
import org.apache.log4j.Logger;
21

    
22
import eu.etaxonomy.cdm.io.specimen.SpecimenImportStateBase;
23

    
24
/**
25
 * @author a.mueller
26
 * @since 11.05.2009
27
 */
28
public class Abcd206ImportState
29
        extends SpecimenImportStateBase<Abcd206ImportConfigurator, Abcd206ImportState>{
30

    
31
    @SuppressWarnings("unused")
32
	private static final Logger logger = Logger.getLogger(Abcd206ImportState.class);
33

    
34
	private String prefix;
35

    
36
	private List<String[]> associatedUnitIds = new ArrayList<String[]>();
37

    
38
	private Set<URI> allAccesPoints = new HashSet<>();
39

    
40
	private URI actualAccessPoint;
41

    
42
	private Set<URI> sequenceDataStableIdentifier = new HashSet<>();
43

    
44

    
45
//****************** CONSTRUCTOR ***************************************************/
46

    
47

    
48
    public Abcd206ImportState(Abcd206ImportConfigurator config) {
49
		super(config);
50
        setReport(new SpecimenImportReport());
51
        setTransformer(new AbcdTransformer());
52
	}
53

    
54
//************************ GETTER / SETTER *****************************************/
55

    
56

    
57

    
58
    @Override
59
    public Abcd206DataHolder getDataHolder() {
60
        return (Abcd206DataHolder)dataHolder;
61
    }
62

    
63
    public void setDataHolder(Abcd206DataHolder dataHolder) {
64
        this.dataHolder = dataHolder;
65
    }
66

    
67
    public void setPrefix(String prefix) {
68
        this.prefix = prefix;
69
    }
70

    
71
    public String getPrefix() {
72
        return prefix;
73
    }
74

    
75

    
76
    @Override
77
    public byte[] getReportAsByteArray() {
78
        ByteArrayOutputStream importStream = new ByteArrayOutputStream();
79
        getReport().printReport(new PrintStream(importStream));
80
        return importStream.toByteArray();
81
    }
82

    
83
    public void setAssociatedUnitIds(List<String[]> associatedUnitIds){
84
        this.associatedUnitIds = associatedUnitIds;
85
    }
86

    
87
    public List<String[]> getAssociatedUnitIds(){
88
        return this.associatedUnitIds;
89
    }
90

    
91
    /**
92
     * @return the actualAccesPoint
93
     */
94
    public Set<URI> getActualAccesPoint() {
95
        return allAccesPoints;
96
    }
97

    
98
    /**
99
     * @param actualAccesPoint the actualAccesPoint to set
100
     */
101
    public void addActualAccesPoint(URI actualAccesPoint) {
102
        this.allAccesPoints.add(actualAccesPoint);
103
    }
104

    
105
    /**
106
     * @return the actualAccessPoint
107
     */
108
    public URI getActualAccessPoint() {
109
        return actualAccessPoint;
110
    }
111

    
112
    /**
113
     * @param actualAccessPoint the actualAccessPoint to set
114
     */
115
    public void setActualAccessPoint(URI actualAccessPoint) {
116
        this.addActualAccesPoint(actualAccessPoint);
117
        this.actualAccessPoint = actualAccessPoint;
118
    }
119

    
120
    public Set<URI> getSequenceDataStableIdentifier() {
121
        return sequenceDataStableIdentifier;
122
    }
123

    
124
    public void putSequenceDataStableIdentifier(URI sequenceDataStableIdentifier) {
125
        this.sequenceDataStableIdentifier.add(sequenceDataStableIdentifier);
126
    }
127

    
128
//
129
//    public void reset() {
130
//        getDataHolder().reset();
131
//        setDerivedUnitBase(null);
132
//    }
133
}
(5-5/15)