dnet40/modules/dnet-modular-mdstore-ui/trunk/src/main/java/eu/dnetlib/functionality/modular/ui/mdstore/model/MDStoreInfo.java @ 39742
1 |
package eu.dnetlib.functionality.modular.ui.mdstore.model; |
---|---|
2 |
|
3 |
import java.util.List; |
4 |
import java.util.Map; |
5 |
|
6 |
/**
|
7 |
* The Class MDStoreInfo.
|
8 |
*/
|
9 |
public class MDStoreInfo { |
10 |
|
11 |
private static String DEFAULT_XQUERY_DELIMITER = "@::@"; |
12 |
|
13 |
/**
|
14 |
* The id.
|
15 |
*/
|
16 |
private String id; |
17 |
|
18 |
/**
|
19 |
* The service uri.
|
20 |
*/
|
21 |
private String serviceURI; |
22 |
|
23 |
/**
|
24 |
* The format.
|
25 |
*/
|
26 |
private String format; |
27 |
|
28 |
/**
|
29 |
* The layout.
|
30 |
*/
|
31 |
private String layout; |
32 |
|
33 |
/**
|
34 |
* The interpretation.
|
35 |
*/
|
36 |
private String interpretation; |
37 |
|
38 |
/**
|
39 |
* The last storage data.
|
40 |
*/
|
41 |
private String lastStorageDate; |
42 |
|
43 |
private Map<String, String> datasourcesInvolved; |
44 |
|
45 |
private List<String> indexFields; |
46 |
|
47 |
/**
|
48 |
* The size.
|
49 |
*/
|
50 |
private int size; |
51 |
|
52 |
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 |
|
72 |
/**
|
73 |
* Gets the id.
|
74 |
*
|
75 |
* @return the id
|
76 |
*/
|
77 |
public String getId() { |
78 |
return id; |
79 |
}
|
80 |
|
81 |
/**
|
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 |
|
90 |
/**
|
91 |
* Gets the service uri.
|
92 |
*
|
93 |
* @return the service uri
|
94 |
*/
|
95 |
public String getServiceURI() { |
96 |
return serviceURI; |
97 |
}
|
98 |
|
99 |
/**
|
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 |
|
108 |
/**
|
109 |
* Gets the format.
|
110 |
*
|
111 |
* @return the format
|
112 |
*/
|
113 |
public String getFormat() { |
114 |
return format; |
115 |
}
|
116 |
|
117 |
/**
|
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 |
|
126 |
/**
|
127 |
* Gets the layout.
|
128 |
*
|
129 |
* @return the layout
|
130 |
*/
|
131 |
public String getLayout() { |
132 |
return layout; |
133 |
}
|
134 |
|
135 |
/**
|
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 |
|
144 |
/**
|
145 |
* Gets the interpretation.
|
146 |
*
|
147 |
* @return the interpretation
|
148 |
*/
|
149 |
public String getInterpretation() { |
150 |
return interpretation; |
151 |
}
|
152 |
|
153 |
/**
|
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 |
|
162 |
/**
|
163 |
* Gets the last storage data.
|
164 |
*
|
165 |
* @return the last storage data
|
166 |
*/
|
167 |
public String getLastStorageDate() { |
168 |
return lastStorageDate; |
169 |
}
|
170 |
|
171 |
/**
|
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 |
|
180 |
/**
|
181 |
* Gets the size.
|
182 |
*
|
183 |
* @return the size
|
184 |
*/
|
185 |
public int getSize() { |
186 |
return size; |
187 |
}
|
188 |
|
189 |
/**
|
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 |
|
206 |
public List<String> getIndexFields() { |
207 |
return indexFields; |
208 |
}
|
209 |
|
210 |
public void setIndexFields(List<String> indexFields) { |
211 |
this.indexFields = indexFields; |
212 |
}
|
213 |
}
|