Revision 6189
Added by ben leinfelder over 13 years ago
src/edu/ucsb/nceas/metacat/dataone/CNodeService.java | ||
---|---|---|
78 | 78 |
* |
79 | 79 |
*/ |
80 | 80 |
public class CNodeService extends D1NodeService implements CNAuthorization, |
81 |
CNCore, CNIdentity, CNRead, CNRegister, CNReplication {
|
|
81 |
CNCore, CNRead, CNRegister, CNReplication { |
|
82 | 82 |
|
83 | 83 |
/* the instance of the CNodeService object */ |
84 | 84 |
private static CNodeService instance = null; |
... | ... | |
344 | 344 |
} |
345 | 345 |
|
346 | 346 |
/** |
347 |
* Add members to the named group |
|
348 |
* |
|
349 |
* @param session - the Session object containing the credentials for the Subject |
|
350 |
* @param groupName - The identifier of the group to be modified |
|
351 |
* @param members - The list of members to be added to the group |
|
352 |
* |
|
353 |
* @return true if the addition succeeds |
|
354 |
* |
|
355 |
* @throws InvalidToken |
|
356 |
* @throws ServiceFailure |
|
357 |
* @throws NotAuthorized |
|
358 |
* @throws InvalidRequest |
|
359 |
* @throws NotImplemented |
|
360 |
* @throws NotFound |
|
361 |
*/ |
|
362 |
@Override |
|
363 |
public boolean addGroupMembers(Session session, Subject groupName, SubjectList members) |
|
364 |
throws ServiceFailure, InvalidToken, NotAuthorized, NotFound, |
|
365 |
NotImplemented, InvalidRequest { |
|
366 |
|
|
367 |
return false; |
|
368 |
} |
|
369 |
|
|
370 |
/** |
|
371 |
* Confirms a previously initiated identity mapping |
|
372 |
* |
|
373 |
* @param session - the Session object containing the credentials for the Subject |
|
374 |
* @param subject - The identifier of the subject to be used for the equivalent identity |
|
375 |
* |
|
376 |
* @return true if the mapping succeeds |
|
377 |
* |
|
378 |
* @throws InvalidToken |
|
379 |
* @throws ServiceFailure |
|
380 |
* @throws NotAuthorized |
|
381 |
* @throws InvalidRequest |
|
382 |
* @throws NotImplemented |
|
383 |
* @throws NotFound |
|
384 |
*/ |
|
385 |
@Override |
|
386 |
public boolean confirmMapIdentity(Session session, Subject subject) |
|
387 |
throws ServiceFailure, InvalidToken, NotAuthorized, NotFound, |
|
388 |
NotImplemented, InvalidRequest { |
|
389 |
|
|
390 |
return false; |
|
391 |
} |
|
392 |
|
|
393 |
/** |
|
394 |
* Create a group with the given name |
|
395 |
* |
|
396 |
* @param session - the Session object containing the credentials for the Subject |
|
397 |
* @param groupName - The name of the group to be created |
|
398 |
* |
|
399 |
* @return true if the creation succeeds |
|
400 |
* |
|
401 |
* @throws InvalidToken |
|
402 |
* @throws ServiceFailure |
|
403 |
* @throws NotAuthorized |
|
404 |
* @throws InvalidRequest |
|
405 |
* @throws NotImplemented |
|
406 |
* @throws NotFound |
|
407 |
* @throws IdentifierNotUnique |
|
408 |
*/ |
|
409 |
@Override |
|
410 |
public boolean createGroup(Session session, Subject groupName) |
|
411 |
throws ServiceFailure, InvalidToken, NotAuthorized, NotFound, |
|
412 |
NotImplemented, InvalidRequest, IdentifierNotUnique { |
|
413 |
|
|
414 |
return false; |
|
415 |
} |
|
416 |
|
|
417 |
/** |
|
418 |
* Get information about a Person (identities, groups, etc.) |
|
419 |
* |
|
420 |
* @param session - the Session object containing the credentials for the Subject |
|
421 |
* @param subject - The name of the group to be created |
|
422 |
* |
|
423 |
* @return true if the creation succeeds |
|
424 |
* |
|
425 |
* @throws InvalidToken |
|
426 |
* @throws ServiceFailure |
|
427 |
* @throws NotAuthorized |
|
428 |
* @throws InvalidRequest |
|
429 |
* @throws NotImplemented |
|
430 |
*/ |
|
431 |
@Override |
|
432 |
public SubjectList getSubjectInfo(Session session, Subject subject) |
|
433 |
throws ServiceFailure, InvalidRequest, NotAuthorized, NotImplemented { |
|
434 |
|
|
435 |
return null; |
|
436 |
} |
|
437 |
|
|
438 |
/** |
|
439 |
* List subjects, including users, groups, and systems, that match search criteria |
|
440 |
* |
|
441 |
* @param session - the Session object containing the credentials for the Subject |
|
442 |
* @param query - A query string criteria to be matched |
|
443 |
* @param start - The starting record number for the records to be returned |
|
444 |
* @param count - The number of records to be returned |
|
445 |
* |
|
446 |
* @return subjectList - the list of subjects matching the criteria |
|
447 |
* |
|
448 |
* @throws InvalidToken |
|
449 |
* @throws ServiceFailure |
|
450 |
* @throws NotAuthorized |
|
451 |
* @throws NotImplemented |
|
452 |
*/ |
|
453 |
@Override |
|
454 |
public SubjectList listSubjects(Session session, String query, Integer start, |
|
455 |
Integer count) |
|
456 |
throws ServiceFailure, InvalidToken, NotAuthorized, NotImplemented { |
|
457 |
// TODO Auto-generated method stub |
|
458 |
return null; |
|
459 |
} |
|
460 |
|
|
461 |
/** |
|
462 |
* Map the two authenticated identities, asserting that they represent the same subject |
|
463 |
* |
|
464 |
* @param session - the Session object containing the credentials for the Subject |
|
465 |
* @param subject - The Subject identifier to be used for the equivalent identity |
|
466 |
* |
|
467 |
* @return true if the mapping initiation succeeds (still requires confirmation) |
|
468 |
* |
|
469 |
* @throws InvalidToken |
|
470 |
* @throws ServiceFailure |
|
471 |
* @throws NotAuthorized |
|
472 |
* @throws InvalidRequest |
|
473 |
* @throws NotImplemented |
|
474 |
* @throws NotFound |
|
475 |
*/ |
|
476 |
@Override |
|
477 |
public boolean mapIdentity(Session session, Subject subject) |
|
478 |
throws ServiceFailure, InvalidToken, NotAuthorized, NotFound, |
|
479 |
NotImplemented, InvalidRequest { |
|
480 |
|
|
481 |
return false; |
|
482 |
} |
|
483 |
|
|
484 |
/** |
|
485 |
* Create a new subject in the DataONE system |
|
486 |
* |
|
487 |
* @param session - the Session object containing the credentials for the Subject |
|
488 |
* @param groupName - The name of the group to be created |
|
489 |
* |
|
490 |
* @return subject - the identifier of the subject created |
|
491 |
* |
|
492 |
* @throws ServiceFailure |
|
493 |
* @throws IdentifierNotUnique |
|
494 |
* @throws InvalidRequest |
|
495 |
* @throws InvalidCredentials |
|
496 |
* @throws NotImplemented |
|
497 |
*/ |
|
498 |
@Override |
|
499 |
public Subject registerAccount(Session session, Person person) |
|
500 |
throws ServiceFailure, IdentifierNotUnique, InvalidCredentials, |
|
501 |
NotImplemented, InvalidRequest { |
|
502 |
|
|
503 |
return null; |
|
504 |
} |
|
505 |
|
|
506 |
/** |
|
507 |
* Remove members from a named group |
|
508 |
* |
|
509 |
* @param session - the Session object containing the credentials for the Subject |
|
510 |
* @param groupName - The name of the group to be modified |
|
511 |
* @param members - The list of members to be removed |
|
512 |
* |
|
513 |
* @return true if the removal succeeds |
|
514 |
* |
|
515 |
* @throws ServiceFailure |
|
516 |
* @throws InvalidToken |
|
517 |
* @throws NotAuthorized |
|
518 |
* @throws NotFound |
|
519 |
* @throws NotImplemented |
|
520 |
* @throws InvalidRequest |
|
521 |
*/ |
|
522 |
@Override |
|
523 |
public boolean removeGroupMembers(Session session, Subject groupName, |
|
524 |
SubjectList members) |
|
525 |
throws ServiceFailure, InvalidToken, NotAuthorized, NotFound, |
|
526 |
NotImplemented, InvalidRequest { |
|
527 |
|
|
528 |
return false; |
|
529 |
} |
|
530 |
|
|
531 |
/** |
|
532 |
* Update an existing subject in the DataONE system |
|
533 |
* |
|
534 |
* @param session - the Session object containing the credentials for the Subject |
|
535 |
* @param person - The new information about the Subject |
|
536 |
* |
|
537 |
* @return subject - The Subject in the DataONE system that was updated. |
|
538 |
* |
|
539 |
* @throws ServiceFailure |
|
540 |
* @throws IdentifierNotUnique |
|
541 |
* @throws InvalidCredentials |
|
542 |
* @throws NotImplemented |
|
543 |
* @throws InvalidRequest |
|
544 |
*/ |
|
545 |
@Override |
|
546 |
public Subject updateAccount(Session session, Person person) |
|
547 |
throws ServiceFailure, IdentifierNotUnique, InvalidCredentials, |
|
548 |
NotImplemented, InvalidRequest { |
|
549 |
|
|
550 |
return null; |
|
551 |
} |
|
552 |
|
|
553 |
/** |
|
554 |
* Verify that the Person data associated with this Subject is a true |
|
555 |
* representation of the real world person. |
|
556 |
* |
|
557 |
* @param session - the Session object containing the credentials for the Subject |
|
558 |
* @param person - The Subject identifier of the Person to be verified |
|
559 |
* |
|
560 |
* @return true if the account verification succeeds |
|
561 |
* |
|
562 |
* @throws ServiceFailure |
|
563 |
* @throws NotAuthorized |
|
564 |
* @throws NotImplemented |
|
565 |
* @throws InvalidToken |
|
566 |
* @throws InvalidRequest |
|
567 |
*/ |
|
568 |
@Override |
|
569 |
public boolean verifyAccount(Session session, Subject person) |
|
570 |
throws ServiceFailure, NotAuthorized, NotImplemented, InvalidToken, |
|
571 |
InvalidRequest { |
|
572 |
|
|
573 |
return false; |
|
574 |
} |
|
575 |
|
|
576 |
/** |
|
577 | 347 |
* Used internally within a Coordinating Node to add a new object |
578 | 348 |
* to the object store |
579 | 349 |
* |
... | ... | |
723 | 493 |
if (session == null) { |
724 | 494 |
//TODO: many of the thrown exceptions do not use the correct error codes |
725 | 495 |
//check these against the docs and correct them |
726 |
throw new NotAuthorized("4861", "No Session - could not authorize to registration." +
|
|
496 |
throw new NotAuthorized("4861", "No Session - could not authorize for registration." +
|
|
727 | 497 |
" If you are not logged in, please do so and retry the request."); |
728 | 498 |
} |
729 | 499 |
|
Also available in: Unified diff
Metacat does not implement CNIdentity - it is a stand-alone service