Revision 6340
Added by Chris Jones over 13 years ago
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java | ||
---|---|---|
84 | 84 |
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException; |
85 | 85 |
import edu.ucsb.nceas.metacat.database.DBConnection; |
86 | 86 |
import edu.ucsb.nceas.metacat.database.DBConnectionPool; |
87 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
|
88 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
|
89 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
|
87 | 90 |
|
88 | 91 |
/** |
89 | 92 |
* Represents Metacat's implementation of the DataONE Member Node |
... | ... | |
626 | 629 |
@Override |
627 | 630 |
public Node getCapabilities() throws NotImplemented, NotAuthorized, |
628 | 631 |
ServiceFailure, InvalidRequest { |
632 |
|
|
633 |
String nodeName = null; |
|
634 |
String nodeId = null; |
|
635 |
String nodeUrl = null; |
|
636 |
String nodeDesc = null; |
|
637 |
String nodeType = null; |
|
629 | 638 |
|
639 |
try |
|
640 |
{ |
|
641 |
nodeId = PropertyService.getProperty("dataone.memberNodeId"); |
|
642 |
nodeName = PropertyService.getProperty("dataone.nodeName"); |
|
643 |
nodeUrl = SystemUtil.getContextURL() + "/d1/"; |
|
644 |
nodeDesc = PropertyService.getProperty("dataone.nodeDescription"); |
|
645 |
nodeType = PropertyService.getProperty("dataone.nodeType"); |
|
646 |
|
|
647 |
} catch(PropertyNotFoundException pnfe) { |
|
648 |
logMetacat.error("MNodeService.getCapabilities(): " + |
|
649 |
"property not found: " + pnfe.getMessage()); |
|
650 |
|
|
651 |
} |
|
652 |
|
|
630 | 653 |
Node node = new Node(); |
631 |
node.setBaseURL(metacatUrl + "/mn");
|
|
632 |
node.setDescription("Metacat Member Node");
|
|
654 |
node.setBaseURL(metacatUrl + "/" + nodeType);
|
|
655 |
node.setDescription(nodeDesc);
|
|
633 | 656 |
// TODO: health |
634 | 657 |
NodeHealth health = new NodeHealth(); |
635 |
node.setHealth(health );
|
|
658 |
node.setHealth(health); |
|
636 | 659 |
NodeReference identifier = new NodeReference(); |
637 |
identifier.setValue("MN (" + node.getBaseURL() + ")");
|
|
660 |
identifier.setValue(nodeId);
|
|
638 | 661 |
node.setIdentifier(identifier); |
639 |
node.setName("Metacat MN");
|
|
662 |
node.setName(nodeName + " -- WAR version WARVERSION");
|
|
640 | 663 |
node.setReplicate(false); |
641 | 664 |
// services: MNAuthorization, MNCore, MNRead, MNReplication, MNStorage |
642 | 665 |
Services services = new Services(); |
... | ... | |
655 | 678 |
services.addService(sMNAuthorization); |
656 | 679 |
services.addService(sMNStorage); |
657 | 680 |
services.addService(sMNReplication); |
658 |
node.setServices(services );
|
|
681 |
node.setServices(services); |
|
659 | 682 |
// TODO: sync info |
660 | 683 |
Synchronization synchronization = new Synchronization(); |
661 |
node.setSynchronization(synchronization );
|
|
684 |
node.setSynchronization(synchronization); |
|
662 | 685 |
node.setSynchronize(false); |
663 | 686 |
node.setType(NodeType.MN); |
664 | 687 |
|
Also available in: Unified diff
Use D1 properties to set node values, and add the 'WAR VERSION' back into the node name for deployments.