Project

General

Profile

« Previous | Next » 

Revision 6665

Added by Chris Jones over 12 years ago

Minor logging for isNodeAuthorized(), and compare subjects properly. Change this to Subject.compareTo() when it is vetted.

View differences:

src/edu/ucsb/nceas/metacat/dataone/CNodeService.java
855 855
      // get the target node reference from the nodes list
856 856
      CNode cn = D1Client.getCN();
857 857
      List<Node> nodes = cn.listNodes().getNodeList();
858

  
858
      
859 859
      if ( nodes != null ) {
860 860
        for (Node node : nodes) {
861
            
861 862
            for (Subject nodeSubject : node.getSubjectList()) {
862
                if (nodeSubject.getValue().equals(targetNodeSubject.getValue())) {
863
                
864
                if ( CertificateManager.getInstance().equalsDN(nodeSubject.getValue(), targetNodeSubject.getValue())) {
863 865
                    targetNode = node.getIdentifier();
864 866
                    logMetacat.debug("targetNode is : " + targetNode.getValue());
865 867
                    break;
866 868
                }
867

  
868 869
            }
869 870
            
870
            if ( targetNode != null ) {
871
                break;
872
            }
871
            if ( targetNode != null) { break; }
873 872
        }
874 873
        
875 874
      } else {
......
890 889
          
891 890
          if ( replicaList != null ) {
892 891
              
893
              logMetacat.debug("Replica list for identifier " + pid.getValue() +
894
                  " is " + replicaList.size());
895 892
              // find the replica with the status set to 'requested'
896 893
              for (Replica replica : replicaList) {
897 894
                  ReplicationStatus status = replica.getReplicationStatus();
......
906 903
                  }
907 904
              }
908 905
          }
906
          logMetacat.debug("The " + targetNode.getValue() + " is allowed " +
907
              "to replicate: " + isAllowed + " for " + pid.getValue());
908

  
909 909
          
910
          
911 910
      } else {
912 911
          logMetacat.debug("System metadata for identifier " + pid.getValue() +
913 912
          " is null.");          
......
916 915
      HazelcastService.getInstance().getSystemMetadataMap().unlock(pid);
917 916

  
918 917
    } catch (RuntimeException e) {
919
    	ServiceFailure sf = new ServiceFailure("4872", 
920
                "General Exception: Couldn't determine if node is allowed: " + 
918
    	  ServiceFailure sf = new ServiceFailure("4872", 
919
                "Runtime Exception: Couldn't determine if node is allowed: " + 
921 920
                e.getMessage());
922
    	sf.initCause(e);
921
    	  sf.initCause(e);
923 922
        throw sf;
924 923
        
925 924
    } finally {

Also available in: Unified diff