Revision 6366
Added by ben leinfelder over 12 years ago
CNodeService.java | ||
---|---|---|
27 | 27 |
import java.util.List; |
28 | 28 |
|
29 | 29 |
import org.apache.log4j.Logger; |
30 |
import org.dataone.service.cn.CNAuthorization; |
|
31 |
import org.dataone.service.cn.CNCore; |
|
32 |
import org.dataone.service.cn.CNRead; |
|
33 |
import org.dataone.service.cn.CNReplication; |
|
30 |
import org.dataone.service.cn.v1.CNAuthorization;
|
|
31 |
import org.dataone.service.cn.v1.CNCore;
|
|
32 |
import org.dataone.service.cn.v1.CNRead;
|
|
33 |
import org.dataone.service.cn.v1.CNReplication;
|
|
34 | 34 |
import org.dataone.service.exceptions.IdentifierNotUnique; |
35 | 35 |
import org.dataone.service.exceptions.InsufficientResources; |
36 | 36 |
import org.dataone.service.exceptions.InvalidRequest; |
... | ... | |
40 | 40 |
import org.dataone.service.exceptions.NotFound; |
41 | 41 |
import org.dataone.service.exceptions.NotImplemented; |
42 | 42 |
import org.dataone.service.exceptions.ServiceFailure; |
43 |
import org.dataone.service.types.Checksum; |
|
44 |
import org.dataone.service.types.Identifier; |
|
45 |
import org.dataone.service.types.NodeList; |
|
46 |
import org.dataone.service.types.ObjectFormat; |
|
47 |
import org.dataone.service.types.ObjectFormatIdentifier; |
|
48 |
import org.dataone.service.types.ObjectFormatList; |
|
49 |
import org.dataone.service.types.ObjectList; |
|
50 |
import org.dataone.service.types.ObjectLocationList; |
|
51 |
import org.dataone.service.types.Permission; |
|
52 |
import org.dataone.service.types.QueryType; |
|
53 |
import org.dataone.service.types.Replica; |
|
54 |
import org.dataone.service.types.ReplicationPolicy; |
|
55 |
import org.dataone.service.types.ReplicationStatus; |
|
56 |
import org.dataone.service.types.Session; |
|
57 |
import org.dataone.service.types.Subject; |
|
58 |
import org.dataone.service.types.SystemMetadata; |
|
43 |
import org.dataone.service.types.v1.Checksum;
|
|
44 |
import org.dataone.service.types.v1.Identifier;
|
|
45 |
import org.dataone.service.types.v1.NodeList;
|
|
46 |
import org.dataone.service.types.v1.ObjectFormat;
|
|
47 |
import org.dataone.service.types.v1.ObjectFormatIdentifier;
|
|
48 |
import org.dataone.service.types.v1.ObjectFormatList;
|
|
49 |
import org.dataone.service.types.v1.ObjectList;
|
|
50 |
import org.dataone.service.types.v1.ObjectLocationList;
|
|
51 |
import org.dataone.service.types.v1.Permission;
|
|
52 |
import org.dataone.service.types.v1.QueryType;
|
|
53 |
import org.dataone.service.types.v1.Replica;
|
|
54 |
import org.dataone.service.types.v1.ReplicationPolicy;
|
|
55 |
import org.dataone.service.types.v1.ReplicationStatus;
|
|
56 |
import org.dataone.service.types.v1.Session;
|
|
57 |
import org.dataone.service.types.v1.Subject;
|
|
58 |
import org.dataone.service.types.v1.SystemMetadata;
|
|
59 | 59 |
|
60 | 60 |
import edu.ucsb.nceas.metacat.EventLog; |
61 | 61 |
import edu.ucsb.nceas.metacat.IdentifierManager; |
... | ... | |
247 | 247 |
} |
248 | 248 |
|
249 | 249 |
// check relationships |
250 |
// TODO: make this more strongly typed?
|
|
250 |
// TODO: use ORE map
|
|
251 | 251 |
if (relationship.equalsIgnoreCase("describes")) { |
252 |
for (Identifier pid: systemMetadata.getDescribeList()) { |
|
253 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
254 |
return true; |
|
255 |
} |
|
256 |
} |
|
257 |
//return systemMetadata.getDescribeList().contains(pidOfObject); |
|
252 |
|
|
258 | 253 |
} |
259 | 254 |
if (relationship.equalsIgnoreCase("describedBy")) { |
260 |
for (Identifier pid: systemMetadata.getDescribedByList()) { |
|
261 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
262 |
return true; |
|
263 |
} |
|
264 |
} |
|
265 |
//return systemMetadata.getDescribedByList().contains(pidOfObject); |
|
255 |
|
|
266 | 256 |
} |
267 | 257 |
if (relationship.equalsIgnoreCase("derivedFrom")) { |
268 |
for (Identifier pid: systemMetadata.getDerivedFromList()) { |
|
269 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
270 |
return true; |
|
271 |
} |
|
272 |
} |
|
273 |
//return systemMetadata.getDerivedFromList().contains(pidOfObject); |
|
258 |
|
|
274 | 259 |
} |
275 | 260 |
if (relationship.equalsIgnoreCase("obsoletes")) { |
276 |
for (Identifier pid: systemMetadata.getObsoleteList()) { |
|
277 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
278 |
return true; |
|
279 |
} |
|
261 |
Identifier pid = systemMetadata.getObsoletes(); |
|
262 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
263 |
return true; |
|
280 | 264 |
} |
281 | 265 |
//return systemMetadata.getObsoleteList().contains(pidOfObject); |
282 | 266 |
} |
283 | 267 |
if (relationship.equalsIgnoreCase("obsoletedBy")) { |
284 |
for (Identifier pid: systemMetadata.getObsoletedByList()) { |
|
285 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
286 |
return true; |
|
287 |
} |
|
268 |
Identifier pid = systemMetadata.getObsoletedBy(); |
|
269 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
270 |
return true; |
|
288 | 271 |
} |
289 | 272 |
//return systemMetadata.getObsoletedByList().contains(pidOfObject); |
290 | 273 |
} |
Also available in: Unified diff
use new "v1" types from DataONE