Project

General

Profile

« Previous | Next » 

Revision 6540

Added by Chris Jones over 12 years ago

Add debugging output to MNodeService.

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
392 392
        throws NotImplemented, ServiceFailure, NotAuthorized, InvalidRequest, 
393 393
        InsufficientResources, UnsupportedType {
394 394

  
395
        logMetacat.info("MNodeService.replicate() called with parameters: \n" +
396
            "\tSession.Subject      = " + session.getSubject().getValue() + "\n" +
397
            "\tSystemMetadata       = " + sysmeta.toString()              + "\n" +
398
            "\tSource NodeReference ="  + sourceNode.getValue());
399
        
395 400
        boolean result = false;
396 401

  
397 402
        // TODO: check credentials
......
408 413

  
409 414
        try {
410 415
            object = mn.getReplica(session, pid);
416
            logMetacat.info("MNodeService.replicate() called for identifier " + pid.getValue());
417

  
411 418
        } catch (InvalidToken e) {
412 419
            e.printStackTrace();
413 420
            throw new ServiceFailure("2151", "Could not retrieve object to replicate (InvalidToken): " + e.getMessage());
......
890 897
     * Essentially a get() but with different logging behavior
891 898
     */
892 899
    @Override
893
    public InputStream getReplica(Session session, Identifier pid) throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, ServiceFailure, NotFound {
900
    public InputStream getReplica(Session session, Identifier pid) 
901
        throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, 
902
        ServiceFailure, NotFound {
894 903

  
904
        logMetacat.info("MNodeService.getReplica() called.");
905

  
895 906
        InputStream inputStream = null; // bytes to be returned
896 907
        handler = new MetacatHandler(new Timer());
897 908
        boolean allowed = false;
......
910 921
        // check for authorization to replicate
911 922
        allowed = D1Client.getCN().isNodeAuthorized(session, targetNodeSubject, pid, Permission.REPLICATE);
912 923

  
924
        logMetacat.info("Called D1Client.isNodeAuthorized(). Allowed = " + allowed +
925
            " for identifier " + pid.getValue());
926

  
913 927
        // if the person is authorized, perform the read
914 928
        if (allowed) {
915 929
            try {

Also available in: Unified diff