Project

General

Profile

« Previous | Next » 

Revision 7030

Globally change the property 'dataone.memberNodeId' to 'dataone.nodeId'. This is more useful for both MNs and CNs implemented in Metacat. Also, change D1NodeService.getLogRecords() to return log entries with the actual node id rather than the IP address (looks like a cut/paste error).
Fixes https://redmine.dataone.org/issues/2367.

View differences:

lib/metacat.properties.metadata.xml
370 370
		<helpFile> </helpFile>
371 371
	</config>
372 372
	<config>
373
		<key>dataone.memberNodeId</key>
373
		<key>dataone.nodeId</key>
374 374
		<label>Node Identifier</label>
375 375
		<group>6</group>
376 376
		<index>3</index>
lib/metacat.properties
499 499
# Configure the Member Node client certificate location
500 500
D1Client.certificate.file=/var/metacat/certs/METACAT1.pem
501 501
# Member Node configuration
502
dataone.memberNodeId=
502
dataone.nodeId=
503 503
dataone.subject=CN=METACAT1, DC=dataone, DC=org
504 504
dataone.contactSubject=CN=METACAT1, DC=dataone, DC=org
505 505
dataone.nodeName=My Metacat Node
lib/admin/dataone-configuration.jsp
139 139
		<img class="question-mark" src="style/images/question-mark.gif" 
140 140
			onClick="helpWindow('<%= request.getContextPath() %>','docs/dataone.html#configuring-metacat-as-a-member-node')"/>
141 141
		<div class="textinput-label">
142
			<label for="dataone.memberNodeId" title="The DataONE-assigned unique identifier for this node">Node Identifier</label>
142
			<label for="dataone.nodeId" title="The DataONE-assigned unique identifier for this node">Node Identifier</label>
143 143
		</div>
144 144
		<input class="textinput" 
145
			id="dataone.memberNodeId" 
146
			name="dataone.memberNodeId" 	             		    	    	           		    	             			
147
			value="<%= request.getAttribute("dataone.memberNodeId") %>"/>
145
			id="dataone.nodeId" 
146
			name="dataone.nodeId" 	             		    	    	           		    	             			
147
			value="<%= request.getAttribute("dataone.nodeId") %>"/>
148 148
	</div>
149 149
	<div class="form-row">
150 150
		<img class="question-mark" src="style/images/question-mark.gif" 
src/edu/ucsb/nceas/metacat/util/MetacatPopulator.java
325 325
            sm.setDateSysMetadataModified(dateUpdated);
326 326
        }
327 327
        NodeReference nr = new NodeReference();
328
        nr.setValue(PropertyService.getProperty("dataone.memberNodeId"));
328
        nr.setValue(PropertyService.getProperty("dataone.nodeId"));
329 329
        sm.setOriginMemberNode(nr);
330 330
        sm.setAuthoritativeMemberNode(nr);
331 331
        
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
481 481

  
482 482
        // get the local node id
