Changeset 7907 for RevitalizationWS


Ignore:
Timestamp:
18/03/11 13:00:41 (8 years ago)
Author:
mnagni
Message:

better check of the ingestion process before the process is started.
Allowed to restart failed ingestion processes.

Location:
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/MailHelper.java

    r7625 r7907  
    8282         *            informed 
    8383         **/ 
    84         public void dispatchedDoIngestMail(IngestRequest request) throws NdgExecutionException { 
    85                 ModelManagerRemote mmr = EJBBeanFactory.getModelManager(); 
    86                 HiProcess process = mmr.getHiProcess(request.getProcessID()); 
    87                  
    88                 if (request.getEmailIDs() == null) 
    89                         return; 
    90                  
     84        public void dispatchedDoIngestMail(IngestRequest request, HiProcess process) throws NdgExecutionException { 
     85                ModelManagerRemote mmr = EJBBeanFactory.getModelManager();               
    9186                List<String> mailTo = filterEmail(request.getEmailIDs(), process.getProviderId()); 
    92  
    9387                String text = mmr.getConfigurationParameter(ServiceConfigurationParameter.NEW_DISPATCHED_INGEST_MAIL); 
    9488                Object[] params = { process.getId() }; 
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/ModelManager.java

    r7905 r7907  
    500500                        List<String> ids = new ArrayList<String>(); 
    501501                        for (Integer id : providerID) { 
    502                                 ids.add(id.toString()); 
     502                                if(id != null) { 
     503                                        ids.add(id.toString());  
     504                                }                                                                
    503505                        } 
    504506                        query.setParameter("providerIDs", ids); 
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/ExecuteDoIngest.java

    r7389 r7907  
    1616import ndg.services.revitalization.EJBBeanFactory; 
    1717import ndg.services.revitalization.MailHelper; 
     18import ndg.services.revitalization.ejb.interfaces.ModelManagerRemote; 
    1819import ndg.services.revitalization.harvest.IngestRequest; 
     20import ndg.services.revitalization.jpa.HiProcess; 
    1921import ndg.services.schemas.revitalization.DoIngestRequest; 
    2022import ndg.services.schemas.revitalization.DoIngestResponse; 
     
    3335                 
    3436                IngestRequest request = new IngestRequest(doRequest.getProcessID().getId(), doRequest.getEmailReportID());               
     37                 
     38                ModelManagerRemote mmr = EJBBeanFactory.getModelManager(); 
     39                HiProcess process = mmr.getHiProcess(request.getProcessID()); 
     40 
     41                if (process == null) 
     42                        throw new NdgExecutionException("Process does not exist. The request rejected.");                
     43                 
     44                if (request.getEmailIDs() == null) 
     45                        throw new NdgExecutionException("EmailID cannot be null. The request rejected."); 
     46                 
    3547                EJBBeanFactory.getMessageDispatcher().dispatchHarvestRequest(request); 
    36                 MailHelper.getInstance().dispatchedDoIngestMail(request); 
     48                MailHelper.getInstance().dispatchedDoIngestMail(request, process); 
    3749        }  
    3850} 
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/IngesterImpl.java

    r7625 r7907  
    7979                        hiProcess = getHiProcess(); 
    8080                        //in future a StatePattern could be better 
    81                         if (!hiProcess.getHiStatus().getId().equals("end_harv")) { 
     81                        if (!(hiProcess.getHiStatus().getId().equals("end_harv") || hiProcess.getHiStatus().getId().equals("failed_ingest"))) { 
    8282                                String msg = EJBBeanFactory.getModelManager().getConfigurationParameter(ServiceConfigurationParameter.PROCESS_UNAVAILABLE_EMAIL); 
    8383                                throw new NdgExecutionException(new NdgMessage(msg, new Object[] {hiProcess.getId(), hiProcess.getHiStatus().getId()}, null));   
Note: See TracChangeset for help on using the changeset viewer.