Changeset 7656 for RevitalizationWS


Ignore:
Timestamp:
25/10/10 16:54:31 (9 years ago)
Author:
mnagni
Message:

Added a service to remove a provider, plus minor bugs (a nullpointer in getProviderDetails)

Location:
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization
Files:
1 added
5 edited

Legend:

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

    r7625 r7656  
    4040import ndg.services.revitalization.ejb.interfaces.DPWSRemote; 
    4141import ndg.services.revitalization.executor.ExecuteAddTimer; 
     42import ndg.services.revitalization.executor.ExecuteDeleteProvider; 
    4243import ndg.services.revitalization.executor.ExecuteDeleteTimer; 
    4344import ndg.services.revitalization.executor.ExecuteDoIngest; 
     
    5354import ndg.services.schemas.revitalization.AddTimerRequest; 
    5455import ndg.services.schemas.revitalization.AddTimerResponse; 
     56import ndg.services.schemas.revitalization.DeleteProviderRequest; 
     57import ndg.services.schemas.revitalization.DeleteProviderResponse; 
    5558import ndg.services.schemas.revitalization.DeleteTimerRequest; 
    5659import ndg.services.schemas.revitalization.DeleteTimerResponse; 
     
    161164                return executor.doService(request); 
    162165        } 
     166         
     167        @WebMethod(operationName = "deleteProvider") 
     168        public DeleteProviderResponse deleteProvider(@WebParam(name = "request") DeleteProviderRequest request) { 
     169                ServiceExecutor<DeleteProviderRequest, DeleteProviderResponse> executor = new ExecuteDeleteProvider(); 
     170                return executor.doService(request); 
     171        } 
    163172} 
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/ModelManager.java

    r7625 r7656  
    4646import javax.persistence.Query; 
    4747 
     48import ndg.common.NdgMessage; 
    4849import ndg.common.ejb.exception.TimerCreationException; 
     50import ndg.common.exception.NdgExecutionException; 
    4951import ndg.services.revitalization.dictionary.ServiceConfigurationParameter; 
    5052import ndg.services.revitalization.ejb.interfaces.HTITimerServiceLocal; 
     
    294296        @SuppressWarnings("unchecked") 
    295297        @Override 
    296         public List<? extends ProviderCommon> getHarvesterConfiguration(List<Integer> commonIDs) { 
     298        public List<? extends ProviderCommon> getHarvesterConfiguration(List<Integer> commonIDs) throws NdgExecutionException { 
    297299                        List<ProviderCommon> ret = new ArrayList<ProviderCommon>(); 
    298300                        if (commonIDs == null || commonIDs.size() == 0) { 
     
    302304                        ProviderCommon provider = null; 
    303305                        for (Integer id : commonIDs) { 
     306                                if (id == null) 
     307                                        throw new NdgExecutionException("The parameter ProviderId is not a parsable number  "); 
     308                                        //throw new NdgExecutionException(new NdgMessage("string.not.number", new Object[]{"ProviderID"})); 
    304309                                provider = getHarvesterConfiguration(id); 
    305310                                if (provider != null) 
     
    327332        public TimerInfo getTimerInfo(int providerID){ 
    328333                return timerService.getTimerInfo(providerID); 
     334        } 
     335         
     336        public void deleteProvider(List<Integer> providerID) throws NdgExecutionException { 
     337                for (Integer id : providerID){ 
     338                        if (id == null) 
     339                                throw new NdgExecutionException("The parameter ProviderId is not a parsable number  "); 
     340                        ProviderCommon provider = getProviderCommon(id); 
     341                        em.remove(provider);     
     342                } 
    329343        } 
    330344         
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/interfaces/ModelManagerLocal.java

    r7625 r7656  
    3737import javax.ejb.Local; 
    3838 
     39import ndg.common.exception.NdgExecutionException; 
    3940import ndg.services.revitalization.dictionary.ServiceConfigurationParameter; 
    4041import ndg.services.revitalization.executor.ProviderLogs; 
     
    9091        public String getConfigurationParameter(ServiceConfigurationParameter param); 
    9192         
    92         public List<? extends ProviderCommon> getHarvesterConfiguration(List<Integer> commonIDs); 
     93        /** 
     94         * Returns a <code>List</code> of configurations for the given providerIDs 
     95         * @param commonIDs the provider's IDs 
     96         * @return the providers configuration 
     97         * @throws NdgExecutionException if errors occurs 
     98         **/     
     99        public List<? extends ProviderCommon> getHarvesterConfiguration(List<Integer> commonIDs) throws NdgExecutionException; 
    93100         
    94101        /** 
     
    98105         * */ 
    99106        public HiProcess getHiProcess(Integer processID); 
     107         
     108        public void deleteProvider(List<Integer> providerID) throws NdgExecutionException; 
    100109} 
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/interfaces/ModelManagerRemote.java

    r7625 r7656  
    3939import ndg.common.ejb.exception.TimerCreationException; 
    4040import ndg.common.ejb.exception.TimerNotExistingException; 
     41import ndg.common.exception.NdgExecutionException; 
    4142import ndg.services.revitalization.dictionary.ServiceConfigurationParameter; 
    4243import ndg.services.revitalization.executor.ProviderLogs; 
     
    142143         * @param commonIDs the provider's IDs 
    143144         * @return the providers configuration 
     145         * @throws NdgExecutionException if errors occurs 
    144146         **/     
    145         public List<? extends ProviderCommon> getHarvesterConfiguration(List<Integer> commonIDs); 
     147        public List<? extends ProviderCommon> getHarvesterConfiguration(List<Integer> commonIDs) throws NdgExecutionException; 
    146148         
    147149        /** 
     
    174176         * */ 
    175177        public TimerInfo getTimerInfo(int providerID); 
     178         
     179        public void deleteProvider(List<Integer> providerID) throws NdgExecutionException; 
    176180} 
  • RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/HTITimerAdapter.java

    r7625 r7656  
    6767         
    6868        public TimerInfoDetail modelToResponse(TimerInfo timerInfo) { 
     69                if (timerInfo == null) 
     70                        return null; 
    6971                TimerInfoDetail timer = new TimerInfoDetail(); 
    7072                 
Note: See TracChangeset for help on using the changeset viewer.