107 |
107 |
|
108 |
108 |
/* the logger instance */
|
109 |
109 |
private Logger logMetacat = null;
|
|
110 |
public final static String V2V1MISSMATCH = "The Coordinating Node is not authorized to make systemMetadata changes on this object. Please make changes directly on the authoritative Member Node.";
|
110 |
111 |
|
111 |
112 |
/**
|
112 |
113 |
* singleton accessor
|
... | ... | |
152 |
153 |
|
153 |
154 |
}
|
154 |
155 |
|
|
156 |
//only allow pid to be passed
|
|
157 |
String serviceFailure = "4882";
|
|
158 |
String notFound = "4884";
|
|
159 |
checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
|
160 |
"No object could be found for given PID: "+pid.getValue());
|
|
161 |
|
155 |
162 |
/*String serviceFailureCode = "4882";
|
156 |
163 |
Identifier sid = getPIDForSID(pid, serviceFailureCode);
|
157 |
164 |
if(sid != null) {
|
... | ... | |
188 |
195 |
throw new NotFound("4884", "Couldn't find an object identified by " + pid.getValue());
|
189 |
196 |
|
190 |
197 |
}
|
191 |
|
|
|
198 |
D1NodeVersionChecker checker = new D1NodeVersionChecker(systemMetadata.getAuthoritativeMemberNode());
|
|
199 |
String version = checker.getVersion("MNStorage");
|
|
200 |
if(version == null) {
|
|
201 |
throw new ServiceFailure("4882", "Couldn't determine the version of the MNStorge for the "+pid.getValue());
|
|
202 |
} else if (version.equalsIgnoreCase(D1NodeVersionChecker.V2)) {
|
|
203 |
//we don't apply this method to an object whose authoritative node is v2
|
|
204 |
throw new NotAuthorized("4881", V2V1MISSMATCH);
|
|
205 |
} else if (!version.equalsIgnoreCase(D1NodeVersionChecker.V1)) {
|
|
206 |
//we don't understand this version (it is not v1 or v2)
|
|
207 |
throw new InvalidRequest("4883", "The version of the MNStorage is "+version+" for the authoritative member node of the object "+pid.getValue()+". We don't support it.");
|
|
208 |
}
|
192 |
209 |
// does the request have the most current system metadata?
|
193 |
210 |
if ( systemMetadata.getSerialVersion().longValue() != serialVersion ) {
|
194 |
211 |
String msg = "The requested system metadata version number " +
|
The setReplicationPolicy method only apply to the pids whose authoritative member node has v2 MNStorage.