Revision 9479
Added by Jing Tao almost 9 years ago
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java | ||
---|---|---|
1421 | 1421 |
throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest, |
1422 | 1422 |
InvalidToken { |
1423 | 1423 |
|
1424 |
if(isReadOnlyMode()) { |
|
1424 |
/*if(isReadOnlyMode()) {
|
|
1425 | 1425 |
throw new InvalidRequest("1334", "The Metacat member node is on the read-only mode and your request can't be fulfiled. Please try again later."); |
1426 |
} |
|
1426 |
}*/
|
|
1427 | 1427 |
// cannot be called by public |
1428 | 1428 |
if (session == null) { |
1429 | 1429 |
throw new InvalidToken("1332", "No session was provided."); |
src/edu/ucsb/nceas/metacat/restservice/v1/MNResourceHandler.java | ||
---|---|---|
85 | 85 |
import edu.ucsb.nceas.metacat.util.DeleteOnCloseFileInputStream; |
86 | 86 |
import edu.ucsb.nceas.utilities.PropertyNotFoundException; |
87 | 87 |
import edu.ucsb.nceas.metacat.MetaCatServlet; |
88 |
import edu.ucsb.nceas.metacat.ReadOnlyChecker; |
|
88 | 89 |
|
89 | 90 |
|
90 | 91 |
/** |
... | ... | |
642 | 643 |
throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest, |
643 | 644 |
InvalidToken { |
644 | 645 |
|
646 |
ReadOnlyChecker checker = new ReadOnlyChecker(); |
|
647 |
boolean isReadOnlyMode = checker.isReadOnly(); |
|
648 |
if(isReadOnlyMode) { |
|
649 |
throw new InvalidRequest("1334", "The Metacat member node is on the read-only mode and your request can't be fulfiled. Please try again later."); |
|
650 |
} |
|
645 | 651 |
long serialVersion = 0L; |
646 | 652 |
String serialVersionStr = null; |
647 | 653 |
Date dateSysMetaLastModified = null; |
src/edu/ucsb/nceas/metacat/restservice/v2/MNResourceHandler.java | ||
---|---|---|
87 | 87 |
import org.xml.sax.SAXException; |
88 | 88 |
|
89 | 89 |
import edu.ucsb.nceas.metacat.MetaCatServlet; |
90 |
import edu.ucsb.nceas.metacat.ReadOnlyChecker; |
|
90 | 91 |
import edu.ucsb.nceas.metacat.common.query.stream.ContentTypeInputStream; |
91 | 92 |
import edu.ucsb.nceas.metacat.dataone.MNodeService; |
92 | 93 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
... | ... | |
669 | 670 |
private void systemMetadataChanged() |
670 | 671 |
throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest, |
671 | 672 |
InvalidToken { |
672 |
|
|
673 |
|
|
674 |
ReadOnlyChecker checker = new ReadOnlyChecker(); |
|
675 |
boolean isReadOnlyMode = checker.isReadOnly(); |
|
676 |
if(isReadOnlyMode) { |
|
677 |
throw new InvalidRequest("1334", "The Metacat member node is on the read-only mode and your request can't be fulfiled. Please try again later."); |
|
678 |
} |
|
679 |
|
|
673 | 680 |
//final long serialVersion = 0L; |
674 | 681 |
String serialVersionStr = null; |
675 | 682 |
String dateSysMetaLastModifiedStr = null; |
Also available in: Unified diff
The systemmetadataChanged method is asynchronized, so we put the read-only checking on the ResourceHandler class.