Project

General

Profile

« Previous | Next » 

Revision 6511

do not require ID reservation before create() or update()

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
73 73
import org.dataone.service.types.v1.Services;
74 74
import org.dataone.service.types.v1.Session;
75 75
import org.dataone.service.types.v1.Subject;
76
import org.dataone.service.types.v1.SubjectList;
77 76
import org.dataone.service.types.v1.Synchronization;
78 77
import org.dataone.service.types.v1.SystemMetadata;
79 78
import org.dataone.service.types.v1.util.ChecksumUtil;
......
252 251
            ServiceFailure, NotAuthorized, IdentifierNotUnique, UnsupportedType, InsufficientResources, NotFound, InvalidSystemMetadata, NotImplemented,
253 252
            InvalidRequest {
254 253

  
255
        // check if the pid has been reserved
256
        try {
257
            boolean hasReservation = D1Client.getCN().hasReservation(session, pid);
258
            if (!hasReservation) {
259
                throw new NotAuthorized("", "No reservation for pid: " + pid.getValue());
260
            }
261
        } catch (NotFound e) {
262
            // okay to continue
263
        }
264

  
265 254
        String localId = null;
266 255
        boolean allowed = false;
267 256
        boolean isScienceMetadata = false;
......
346 335
    public Identifier create(Session session, Identifier pid, InputStream object, SystemMetadata sysmeta) throws InvalidToken, ServiceFailure, NotAuthorized,
347 336
            IdentifierNotUnique, UnsupportedType, InsufficientResources, InvalidSystemMetadata, NotImplemented, InvalidRequest {
348 337

  
349
        // check if the pid has been reserved
350
        try {
351
            boolean hasReservation = D1Client.getCN().hasReservation(session, pid);
352
            if (!hasReservation) {
353
                throw new NotAuthorized("", "No reservation for pid: " + pid.getValue());
354
            }
355
        } catch (NotFound e) {
356
            // okay to continue
357
        }
358

  
359 338
        return super.create(session, pid, object, sysmeta);
360 339
    }
361 340

  

Also available in: Unified diff