Project

General

Profile

« Previous | Next » 

Revision 5794

Added by berkley over 13 years ago

updated replicate to only use GET requests. added notes for tomorrows standup

View differences:

src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java
583 583
                    status = true;
584 584
                } else if(resource.equals(RESOURCE_REPLICATE)) {
585 585
                    System.out.println("processing replicate request");
586
                    String pathInfo = request.getPathInfo();
587
                    pathInfo = pathInfo.substring(1);
588
                    System.out.println("pathInfo: " + pathInfo);
586
                    
587
                    if(httpVerb == GET)
588
                    {
589
                        String pathInfo = request.getPathInfo();
590
                        pathInfo = pathInfo.substring(1);
591
                        System.out.println("pathInfo: " + pathInfo);
592
                        String nodeId = pathInfo.substring(0, pathInfo.indexOf("/"));
593
                        String guid = pathInfo.substring(pathInfo.indexOf("/") + 1, pathInfo.length());
594
                        System.out.println("replicating (pulling) " + guid + " from node " + nodeId);
595
                        
596
                        //respond to cn with 200/OK
597
                        //lookup nodeId from the registry
598
                        //get the document
599
                        //verify checksum
600
                        //insert the document in local db
601
                        //call cn.setReplicationStatus(guid, COMPLETE)
602
                        
603
                        /*Questions:
604
                         * Call is now supposed to look like replicate(token, SystemMetadata, SourceNode)
605
                         * how is SystemMetadata encoded?  Multipart?
606
                         * 
607
                         * Is the token passed used to access MN_A?  How does MN_A
608
                         * know it's valid?
609
                         * 
610
                         * What exactly is happening when setReplicationStatus is called
611
                         * to the CN?  Which systemMetadata is being updated?  MN_A or MN_B or both?
612
                         * 
613
                         * 
614
                         * 
615
                         */
616
                        
617
                    }
618
                    
589 619
                    status = true;
590 620
                }
591 621
                    

Also available in: Unified diff