Revision 6294
Added by ben leinfelder over 13 years ago
src/edu/ucsb/nceas/metacat/dataone/CNodeService.java | ||
---|---|---|
257 | 257 |
// check relationships |
258 | 258 |
// TODO: make this more strongly typed? |
259 | 259 |
if (relationship.equalsIgnoreCase("describes")) { |
260 |
return systemMetadata.getDescribeList().contains(pidOfObject); |
|
260 |
for (Identifier pid: systemMetadata.getDescribeList()) { |
|
261 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
262 |
return true; |
|
263 |
} |
|
264 |
} |
|
265 |
//return systemMetadata.getDescribeList().contains(pidOfObject); |
|
261 | 266 |
} |
262 | 267 |
if (relationship.equalsIgnoreCase("describedBy")) { |
263 |
return systemMetadata.getDescribedByList().contains(pidOfObject); |
|
268 |
for (Identifier pid: systemMetadata.getDescribedByList()) { |
|
269 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
270 |
return true; |
|
271 |
} |
|
272 |
} |
|
273 |
//return systemMetadata.getDescribedByList().contains(pidOfObject); |
|
264 | 274 |
} |
265 | 275 |
if (relationship.equalsIgnoreCase("derivedFrom")) { |
266 |
return systemMetadata.getDerivedFromList().contains(pidOfObject); |
|
276 |
for (Identifier pid: systemMetadata.getDerivedFromList()) { |
|
277 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
278 |
return true; |
|
279 |
} |
|
280 |
} |
|
281 |
//return systemMetadata.getDerivedFromList().contains(pidOfObject); |
|
267 | 282 |
} |
268 | 283 |
if (relationship.equalsIgnoreCase("obsoletes")) { |
269 |
return systemMetadata.getObsoleteList().contains(pidOfObject); |
|
284 |
for (Identifier pid: systemMetadata.getObsoleteList()) { |
|
285 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
286 |
return true; |
|
287 |
} |
|
288 |
} |
|
289 |
//return systemMetadata.getObsoleteList().contains(pidOfObject); |
|
270 | 290 |
} |
271 | 291 |
if (relationship.equalsIgnoreCase("obsoletedBy")) { |
272 |
return systemMetadata.getObsoletedByList().contains(pidOfObject); |
|
292 |
for (Identifier pid: systemMetadata.getObsoletedByList()) { |
|
293 |
if (pid.getValue().equals(pidOfObject.getValue())) { |
|
294 |
return true; |
|
295 |
} |
|
296 |
} |
|
297 |
//return systemMetadata.getObsoletedByList().contains(pidOfObject); |
|
273 | 298 |
} |
274 | 299 |
|
275 | 300 |
return false; |
... | ... | |
463 | 488 |
|
464 | 489 |
|
465 | 490 |
} |
466 |
|
|
467 |
/** |
|
468 |
* Used internally within a Coordinating Node to add a new object |
|
469 |
* to the object store |
|
470 |
* |
|
471 |
* @param session - the Session object containing the credentials for the Subject |
|
472 |
* @param pid - The object identifier to be created |
|
473 |
* @param object - the object bytes |
|
474 |
* @param sysmeta - the system metadata that describes the object |
|
475 |
* |
|
476 |
* @return pid - the object identifier created |
|
477 |
* |
|
478 |
* @throws InvalidToken |
|
479 |
* @throws ServiceFailure |
|
480 |
* @throws NotAuthorized |
|
481 |
* @throws IdentifierNotUnique |
|
482 |
* @throws UnsupportedType |
|
483 |
* @throws InsufficientResources |
|
484 |
* @throws InvalidSystemMetadata |
|
485 |
* @throws NotImplemented |
|
486 |
* @throws InvalidRequest |
|
487 |
*/ |
|
488 |
@Override |
|
489 |
public Identifier create(Session session, Identifier pid, InputStream object, |
|
490 |
SystemMetadata sysmeta) |
|
491 |
throws InvalidToken, ServiceFailure, NotAuthorized, IdentifierNotUnique, |
|
492 |
UnsupportedType, InsufficientResources, InvalidSystemMetadata, |
|
493 |
NotImplemented, InvalidRequest { |
|
494 |
|
|
495 |
throw new NotImplemented("4890", "create not implemented"); |
|
496 |
} |
|
497 | 491 |
|
498 | 492 |
/** |
499 | 493 |
* Returns the object format registered in the DataONE Object Format |
Also available in: Unified diff
use super class' create() method
use string comparison for assertRelation method