Revision 6254
Added by Chris Jones almost 13 years ago
D1NodeService.java | ||
---|---|---|
83 | 83 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
84 | 84 |
import edu.ucsb.nceas.metacat.replication.ForceReplicationHandler; |
85 | 85 |
import edu.ucsb.nceas.metacat.util.SessionData; |
86 |
import edu.ucsb.nceas.metacat.util.SystemUtil; |
|
86 | 87 |
import edu.ucsb.nceas.utilities.ParseLSIDException; |
87 | 88 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
88 | 89 |
|
... | ... | |
91 | 92 |
private static Logger logMetacat = Logger.getLogger(D1NodeService.class); |
92 | 93 |
|
93 | 94 |
/* the metacat URL as a string (including ending /d1 service)*/ |
94 |
private String metacatUrl;
|
|
95 |
protected String metacatUrl;
|
|
95 | 96 |
|
96 | 97 |
/* reference to the metacat handler */ |
97 | 98 |
private MetacatHandler handler; |
... | ... | |
104 | 105 |
* |
105 | 106 |
* @param metacatUrl - the URL of the metacat service, including the ending /d1 |
106 | 107 |
*/ |
107 |
public D1NodeService(String metacatUrl) { |
|
108 |
this.metacatUrl = metacatUrl; |
|
108 |
public D1NodeService() { |
|
109 |
this.metacatUrl = ""; |
|
110 |
|
|
111 |
try { |
|
112 |
this.metacatUrl = SystemUtil.getContextURL() + |
|
113 |
PropertyService.getProperty("dataone.serviceName"); |
|
114 |
} catch (PropertyNotFoundException e) { |
|
115 |
throw new RuntimeException("Error getting the servlet url in D1NodeService: " + |
|
116 |
e.getMessage()); |
|
117 |
|
|
118 |
} |
|
109 | 119 |
|
110 | 120 |
} |
111 | 121 |
|
Also available in: Unified diff
At Ben's suggestion, add metacatUrl to D1NodeService and make it available to subclasses. Set the metacatUrl in the constructor using SystemUtil rather than all roll your own PropertyService calls. More concise. Also, log the delete event in MNodeService.delete().