Project

General

Profile

« Previous | Next » 

Revision 2663

Added by sgarg over 18 years ago

Replacing MetaCatUtil.debugMessage or MetaCatUtil.logMetacat call with logMetacat (private Logger object) call

View differences:

PermissionController.java
35 35
import java.util.Vector;
36 36
import java.util.Iterator;
37 37

  
38
import org.apache.log4j.Logger;
39

  
38 40
public class PermissionController
39 41
{
40 42
   private String docId = null;
......
45 47
   private long TOPLEVELSTARTNODEID = 0; //if start node is 0, means it is top
46 48
                                         //level document
47 49

  
50
   private static Logger logMetacat = Logger.getLogger(PermissionController.class);
48 51

  
49 52
   /**
50 53
    * Constructor for PermissionController
......
190 193
    }//try
191 194
    catch (Exception e)
192 195
    {
193
      MetaCatUtil.debugMessage("There is a exception in hasPermission method: "
194
                         +e.getMessage(), 50);
196
      logMetacat.warn("There is a exception in hasPermission method: "
197
                         +e.getMessage());
195 198
    }
196 199

  
197 200
    return false;
......
346 349
        }//try
347 350
        catch( Exception e)
348 351
        {
349
          MetaCatUtil.debugMessage("error in PermissionControl.has" +
350
                                   "UnaccessableSubTree "+e.getMessage(), 30);
352
          logMetacat.error("error in PermissionControl.has" +
353
                                   "UnaccessableSubTree "+e.getMessage());
351 354
          throw new McdbException(e);
352 355
        }
353 356

  
......
397 400
          if (startId > subTreeStartId && endId < subTreeEndId)
398 401
          {
399 402
            needDelete = true;
400
            MetaCatUtil.debugMessage("the subtree: "+ treeId +
403
            logMetacat.info("the subtree: "+ treeId +
401 404
                                     " need to be get rid of from unaccessable"+
402 405
                                     " subtree list becuase it is a subtree of"+
403
                                     " another subtree in the list", 45);
406
                                     " another subtree in the list");
404 407
            break;
405 408
          }//if
406 409
        }//while
......
510 513
        // Bind the values to the query
511 514
        pStmt.setString(1, docId);
512 515
        pStmt.setString(2, principals[i]);
513
        MetaCatUtil.debugMessage("the principle stack is : " +
514
                                  principals[i], 40);
516
        logMetacat.info("the principle stack is : " +
517
                                  principals[i]);
515 518

  
516 519
        pStmt.execute();
517 520
        ResultSet rs = pStmt.getResultSet();
......
519 522
        if (hasRow)
520 523
        {
521 524
          pStmt.close();
522
           MetaCatUtil.debugMessage("find the owner", 40);
525
           logMetacat.info("find the owner");
523 526
          return true;
524 527
        }//if
525 528

  
......
863 866
        if (user != null)
864 867
        {
865 868
          usersPackage[0]= user.toLowerCase();
866
          MetaCatUtil.debugMessage("after transfer to lower case(not null): "+
867
                                     usersPackage[0], 45);
869
          logMetacat.info("after transfer to lower case(not null): "+
870
                                     usersPackage[0]);
868 871
        }
869 872
        else
870 873
        {
871 874
          usersPackage[0] = user;
872 875
          usersPackage[0]= user.toLowerCase();
873
          MetaCatUtil.debugMessage("after transfer to lower case(null): "+
874
                                     usersPackage[0], 45);
876
          logMetacat.info("after transfer to lower case(null): "+
877
                                     usersPackage[0]);
875 878
        }
876 879
        usersPackage[1]=AccessControlInterface.PUBLIC;
877 880
        //put groups element from index 0 to lengthOfPackage-3 into userPackage
......
1005 1008
        {
1006 1009
            if(withRevision)
1007 1010
            {
1008
                MetaCatUtil.debugMessage("Put subtree id " + subTreeId +
1011
                logMetacat.info("Put subtree id " + subTreeId +
1009 1012
                                         " and " + "inline data file name " +
1010 1013
                                         fileId + " into " + "un" + permission +
1011
                                         " hash", 20);
1014
                                         " hash");
1012 1015
                unAccessbleIdList.put(subTreeId, fileId);
1013 1016

  
1014 1017
            }
1015 1018
            else
1016 1019
            {
1017
                MetaCatUtil.debugMessage("Put subtree id " + subTreeId +
1020
                logMetacat.info("Put subtree id " + subTreeId +
1018 1021
                                         " and " + "inline data file name " +
1019 1022
                                         MetaCatUtil.
1020 1023
                                         getInlineDataIdWithoutRev(fileId) +
1021 1024
                                         " into " + "un" + permission +
1022
                                         " hash", 20);
1025
                                         " hash");
1023 1026
                unAccessbleIdList.put(subTreeId, MetaCatUtil.
1024 1027
                                      getInlineDataIdWithoutRev(fileId));
1025 1028
            }

Also available in: Unified diff