Revision 6347
Added by Chris Jones over 13 years ago
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java | ||
---|---|---|
670 | 670 |
String mnStorageServiceVersion = null; |
671 | 671 |
String mnReplicationServiceVersion = null; |
672 | 672 |
|
673 |
boolean nodeSynchronize = false; |
|
674 |
boolean nodeReplicate = false; |
|
673 | 675 |
boolean mnCoreServiceAvailable = false; |
674 | 676 |
boolean mnReadServiceAvailable = false; |
675 | 677 |
boolean mnAuthorizationServiceAvailable = false; |
... | ... | |
678 | 680 |
|
679 | 681 |
try |
680 | 682 |
{ |
683 |
// get the properties of the node based on configuration information |
|
681 | 684 |
nodeId = PropertyService.getProperty("dataone.memberNodeId"); |
682 | 685 |
nodeName = PropertyService.getProperty("dataone.nodeName"); |
683 | 686 |
nodeUrl = SystemUtil.getContextURL() + "/d1/"; |
684 | 687 |
nodeDesc = PropertyService.getProperty("dataone.nodeDescription"); |
685 | 688 |
nodeType = PropertyService.getProperty("dataone.nodeType"); |
689 |
nodeSynchronize = |
|
690 |
new Boolean(PropertyService.getProperty( |
|
691 |
"dataone.nodeSynchronize")).booleanValue(); |
|
692 |
nodeReplicate = |
|
693 |
new Boolean(PropertyService.getProperty( |
|
694 |
"dataone.nodeReplicate")).booleanValue(); |
|
695 |
|
|
686 | 696 |
mnCoreServiceVersion = |
687 | 697 |
PropertyService.getProperty("dataone.mncore.serviceVersion"); |
688 | 698 |
mnReadServiceVersion = |
... | ... | |
715 | 725 |
|
716 | 726 |
} |
717 | 727 |
|
728 |
// set the properties of the node based on configuration information |
|
718 | 729 |
Node node = new Node(); |
719 | 730 |
node.setBaseURL(metacatUrl + "/" + nodeType); |
720 | 731 |
node.setDescription(nodeDesc); |
... | ... | |
725 | 736 |
identifier.setValue(nodeId); |
726 | 737 |
node.setIdentifier(identifier); |
727 | 738 |
node.setName(nodeName + " -- WAR version WARVERSION"); |
728 |
node.setReplicate(false); |
|
739 |
node.setReplicate(new Boolean(nodeReplicate).booleanValue()); |
|
740 |
node.setSynchronize(new Boolean(nodeSynchronize).booleanValue()); |
|
741 |
|
|
729 | 742 |
// services: MNAuthorization, MNCore, MNRead, MNReplication, MNStorage |
730 | 743 |
Services services = new Services(); |
731 | 744 |
Service sMNRead = new Service(); |
732 | 745 |
sMNRead.setName("MNRead"); |
733 | 746 |
sMNRead.setVersion(mnReadServiceVersion); |
734 | 747 |
sMNRead.setAvailable(mnReadServiceAvailable); |
748 |
|
|
735 | 749 |
Service sMNCore = new Service(); |
736 | 750 |
sMNCore.setName("MNCore"); |
737 | 751 |
sMNCore.setVersion(mnCoreServiceVersion); |
738 | 752 |
sMNCore.setAvailable(mnCoreServiceAvailable); |
753 |
|
|
739 | 754 |
Service sMNAuthorization = new Service(); |
740 | 755 |
sMNAuthorization.setName("MNAuthorization"); |
741 | 756 |
sMNAuthorization.setVersion(mnAuthorizationServiceVersion); |
742 | 757 |
sMNAuthorization.setAvailable(mnAuthorizationServiceAvailable); |
758 |
|
|
743 | 759 |
Service sMNStorage = new Service(); |
744 | 760 |
sMNStorage.setName("MNStorage"); |
745 | 761 |
sMNStorage.setVersion(mnStorageServiceVersion); |
746 | 762 |
sMNStorage.setAvailable(mnStorageServiceAvailable); |
763 |
|
|
747 | 764 |
Service sMNReplication = new Service(); |
748 | 765 |
sMNReplication.setName("MNReplication"); |
749 | 766 |
sMNReplication.setVersion(mnReplicationServiceVersion); |
750 | 767 |
sMNReplication.setAvailable(mnReplicationServiceAvailable); |
768 |
|
|
751 | 769 |
services.addService(sMNRead); |
752 | 770 |
services.addService(sMNCore); |
753 | 771 |
services.addService(sMNAuthorization); |
754 | 772 |
services.addService(sMNStorage); |
755 | 773 |
services.addService(sMNReplication); |
756 | 774 |
node.setServices(services); |
775 |
|
|
757 | 776 |
// TODO: sync info |
758 | 777 |
Synchronization synchronization = new Synchronization(); |
759 | 778 |
node.setSynchronization(synchronization); |
Also available in: Unified diff
In MNodeService.getCapabilities(), set the synchronization and replication properties of the node.