1 |
34144
|
sandro.lab
|
package eu.dnetlib.functionality.modular.ui.mdstore.model;
|
2 |
|
|
|
3 |
39742
|
sandro.lab
|
import java.util.List;
|
4 |
39627
|
sandro.lab
|
import java.util.Map;
|
5 |
|
|
|
6 |
34144
|
sandro.lab
|
/**
|
7 |
|
|
* The Class MDStoreInfo.
|
8 |
|
|
*/
|
9 |
|
|
public class MDStoreInfo {
|
10 |
|
|
|
11 |
39627
|
sandro.lab
|
private static String DEFAULT_XQUERY_DELIMITER = "@::@";
|
12 |
34144
|
sandro.lab
|
|
13 |
39627
|
sandro.lab
|
/**
|
14 |
|
|
* The id.
|
15 |
|
|
*/
|
16 |
|
|
private String id;
|
17 |
34144
|
sandro.lab
|
|
18 |
39627
|
sandro.lab
|
/**
|
19 |
|
|
* The service uri.
|
20 |
|
|
*/
|
21 |
|
|
private String serviceURI;
|
22 |
34144
|
sandro.lab
|
|
23 |
39627
|
sandro.lab
|
/**
|
24 |
|
|
* The format.
|
25 |
|
|
*/
|
26 |
|
|
private String format;
|
27 |
34144
|
sandro.lab
|
|
28 |
39627
|
sandro.lab
|
/**
|
29 |
|
|
* The layout.
|
30 |
|
|
*/
|
31 |
|
|
private String layout;
|
32 |
34144
|
sandro.lab
|
|
33 |
39627
|
sandro.lab
|
/**
|
34 |
|
|
* The interpretation.
|
35 |
|
|
*/
|
36 |
|
|
private String interpretation;
|
37 |
34144
|
sandro.lab
|
|
38 |
39627
|
sandro.lab
|
/**
|
39 |
|
|
* The last storage data.
|
40 |
|
|
*/
|
41 |
|
|
private String lastStorageDate;
|
42 |
34144
|
sandro.lab
|
|
43 |
39627
|
sandro.lab
|
private Map<String, String> datasourcesInvolved;
|
44 |
34144
|
sandro.lab
|
|
45 |
39742
|
sandro.lab
|
private List<String> indexFields;
|
46 |
|
|
|
47 |
39627
|
sandro.lab
|
/**
|
48 |
|
|
* The size.
|
49 |
|
|
*/
|
50 |
|
|
private int size;
|
51 |
34144
|
sandro.lab
|
|
52 |
39627
|
sandro.lab
|
public static MDStoreInfo fromXqueryResult(final String result) {
|
53 |
|
|
MDStoreInfo info = new MDStoreInfo();
|
54 |
|
|
String values[] = result.split(DEFAULT_XQUERY_DELIMITER);
|
55 |
|
|
if (values == null || values.length != 5) {
|
56 |
|
|
return null;
|
57 |
|
|
}
|
58 |
|
|
info.setServiceURI(values[0]);
|
59 |
|
|
info.setId(values[1]);
|
60 |
|
|
String mdFormat[] = values[2].split("-");
|
61 |
|
|
if (mdFormat == null || mdFormat.length != 3) {
|
62 |
|
|
return null;
|
63 |
|
|
}
|
64 |
|
|
info.setFormat(mdFormat[0]);
|
65 |
|
|
info.setLayout(mdFormat[1]);
|
66 |
|
|
info.setInterpretation(mdFormat[2]);
|
67 |
|
|
info.setLastStorageDate(values[3]);
|
68 |
|
|
info.setSize(new Integer(values[4]));
|
69 |
|
|
return info;
|
70 |
|
|
}
|
71 |
34144
|
sandro.lab
|
|
72 |
39627
|
sandro.lab
|
/**
|
73 |
|
|
* Gets the id.
|
74 |
|
|
*
|
75 |
|
|
* @return the id
|
76 |
|
|
*/
|
77 |
|
|
public String getId() {
|
78 |
|
|
return id;
|
79 |
|
|
}
|
80 |
34144
|
sandro.lab
|
|
81 |
39627
|
sandro.lab
|
/**
|
82 |
|
|
* Sets the id.
|
83 |
|
|
*
|
84 |
|
|
* @param id the new id
|
85 |
|
|
*/
|
86 |
|
|
public void setId(final String id) {
|
87 |
|
|
this.id = id;
|
88 |
|
|
}
|
89 |
34144
|
sandro.lab
|
|
90 |
39627
|
sandro.lab
|
/**
|
91 |
|
|
* Gets the service uri.
|
92 |
|
|
*
|
93 |
|
|
* @return the service uri
|
94 |
|
|
*/
|
95 |
|
|
public String getServiceURI() {
|
96 |
|
|
return serviceURI;
|
97 |
|
|
}
|
98 |
34144
|
sandro.lab
|
|
99 |
39627
|
sandro.lab
|
/**
|
100 |
|
|
* Sets the service uri.
|
101 |
|
|
*
|
102 |
|
|
* @param serviceURI the new service uri
|
103 |
|
|
*/
|
104 |
|
|
public void setServiceURI(final String serviceURI) {
|
105 |
|
|
this.serviceURI = serviceURI;
|
106 |
|
|
}
|
107 |
34144
|
sandro.lab
|
|
108 |
39627
|
sandro.lab
|
/**
|
109 |
|
|
* Gets the format.
|
110 |
|
|
*
|
111 |
|
|
* @return the format
|
112 |
|
|
*/
|
113 |
|
|
public String getFormat() {
|
114 |
|
|
return format;
|
115 |
|
|
}
|
116 |
34144
|
sandro.lab
|
|
117 |
39627
|
sandro.lab
|
/**
|
118 |
|
|
* Sets the format.
|
119 |
|
|
*
|
120 |
|
|
* @param format the new format
|
121 |
|
|
*/
|
122 |
|
|
public void setFormat(final String format) {
|
123 |
|
|
this.format = format;
|
124 |
|
|
}
|
125 |
34144
|
sandro.lab
|
|
126 |
39627
|
sandro.lab
|
/**
|
127 |
|
|
* Gets the layout.
|
128 |
|
|
*
|
129 |
|
|
* @return the layout
|
130 |
|
|
*/
|
131 |
|
|
public String getLayout() {
|
132 |
|
|
return layout;
|
133 |
|
|
}
|
134 |
34144
|
sandro.lab
|
|
135 |
39627
|
sandro.lab
|
/**
|
136 |
|
|
* Sets the layout.
|
137 |
|
|
*
|
138 |
|
|
* @param layout the new layout
|
139 |
|
|
*/
|
140 |
|
|
public void setLayout(final String layout) {
|
141 |
|
|
this.layout = layout;
|
142 |
|
|
}
|
143 |
34144
|
sandro.lab
|
|
144 |
39627
|
sandro.lab
|
/**
|
145 |
|
|
* Gets the interpretation.
|
146 |
|
|
*
|
147 |
|
|
* @return the interpretation
|
148 |
|
|
*/
|
149 |
|
|
public String getInterpretation() {
|
150 |
|
|
return interpretation;
|
151 |
|
|
}
|
152 |
34144
|
sandro.lab
|
|
153 |
39627
|
sandro.lab
|
/**
|
154 |
|
|
* Sets the interpretation.
|
155 |
|
|
*
|
156 |
|
|
* @param interpretation the new interpretation
|
157 |
|
|
*/
|
158 |
|
|
public void setInterpretation(final String interpretation) {
|
159 |
|
|
this.interpretation = interpretation;
|
160 |
|
|
}
|
161 |
34144
|
sandro.lab
|
|
162 |
39627
|
sandro.lab
|
/**
|
163 |
|
|
* Gets the last storage data.
|
164 |
|
|
*
|
165 |
|
|
* @return the last storage data
|
166 |
|
|
*/
|
167 |
|
|
public String getLastStorageDate() {
|
168 |
|
|
return lastStorageDate;
|
169 |
|
|
}
|
170 |
34144
|
sandro.lab
|
|
171 |
39627
|
sandro.lab
|
/**
|
172 |
|
|
* Sets the last storage data.
|
173 |
|
|
*
|
174 |
|
|
* @param lastStorageData the new last storage data
|
175 |
|
|
*/
|
176 |
|
|
public void setLastStorageDate(final String lastStorageDate) {
|
177 |
|
|
this.lastStorageDate = lastStorageDate;
|
178 |
|
|
}
|
179 |
34144
|
sandro.lab
|
|
180 |
39627
|
sandro.lab
|
/**
|
181 |
|
|
* Gets the size.
|
182 |
|
|
*
|
183 |
|
|
* @return the size
|
184 |
|
|
*/
|
185 |
|
|
public int getSize() {
|
186 |
|
|
return size;
|
187 |
|
|
}
|
188 |
34144
|
sandro.lab
|
|
189 |
39627
|
sandro.lab
|
/**
|
190 |
|
|
* Sets the size.
|
191 |
|
|
*
|
192 |
|
|
* @param size the new size
|
193 |
|
|
*/
|
194 |
|
|
public void setSize(final int size) {
|
195 |
|
|
this.size = size;
|
196 |
|
|
}
|
197 |
|
|
|
198 |
|
|
public Map<String, String> getDatasourcesInvolved() {
|
199 |
|
|
return datasourcesInvolved;
|
200 |
|
|
}
|
201 |
|
|
|
202 |
|
|
public void setDatasourcesInvolved(Map<String, String> datasourcesInvolved) {
|
203 |
|
|
this.datasourcesInvolved = datasourcesInvolved;
|
204 |
|
|
}
|
205 |
39742
|
sandro.lab
|
|
206 |
|
|
public List<String> getIndexFields() {
|
207 |
|
|
return indexFields;
|
208 |
|
|
}
|
209 |
|
|
|
210 |
|
|
public void setIndexFields(List<String> indexFields) {
|
211 |
|
|
this.indexFields = indexFields;
|
212 |
|
|
}
|
213 |
34144
|
sandro.lab
|
}
|