483 483
        try {
484
            nodeIdStr = PropertyService.getProperty("dataone.memberNodeId");
484
            nodeIdStr = PropertyService.getProperty("dataone.nodeId");
485 485
            nodeId = new NodeReference();
486 486
            nodeId.setValue(nodeIdStr);
487 487

  
488 488
        } catch (PropertyNotFoundException e1) {
489
            String msg = "Couldn't get dataone.memberNodeId property: " + e1.getMessage();
489
            String msg = "Couldn't get dataone.nodeId property: " + e1.getMessage();
490 490
            failure = new ServiceFailure("2151", msg);
491 491
            setReplicationStatus(thisNodeSession, pid, nodeId, ReplicationStatus.FAILED, failure);
492 492
            logMetacat.error(msg);
......
777 777
        try {
778 778
            // get the properties of the node based on configuration information
779 779
            nodeName = PropertyService.getProperty("dataone.nodeName");
780
            nodeId = PropertyService.getProperty("dataone.memberNodeId");
780
            nodeId = PropertyService.getProperty("dataone.nodeId");
781 781
            subject = PropertyService.getProperty("dataone.subject");
782 782
            contactSubject = PropertyService.getProperty("dataone.contactSubject");
783 783
            nodeDesc = PropertyService.getProperty("dataone.nodeDescription");
src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
454 454
      Date logDate = DateTimeMarshaller.deserializeDateToUTC(dateLogged);
455 455
      le.setDateLogged(logDate);
456 456
      NodeReference memberNode = new NodeReference();
457
      memberNode.setValue(ipAddress);
457
      String nodeId = "localhost";
458
      try {
459
          nodeId = PropertyService.getProperty("dataone.nodeId");
460
      } catch (PropertyNotFoundException e1) {
461
          // TODO Auto-generated catch block
462
          e1.printStackTrace();
463
      }
464
      memberNode.setValue(nodeId);
458 465
      le.setNodeIdentifier(memberNode);
459 466
      Subject princ = new Subject();
460 467
      princ.setValue(principal);
src/edu/ucsb/nceas/metacat/dataone/SystemMetadataFactory.java
292 292
		
293 293
		// authoritative node
294 294
		NodeReference nr = new NodeReference();
295
		nr.setValue(PropertyService.getProperty("dataone.memberNodeId"));
295
		nr.setValue(PropertyService.getProperty("dataone.nodeId"));
296 296
		sysMeta.setOriginMemberNode(nr);
297 297
		sysMeta.setAuthoritativeMemberNode(nr);
298 298
		
src/edu/ucsb/nceas/metacat/admin/D1Admin.java
106 106
				// get the current configuration values
107 107
				String nodeName = PropertyService.getProperty("dataone.nodeName");
108 108
				String nodeDescription = PropertyService.getProperty("dataone.nodeDescription");
109
				String memberNodeId = PropertyService.getProperty("dataone.memberNodeId");
109
				String memberNodeId = PropertyService.getProperty("dataone.nodeId");
110 110
				String nodeSynchronize = PropertyService.getProperty("dataone.nodeSynchronize");
111 111
				String subject = PropertyService.getProperty("dataone.subject");
112 112
				String contactSubject = PropertyService.getProperty("dataone.contactSubject");
......
138 138
				
139 139
				request.setAttribute("dataone.nodeName", nodeName);
140 140
				request.setAttribute("dataone.nodeDescription", nodeDescription);
141
				request.setAttribute("dataone.memberNodeId", memberNodeId);
141
				request.setAttribute("dataone.nodeId", memberNodeId);
142 142
				request.setAttribute("dataone.nodeSynchronize", Boolean.toString(synchronize));
143 143
				request.setAttribute("dataone.subject", subject);
144 144
				request.setAttribute("dataone.contactSubject", contactSubject);
......
178 178
				request.setAttribute("configutil.dataoneConfigured", PropertyService.getProperty("configutil.dataoneConfigured"));
179 179
				
180 180
				// do we know if this is an update, pending verification, or a new registration?
181
				memberNodeId = (String) request.getAttribute("dataone.memberNodeId");
181
				memberNodeId = (String) request.getAttribute("dataone.nodeId");
182 182
				boolean update = isNodeRegistered(memberNodeId);
183 183
				request.setAttribute("dataone.isUpdate", Boolean.toString(update));
184 184
				request.setAttribute("dataone.mn.registration.submitted", PropertyService.getProperty("dataone.mn.registration.submitted"));
......
248 248
				
249 249
				String nodeName = (String)request.getParameter("dataone.nodeName");
250 250
				String nodeDescription = (String)request.getParameter("dataone.nodeDescription");
251
				String memberNodeId = (String)request.getParameter("dataone.memberNodeId");
251
				String memberNodeId = (String)request.getParameter("dataone.nodeId");
252 252
				String nodeSynchronize = (String)request.getParameter("dataone.nodeSynchronize");
253 253
				String subject = (String)request.getParameter("dataone.subject");
254 254
				String contactSubject = (String)request.getParameter("dataone.contactSubject");
......
316 316
					PropertyService.setPropertyNoPersist("dataone.mn.services.enabled", Boolean.toString(servicesEnabled));
317 317
					
318 318
					// get the current node id so we know if we updated the value
319
					String existingMemberNodeId = PropertyService.getProperty("dataone.memberNodeId");
319
					String existingMemberNodeId = PropertyService.getProperty("dataone.nodeId");
320 320
					
321 321
					// update the property value
322
		            PropertyService.setPropertyNoPersist("dataone.memberNodeId", memberNodeId);
322
		            PropertyService.setPropertyNoPersist("dataone.nodeId", memberNodeId);
323 323
					
324 324
		            // persist them all
325 325
					PropertyService.persistProperties();
src/edu/ucsb/nceas/metacat/IdentifierManager.java
1431 1431
            }
1432 1432

  
1433 1433
            if (replicaStatus) {
1434
                String currentNodeId = PropertyService.getInstance().getProperty("dataone.memberNodeId");
1434
                String currentNodeId = PropertyService.getInstance().getProperty("dataone.nodeId");
1435 1435
                if (!f1 && !f2 && !f3) {
1436 1436
                    sql += " where authoritive_member_node != '" +
1437 1437
                        currentNodeId.trim() + "'";

Also available in: Unified diff