Changeset 7389
- Timestamp:
- 27/08/10 13:34:59 (11 years ago)
- Location:
- RevitalizationWS/ws/DPWS/trunk
- Files:
-
- 7 added
- 1 deleted
- 23 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
RevitalizationWS/ws/DPWS/trunk/pom.xml
r7360 r7389 122 122 <scope>provided</scope> 123 123 </dependency> 124 124 125 <dependency> 125 126 <groupId>org.jboss.security</groupId> … … 128 129 <scope>provided</scope> 129 130 </dependency> 131 132 <dependency> 133 <groupId>ndg.services.schemas</groupId> 134 <artifactId>ows</artifactId> 135 <version>1.0.0</version> 136 <scope>provided</scope> 137 </dependency> 138 139 <dependency> 140 <groupId>ndg.services.schemas</groupId> 141 <artifactId>gml</artifactId> 142 <version>3.1.1</version> 143 <scope>provided</scope> 144 </dependency> 145 146 <dependency> 147 <groupId>ndg.services.schemas</groupId> 148 <artifactId>filter</artifactId> 149 <version>1.1.0</version> 150 <scope>provided</scope> 151 </dependency> 152 153 <dependency> 154 <groupId>ndg.services.schemas</groupId> 155 <artifactId>csw</artifactId> 156 <version>2.0.2</version> 157 <scope>provided</scope> 158 </dependency> 159 160 <dependency> 161 <groupId>xerces</groupId> 162 <artifactId>xercesImpl</artifactId> 163 <version>2.9.1</version> 164 <scope>provided</scope> 165 </dependency> 166 167 <dependency> 168 <groupId>org.hibernate</groupId> 169 <artifactId>hibernate-annotations</artifactId> 170 <version>3.4.0.GA</version> 171 <scope>provided</scope> 172 </dependency> 173 130 174 </dependencies> 131 175 -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/EJBBeanFactory.java
r7360 r7389 26 26 * Utility class to retrieve the remote EJB necessary to the application. 27 27 * 28 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 28 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 29 29 **/ 30 30 public class EJBBeanFactory { 31 31 32 32 /** 33 33 * Returns a {@link JMSDispatcherRemote} 34 * @return a instance of a JMSDispatcherRemote 34 * 35 * @return a instance of a JMSDispatcherRemote 35 36 **/ 36 37 public static JMSDispatcherRemote getMessageDispatcher() throws NdgExecutionException { 37 return getEJBInstance("JMSDispatcher", JMSDispatcherRemote.class); 38 return getEJBInstance("JMSDispatcher", JMSDispatcherRemote.class); 38 39 } 39 40 40 41 /** 41 42 * Returns a {@link MailDispatcherRemote} 42 * @return a instance of a MailDispatcherRemote 43 * 44 * @return a instance of a MailDispatcherRemote 43 45 **/ 44 46 public static MailDispatcherRemote getMailDispatcher() throws NdgExecutionException { 45 47 return getEJBInstance("MailDispatcher", MailDispatcherRemote.class); 46 48 } 47 48 49 49 50 /** 50 51 * Returns a {@link ModelManagerRemote} 51 * @return a instance of a ModelManagerRemote 52 * 53 * @return a instance of a ModelManagerRemote 52 54 **/ 53 55 public static ModelManagerRemote getModelManager() throws NdgExecutionException { 54 56 return getEJBInstance("ModelManager", ModelManagerRemote.class); 55 57 } 56 57 private synchronized static <T> T getEJBInstance(String ejbName, Class<T> remoteEJBclass) throws NdgExecutionException { 58 59 private synchronized static <T> T getEJBInstance(String ejbName, Class<T> remoteEJBclass) 60 throws NdgExecutionException { 58 61 try { 59 62 Context jndiContext = new javax.naming.InitialContext(); 60 61 return (T) PortableRemoteObject.narrow(ref,remoteEJBclass);63 Object ref = jndiContext.lookup(ejbName); 64 return (T) PortableRemoteObject.narrow(ref, remoteEJBclass); 62 65 } catch (NamingException e) { 63 throw new NdgExecutionException(new NdgMessage("execution.error", new Object[] {"jndiContext.lookup(\"" + ejbName + "\")", e.getMessage()}, null)); 64 } 66 throw new NdgExecutionException(new NdgMessage("execution.error", new Object[] { 67 "jndiContext.lookup(\"" + ejbName + "\")", e.getMessage() }, null)); 68 } 69 65 70 } 66 71 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/MailHelper.java
r7360 r7389 20 20 import ndg.services.revitalization.dictionary.ServiceConfigurationParameter; 21 21 import ndg.services.revitalization.ejb.interfaces.ModelManagerRemote; 22 import ndg.services.revitalization.harvest.IngestRequest; 22 23 import ndg.services.revitalization.jpa.HiProcess; 23 24 import ndg.services.revitalization.jpa.ProviderCommon; 24 25 import ndg.services.revitalization.jpa.ProviderEmail; 25 import ndg.services.schemas.revitalization.DoHarvestRequest;26 import ndg.services.schemas.revitalization.DoIngestRequest;27 26 28 27 /** 29 28 * Offers some helper methods to send specific mails. 30 29 * 31 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 30 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 32 31 */ 33 32 public class MailHelper { … … 41 40 42 41 /** 43 * Informs a list of subscribers that a new harvest operation has been submitted to the system 44 * @param the harvest request containing the list of the subscribers to be informed 45 * @param the new process instance 42 * Informs a list of subscribers that a new harvest operation has been 43 * submitted to the system 44 * 45 * @param the 46 * harvest request containing the list of the subscribers to be 47 * informed 48 * @param the 49 * new process instance 46 50 **/ 47 public void newDispatchedHarvestMail( DoHarvestRequest request, HiProcess process) throws NdgExecutionException {51 public void newDispatchedHarvestMail(List<Integer> emailIDs, HiProcess process) throws NdgExecutionException { 48 52 ModelManagerRemote mmr = EJBBeanFactory.getModelManager(); 49 53 ProviderCommon common = mmr.getHarvesterConfiguration(process.getProviderId()); 50 List<String> mailTo = filterEmail( request.getEmailReportID(), common);51 54 List<String> mailTo = filterEmail(emailIDs, common); 55 52 56 String text = mmr.getConfigurationParameter(ServiceConfigurationParameter.NEW_DISPATCHED_HARVEST_MAIL); 53 57 Object[] params = { common.toString(), process.getId() }; … … 56 60 57 61 /** 58 * Informs a list of subscribers that a harvest operation has terminated. A message is send to 59 * all the provider's subscription list. 60 * @param the terminated process instance 61 **/ 62 * Informs a list of subscribers that a harvest operation has terminated. A 63 * message is send to all the provider's subscription list. 64 * 65 * @param the 66 * terminated process instance 67 **/ 62 68 public void terminatedHarvestMail(HiProcess hiProcess) throws NdgExecutionException { 63 69 sendTerminatedProcess(hiProcess, ServiceConfigurationParameter.HARVEST_TERMINATED_MAIL); … … 67 73 sendTerminatedProcess(hiProcess, ServiceConfigurationParameter.DO_INGEST_PROCESS_TERMINATED_EMAIL); 68 74 } 69 75 70 76 /** 71 * Informs a list of subscribers that a new ingest operation has been submitted to the system 72 * @param the ingest request containing the list of the subscribers to be informed 73 **/ 74 public void dispatchedDoIngestMail(DoIngestRequest request) throws NdgExecutionException { 77 * Informs a list of subscribers that a new ingest operation has been 78 * submitted to the system 79 * 80 * @param the 81 * ingest request containing the list of the subscribers to be 82 * informed 83 **/ 84 public void dispatchedDoIngestMail(IngestRequest request) throws NdgExecutionException { 75 85 ModelManagerRemote mmr = EJBBeanFactory.getModelManager(); 76 HiProcess process = mmr.getHiProcess(request.getProcessID() .getId());77 List<String> mailTo = filterEmail(request.getEmail ReportID(), process.getProviderId());78 86 HiProcess process = mmr.getHiProcess(request.getProcessID()); 87 List<String> mailTo = filterEmail(request.getEmailIDs(), process.getProviderId()); 88 79 89 String text = mmr.getConfigurationParameter(ServiceConfigurationParameter.NEW_DISPATCHED_INGEST_MAIL); 80 90 Object[] params = { process.getId() }; … … 91 101 92 102 /** 93 * Informs a list of subscribers that an operation has failed. A message is send to 94 * all the provider's subscription list. 95 * @param hiProcess the failed process instance 96 * @param msg the failure message 103 * Informs a list of subscribers that an operation has failed. A message is 104 * send to all the provider's subscription list. 105 * 106 * @param hiProcess 107 * the failed process instance 108 * @param msg 109 * the failure message 97 110 **/ 98 public void sentProcessFailedMail(HiProcess hiProcess, String msg) throws NdgExecutionException { 111 public void sentProcessFailedMail(HiProcess hiProcess, String msg) throws NdgExecutionException { 99 112 List<String> mailTo = filterEmail(null, hiProcess.getProviderId()); 100 113 dispatchMail(mailTo, "ProcessId:" + hiProcess.getId(), msg, null); … … 108 121 109 122 /** 110 * Returns a list of emailIDs extracted from a {@link ProviderCommon}. Such mailIDs are matched with 111 * the <code>emailsID</code> parameter if it is not <code>null</code> 112 * @param emailIDs the list of IDs to be matched 113 * @param common the object containig the default emails information 114 * @return a list of emails 123 * Returns a list of emailIDs extracted from a {@link ProviderCommon}. Such 124 * mailIDs are matched with the <code>emailsID</code> parameter if it is not 125 * <code>null</code> 126 * 127 * @param emailIDs 128 * the list of IDs to be matched 129 * @param common 130 * the object containig the default emails information 131 * @return a list of emails 115 132 * */ 116 133 private List<String> filterEmail(List<Integer> emailIDs, int providerID) throws NdgExecutionException { 117 134 return filterEmail(emailIDs, EJBBeanFactory.getModelManager().getHarvesterConfiguration(providerID)); 118 135 } 119 136 120 137 /** 121 * Returns a list of emailIDs extracted from a {@link ProviderCommon}. Such mailIDs are matched with 122 * the <code>emailsID</code> parameter if it is not <code>null</code> 123 * @param emailIDs the list of IDs to be matched 124 * @param common the object containig the default emails information 125 * @return a list of emails 138 * Returns a list of emailIDs extracted from a {@link ProviderCommon}. Such 139 * mailIDs are matched with the <code>emailsID</code> parameter if it is not 140 * <code>null</code> 141 * 142 * @param emailIDs 143 * the list of IDs to be matched 144 * @param common 145 * the object containig the default emails information 146 * @return a list of emails 126 147 * */ 127 148 private List<String> filterEmail(List<Integer> emailIDs, ProviderCommon common) throws NdgExecutionException { -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/AsyncProcessManager.java
r7360 r7389 26 26 * 27 27 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 28 */ 29 @Stateless(name ="ejb/AsyncProcessManager")28 */ 29 @Stateless(name = "ejb/AsyncProcessManager") 30 30 public class AsyncProcessManager implements AsyncProcessManagerLocal, AsyncProcessManagerRemote { 31 31 … … 36 36 @Override 37 37 @Asynchronous 38 public final void invoke(InvokeProcess process) { 39 try {40 process.invoke();41 } catch (NdgExecutionException ex) {42 manageError(ex);43 }38 public final void invoke(InvokeProcess process) { 39 try { 40 process.invoke(); 41 } catch (NdgExecutionException ex) { 42 manageError(ex); 43 } 44 44 } 45 45 46 46 private void manageError(NdgException ex) { 47 //MessageFormatter mf = new MessageFormatter(); 48 //ct.setMessage(mf.getFormattedText(ex.getBundlMessage())); 49 //ct.setStatus(ERROR); 50 } 47 48 //MessageFormatter mf = new MessageFormatter(); 49 //ct.setMessage(mf.getFormattedText(ex.getBundlMessage())); 50 //ct.setStatus(ERROR); 51 } 51 52 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/DPWS.java
r7360 r7389 16 16 import javax.jws.WebMethod; 17 17 import javax.jws.WebParam; 18 import javax.jws.WebResult;19 18 import javax.jws.WebService; 20 import javax.jws.soap.SOAPBinding;21 import javax.jws.soap.SOAPBinding.Style;22 import javax.jws.soap.SOAPBinding.Use;23 19 24 20 import ndg.services.revitalization.ejb.interfaces.DPWSLocal; … … 55 51 /** 56 52 * Session Bean implementation class DPWS 57 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 53 * 54 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 58 55 */ 59 // @RolesAllowed("OPERATOR")56 // @RolesAllowed("OPERATOR") 60 57 /* 61 @PermitAll 62 @SecurityDomain("discoveryDomain") 63 @WebContext(contextRoot="/discovery", urlPattern="/dpws" ,authMethod="CLIENT-CERT", transportGuarantee="CONFIDENTIAL", secureWSDLAccess=false) 64 */ 58 * @PermitAll 59 * 60 * @SecurityDomain("discoveryDomain") 61 * 62 * @WebContext(contextRoot="/discovery", urlPattern="/dpws" 63 * ,authMethod="CLIENT-CERT", transportGuarantee="CONFIDENTIAL", 64 * secureWSDLAccess=false) 65 */ 65 66 @WebService 66 @Stateless(name ="dpws")67 @WebContext(contextRoot ="/discovery", urlPattern="/dpws")67 @Stateless(name = "dpws") 68 @WebContext(contextRoot = "/discovery", urlPattern = "/dpws") 68 69 public class DPWS implements DPWSRemote, DPWSLocal { 69 70 @WebMethod(operationName ="doHarvest")71 public DoHarvestResponse doHarvest(@WebParam(name ="request") DoHarvestRequest request) {70 71 @WebMethod(operationName = "doHarvest") 72 public DoHarvestResponse doHarvest(@WebParam(name = "request") DoHarvestRequest request) { 72 73 ServiceExecutor<DoHarvestRequest, DoHarvestResponse> executor = new ExecuteHarvest(); 73 74 return executor.doService(request); 74 75 } 75 76 76 77 @WebMethod(operationName="getStatusProcess") 78 public GetProcessStatusResponse getUsageStats(@WebParam(name="request") GetProcessStatusRequest request) { 77 @WebMethod(operationName = "getStatusProcess") 78 public GetProcessStatusResponse getUsageStats(@WebParam(name = "request") GetProcessStatusRequest request) { 79 79 ServiceExecutor<GetProcessStatusRequest, GetProcessStatusResponse> executor = new ExecuteGetProcessStatusRequest(); 80 80 return executor.doService(request); 81 81 } 82 82 83 @WebMethod(operationName ="getList")84 public GetListResponse getList(@WebParam(name ="request")GetListType request) {83 @WebMethod(operationName = "getList") 84 public GetListResponse getList(@WebParam(name = "request") GetListType request) { 85 85 ServiceExecutor<GetListType, GetListResponse> executor = new ExecuteGetList(); 86 86 return executor.doService(request); 87 87 } 88 89 @WebMethod(operationName ="doNewUpdateProvider")90 public DoNewUpdateProviderResponse doNewProvider(@WebParam(name ="request") DoNewUpdateProviderRequest request) {88 89 @WebMethod(operationName = "doNewUpdateProvider") 90 public DoNewUpdateProviderResponse doNewProvider(@WebParam(name = "request") DoNewUpdateProviderRequest request) { 91 91 ServiceExecutor<DoNewUpdateProviderRequest, DoNewUpdateProviderResponse> executor = new ExecuteDoNewProvider(); 92 92 return executor.doService(request); 93 } 94 95 @WebMethod(operationName ="getListNames")93 } 94 95 @WebMethod(operationName = "getListNames") 96 96 public GetListNamesResponse getListNames() { 97 97 ServiceExecutor<Object, GetListNamesResponse> executor = new ExecuteGetListNames(); 98 98 return executor.doService(null); 99 } 100 101 @WebMethod(operationName ="getProviderDetails")102 public GetProviderDetailsResponse getProviderDetails(@WebParam(name ="request") GetProviderDetailsRequest request) {99 } 100 101 @WebMethod(operationName = "getProviderDetails") 102 public GetProviderDetailsResponse getProviderDetails(@WebParam(name = "request") GetProviderDetailsRequest request) { 103 103 ServiceExecutor<GetProviderDetailsRequest, GetProviderDetailsResponse> executor = new ExecuteGetProviderDetails(); 104 return executor.doService(request); 104 return executor.doService(request); 105 105 } 106 107 @WebMethod(operationName ="getHarvestHistory")108 public GetHarvestHistoryResponse getHarvestHistory(@WebParam(name ="request") GetHistoryRequest request) {106 107 @WebMethod(operationName = "getHarvestHistory") 108 public GetHarvestHistoryResponse getHarvestHistory(@WebParam(name = "request") GetHistoryRequest request) { 109 109 ServiceExecutor<GetHistoryRequest, GetHarvestHistoryResponse> executor = new ExecuteGetHarvestHistory(); 110 return executor.doService(request); 110 return executor.doService(request); 111 111 } 112 113 @WebMethod(operationName ="getIngestHistory")114 public GetIngestHistoryResponse getIngestHistory(@WebParam(name ="request") GetHistoryRequest request) {112 113 @WebMethod(operationName = "getIngestHistory") 114 public GetIngestHistoryResponse getIngestHistory(@WebParam(name = "request") GetHistoryRequest request) { 115 115 ServiceExecutor<GetHistoryRequest, GetIngestHistoryResponse> executor = new ExecuteGetIngestHistory(); 116 116 return executor.doService(request); 117 117 } 118 119 @WebMethod(operationName ="doIngest")120 public DoIngestResponse doIngest(@WebParam(name ="request") DoIngestRequest request) {118 119 @WebMethod(operationName = "doIngest") 120 public DoIngestResponse doIngest(@WebParam(name = "request") DoIngestRequest request) { 121 121 ServiceExecutor<DoIngestRequest, DoIngestResponse> executor = new ExecuteDoIngest(); 122 122 return executor.doService(request); -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/HiProcessModel.java
r7312 r7389 14 14 import ndg.services.revitalization.jpa.HiStatus; 15 15 16 17 16 /** 18 17 * Session Bean implementation class HiProcessModel … … 22 21 23 22 private final static String GET_HI_PROCESS = "select hp from HiProcess hp where hp.id IN (:hpID)"; 24 23 24 /* 25 25 private enum STATUS { 26 START_HARV("start_harv"), 27 RUN_HARV("run_harv"), 28 END_HARV("end_harv"), 29 START_INGEST("start_ingest"), 30 RUN_INGEST("run_ingest"), 31 END_INGEST("end_ingest"); 32 26 START_HARV("start_harv"), RUN_HARV("run_harv"), END_HARV("end_harv"), START_INGEST("start_ingest"), RUN_INGEST( 27 "run_ingest"), END_INGEST("end_ingest"); 28 33 29 private final String status; 34 private STATUS(String status){ 30 31 private STATUS(String status) { 35 32 this.status = status; 36 33 } 37 }; 38 34 };*/ 35 39 36 @PersistenceContext(unitName = "discoveryDPWS") 40 37 private EntityManager em; 41 38 42 39 @Override 43 @TransactionAttribute(value =TransactionAttributeType.REQUIRES_NEW)40 @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) 44 41 public HiProcess createNewProcess(int providerID) { 45 42 HiProcess hiProcess = new HiProcess(); … … 49 46 return hiProcess; 50 47 } 51 48 52 49 @Override 53 @TransactionAttribute(value =TransactionAttributeType.SUPPORTS)50 @TransactionAttribute(value = TransactionAttributeType.SUPPORTS) 54 51 public HiProcess advanceStatus(HiProcess hiProcess) { 55 52 HiProcess actualProcess = em.find(HiProcess.class, hiProcess.getId()); … … 57 54 actualProcess.setHarvestDir(hiProcess.getHarvestDir()); 58 55 if (actualProcess.getHiStatus().getId().equalsIgnoreCase("start_harv")) 59 actualProcess.setHiStatus(em.find(HiStatus.class, "run_harv")); 56 actualProcess.setHiStatus(em.find(HiStatus.class, "run_harv")); 60 57 if (actualProcess.getHiStatus().getId().equalsIgnoreCase("run_harv")) 61 actualProcess.setHiStatus(em.find(HiStatus.class, "end_harv")); 58 actualProcess.setHiStatus(em.find(HiStatus.class, "end_harv")); 62 59 return actualProcess; 63 60 } 64 61 65 62 public List<HiProcess> getHiProcess(List<Integer> processIDs) { 66 63 Query query = em.createQuery(GET_HI_PROCESS); 67 64 query.setParameter("hpID", processIDs); 68 65 return (List<HiProcess>) query.getResultList(); 69 } 66 } 70 67 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/JMSConsumer.java
r7316 r7389 1 /* 2 * BSD Licence 3 * Copyright (c) 2009, Science & Technology Facilities Council (STFC) 4 * All rights reserved. 5 6 * See the LICENSE file in the source distribution of this software for 7 * the full license text. 8 * Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 9 * This software may be distributed under the terms of the 10 * Q Public License, version 1.0 or later. 11 * http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 12 */ 1 13 package ndg.services.revitalization.ejb; 2 14 … … 11 23 12 24 import ndg.services.revitalization.InvokeProcess; 25 import ndg.services.revitalization.executor.IngesterImpl; 26 import ndg.services.revitalization.harvest.HarvestRequest; 27 import ndg.services.revitalization.harvest.Harvester; 28 import ndg.services.revitalization.harvest.IngestRequest; 29 import ndg.services.revitalization.harvest.ProviderAdapter; 13 30 import ndg.services.revitalization.harvest.ejb.interfaces.AsyncProcessManagerLocal; 14 31 32 /** 33 * Receives all the Harvest/Ingest request and assigns them to the proper 34 * Process. 35 * 36 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 37 */ 15 38 @MessageDriven(activationConfig = { 16 39 @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), 17 40 @ActivationConfigProperty(propertyName = "destination", propertyValue = "DiscoveryHarvestQueue"), 18 @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Dups-ok-acknowledge") })41 @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Dups-ok-acknowledge") }) 19 42 @TransactionManagement(value = TransactionManagementType.BEAN) 20 43 public class JMSConsumer implements MessageListener { 21 44 22 45 @EJB 23 46 private AsyncProcessManagerLocal executor; 24 47 25 48 public void onMessage(Message message) { 26 49 try { 27 50 ObjectMessage objMessage = (ObjectMessage) message; 28 51 29 if ((objMessage.getObject() instanceof InvokeProcess)) 30 executor.invoke((InvokeProcess) objMessage.getObject()); 31 52 if ((objMessage.getObject() instanceof HarvestRequest)) { 53 Harvester harvester = ProviderAdapter.getInstance().getHarvester( 54 (HarvestRequest) objMessage.getObject()); 55 executor.invoke((InvokeProcess) harvester); 56 } 57 58 if ((objMessage.getObject() instanceof IngestRequest)) { 59 IngesterImpl ingester = new IngesterImpl((IngestRequest) objMessage.getObject()); 60 executor.invoke((InvokeProcess) ingester); 61 } 32 62 return; 33 34 63 } catch (Exception e) { 35 64 e.printStackTrace(); -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/JMSDispatcher.java
r7360 r7389 24 24 @Resource(mappedName = "java:/JmsXA") 25 25 private ConnectionFactory connectionFactory; 26 26 27 27 @Resource(mappedName = "DiscoveryHarvestQueue") 28 28 private Queue queue; 29 29 30 30 @Override 31 public void dispatchHarvestRequest(Serializable doRequest) {31 public void dispatchHarvestRequest(Serializable doRequest) { 32 32 Connection connection = null; 33 33 Session session = null; -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/MailDispatcher.java
r7360 r7389 20 20 * Session Bean implementation class MailDispatcher 21 21 */ 22 @Stateless(mappedName ="MailDispatcher")22 @Stateless(mappedName = "MailDispatcher") 23 23 public class MailDispatcher implements MailDispatcherRemote, MailDispatcherLocal { 24 @Resource(mappedName ="mail/DiscoveryMail")24 @Resource(mappedName = "mail/DiscoveryMail") 25 25 private javax.mail.Session mailSession; 26 26 27 27 public static final String mailFrom = "discovery@badc.rl.ac.uk"; 28 28 29 29 public void sendMail(List<String> mailTo, String subject, String msgText) { 30 if (mailTo == null || mailTo.size() == 0) 31 return; //really should raise an exception 32 List<Address> addresses = new ArrayList<Address>(); 33 Address addr = null; 34 for (String mail: mailTo) { 30 if (mailTo == null || mailTo.size() == 0) { 31 return; 32 }//really should raise an exception 33 List<Address> addresses = new ArrayList<Address>(); 34 Address addr = null; 35 for (String mail : mailTo) { 36 try { 37 addr = new InternetAddress(mail); 38 addresses.add(addr); 39 } catch (AddressException e) { 40 //really should raise an exception 41 e.printStackTrace(); 42 } 43 } 44 MimeMessage msg = new MimeMessage(mailSession); 45 35 46 try { 36 addr = new InternetAddress(mail); 37 addresses.add(addr); 47 msg.setRecipients(Message.RecipientType.TO, addresses.toArray(new InternetAddress[0])); 48 msg.setFrom(new InternetAddress(mailFrom)); 49 msg.setSubject(subject); 50 msg.setText(msgText); 51 52 Transport transport = mailSession.getTransport(); 53 transport.connect(); 54 transport.sendMessage(msg, msg.getAllRecipients()); 55 38 56 } catch (AddressException e) { 39 //really should raise an exception 57 // TODO Auto-generated catch block 58 e.printStackTrace(); 59 } catch (MessagingException e) { 60 // TODO Auto-generated catch block 40 61 e.printStackTrace(); 41 62 } 42 }43 MimeMessage msg = new MimeMessage(mailSession);44 45 try {46 msg.setRecipients(Message.RecipientType.TO, addresses.toArray(new InternetAddress[0]));47 msg.setFrom(new InternetAddress(mailFrom));48 msg.setSubject(subject);49 msg.setText(msgText);50 51 Transport transport = mailSession.getTransport();52 transport.connect();53 transport.sendMessage(msg, msg.getAllRecipients());54 55 } catch (AddressException e) {56 // TODO Auto-generated catch block57 e.printStackTrace();58 } catch (MessagingException e) {59 // TODO Auto-generated catch block60 e.printStackTrace();61 }62 63 } 63 64 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/ejb/ModelManager.java
r7360 r7389 7 7 import java.util.List; 8 8 9 import javax.annotation.Resource;10 9 import javax.ejb.EJB; 11 import javax.ejb.SessionContext;12 10 import javax.ejb.Stateless; 13 11 import javax.ejb.TransactionAttribute; … … 55 53 private HiProcessModelLocal processModel; 56 54 55 /* 57 56 @Resource 58 57 private SessionContext sessionContext; 58 */ 59 59 60 60 public List<String> getServiceParameterNames() { 61 Query query = em.createQuery(GET_SERVICE_PARAMETER_NAMES);62 return (List<String>) query.getResultList();61 Query query = em.createQuery(GET_SERVICE_PARAMETER_NAMES); 62 return (List<String>) query.getResultList(); 63 63 } 64 64 65 65 public List<String> getServiceParameterNamesValues(String parName) { 66 Query query = em.createQuery(GET_SERVICE_PARAMETER_VALUES);67 query.setParameter("parName", parName);68 List<ServiceParameterValue> parValues = query.getResultList();69 List<String> ret = new ArrayList<String>();70 if (parValues != null && parValues.size() > 0) {71 for (ServiceParameterValue parValue : parValues) {72 ret.add(parValue.getValue());73 }74 }75 return ret;66 Query query = em.createQuery(GET_SERVICE_PARAMETER_VALUES); 67 query.setParameter("parName", parName); 68 List<ServiceParameterValue> parValues = query.getResultList(); 69 List<String> ret = new ArrayList<String>(); 70 if (parValues != null && parValues.size() > 0) { 71 for (ServiceParameterValue parValue : parValues) { 72 ret.add(parValue.getValue()); 73 } 74 } 75 return ret; 76 76 } 77 77 … … 93 93 * */ 94 94 public List<ProviderLogs> getHarvestByProvider(Timestamp start, Timestamp end, int providerId) { 95 Query query = null;96 if (Double.isNaN(providerId)) {97 query = em.createQuery(GET_HARVEST_LOG_ALL_PROVIDER);98 } else {99 query = em.createQuery(GET_HARVEST_LOG_BY_PROVIDER);100 query.setParameter("providerID", providerId);101 }102 103 query.setParameter("start", start);104 query.setParameter("end", end);105 106 if (start == null) {107 Calendar date = Calendar.getInstance();108 date.set(Calendar.YEAR, -100);109 query.setParameter("start", new Timestamp(date.getTimeInMillis()));110 }111 112 if (end == null)113 query.setParameter("end", new Timestamp(Calendar.getInstance().getTimeInMillis()));114 115 List<ProviderLogs> ret = new ArrayList<ProviderLogs>();116 ProviderLogs tempLogs = null;117 for (Iterator iter = query.getResultList().iterator() ; iter.hasNext() ;) {118 Object[] resultElement = (Object[])iter.next();119 tempLogs = new ProviderLogs((Integer)resultElement[1]);120 if (tempLogs.getProviderID() == null)121 continue;122 int index = ret.indexOf(tempLogs);123 if (index > -1){124 tempLogs = ret.get(index);125 } else {126 ret.add(tempLogs);127 }128 tempLogs.getLogs().add((HarvestLog)resultElement[0]);129 }130 return ret;95 Query query = null; 96 if (Double.isNaN(providerId)) { 97 query = em.createQuery(GET_HARVEST_LOG_ALL_PROVIDER); 98 } else { 99 query = em.createQuery(GET_HARVEST_LOG_BY_PROVIDER); 100 query.setParameter("providerID", providerId); 101 } 102 103 query.setParameter("start", start); 104 query.setParameter("end", end); 105 106 if (start == null) { 107 Calendar date = Calendar.getInstance(); 108 date.set(Calendar.YEAR, -100); 109 query.setParameter("start", new Timestamp(date.getTimeInMillis())); 110 } 111 112 if (end == null) 113 query.setParameter("end", new Timestamp(Calendar.getInstance().getTimeInMillis())); 114 115 List<ProviderLogs> ret = new ArrayList<ProviderLogs>(); 116 ProviderLogs tempLogs = null; 117 for (Iterator iter = query.getResultList().iterator(); iter.hasNext();) { 118 Object[] resultElement = (Object[]) iter.next(); 119 tempLogs = new ProviderLogs((Integer) resultElement[1]); 120 if (tempLogs.getProviderID() == null) 121 continue; 122 int index = ret.indexOf(tempLogs); 123 if (index > -1) { 124 tempLogs = ret.get(index); 125 } else { 126 ret.add(tempLogs); 127 } 128 tempLogs.getLogs().add((HarvestLog) resultElement[0]); 129 } 130 return ret; 131 131 } 132 132 133 133 public List<IngestSearchLogging> getIngestLogs(List<Integer> processIds) { 134 Query query = em.createQuery(GET_INGESTER_HISTORY);135 query.setParameter("processIds", processIds);136 return (List<IngestSearchLogging>) query.getResultList();134 Query query = em.createQuery(GET_INGESTER_HISTORY); 135 query.setParameter("processIds", processIds); 136 return (List<IngestSearchLogging>) query.getResultList(); 137 137 } 138 138 139 139 public List<HarvestLog> getHarvestLog(List<Integer> processIds) { 140 Query query = em.createQuery(GET_HARVEST_HISTORY);141 query.setParameter("processIds", processIds);142 return (List<HarvestLog>) query.getResultList();140 Query query = em.createQuery(GET_HARVEST_HISTORY); 141 query.setParameter("processIds", processIds); 142 return (List<HarvestLog>) query.getResultList(); 143 143 } 144 144 145 145 @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) 146 146 public void updateHarvestingLogAndStatus(HiProcess hiProcess, HarvestLog harvestLog) { 147 // set the process's status to run_harvest148 processModel.advanceStatus(hiProcess);149 HarvestLog existingLog = em.find(HarvestLog.class, harvestLog.getReqId());150 if (existingLog == null) {151 em.persist(harvestLog);152 } else {153 em.merge(harvestLog);154 }147 // set the process's status to run_harvest 148 processModel.advanceStatus(hiProcess); 149 HarvestLog existingLog = em.find(HarvestLog.class, harvestLog.getReqId()); 150 if (existingLog == null) { 151 em.persist(harvestLog); 152 } else { 153 em.merge(harvestLog); 154 } 155 155 } 156 156 157 157 @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) 158 158 public <T extends ProviderCommon> T createNewProvider(T provider) { 159 if (provider.getId() == null) {160 em.persist(provider);161 int id = provider.getId();162 for (ProviderEmail email : provider.getProviderEmails()) {163 email.setCommonId(id);164 }165 } else {166 ProviderCommon oldProvider = em.find(ProviderCommon.class, provider.getId());167 168 Iterator<ProviderEmail> iterator = oldProvider.getProviderEmails().iterator();169 ProviderEmail item = null;170 while (iterator.hasNext()) {171 item = iterator.next();172 if (!provider.getProviderEmails().contains(item))173 em.remove(item);174 }175 }176 return em.merge(provider);159 if (provider.getId() == null) { 160 em.persist(provider); 161 int id = provider.getId(); 162 for (ProviderEmail email : provider.getProviderEmails()) { 163 email.setCommonId(id); 164 } 165 } else { 166 ProviderCommon oldProvider = em.find(ProviderCommon.class, provider.getId()); 167 168 Iterator<ProviderEmail> iterator = oldProvider.getProviderEmails().iterator(); 169 ProviderEmail item = null; 170 while (iterator.hasNext()) { 171 item = iterator.next(); 172 if (!provider.getProviderEmails().contains(item)) 173 em.remove(item); 174 } 175 } 176 return em.merge(provider); 177 177 } 178 178 179 179 public HiProcess createNewProcess(int providerID) { 180 return processModel.createNewProcess(providerID);180 return processModel.createNewProcess(providerID); 181 181 } 182 182 183 183 public List<HiProcess> getHiProcess(List<Integer> processIDs) { 184 return processModel.getHiProcess(processIDs);184 return processModel.getHiProcess(processIDs); 185 185 } 186 186 187 187 public HiProcess getHiProcess(Integer processID) { 188 List<Integer> id = new ArrayList<Integer>();189 id.add(processID);190 List<HiProcess> rets = processModel.getHiProcess(id);191 return rets.size()>0 ? rets.get(0) : null;192 } 193 188 List<Integer> id = new ArrayList<Integer>(); 189 id.add(processID); 190 List<HiProcess> rets = processModel.getHiProcess(id); 191 return rets.size() > 0 ? rets.get(0) : null; 192 } 193 194 194 public ProviderCommon getProviderCommon(int commonId) { 195 Query query = em.createQuery(GET_PROVIDER_COMMON_BY_ID); 196 query.setParameter("id", commonId); 197 List<ProviderCommon> values = query.getResultList(); 198 if (values == null || values.size() == 0) 199 return null; 200 return values.get(0); 195 Query query = em.createQuery(GET_PROVIDER_COMMON_BY_ID); 196 query.setParameter("id", commonId); 197 List<ProviderCommon> values = query.getResultList(); 198 if (values == null || values.size() == 0) { 199 return null; 200 } 201 return values.get(0); 201 202 } 202 203 203 204 public String getConfigurationParameter(ServiceConfigurationParameter param) { 204 Query query = em.createQuery(GET_CONFIGURATION_PARAMETER); 205 query.setParameter("id", param.name()); 206 List<ServiceConfig> values = query.getResultList(); 207 if (values == null || values.size() == 0) 208 return null; 209 return values.get(0).getParamValue(); 205 Query query = em.createQuery(GET_CONFIGURATION_PARAMETER); 206 query.setParameter("id", param.name()); 207 List<ServiceConfig> values = query.getResultList(); 208 if (values == null || values.size() == 0) { 209 return null; 210 } 211 return values.get(0).getParamValue(); 210 212 } 211 213 … … 218 220 * */ 219 221 public ProviderCommon getHarvesterConfiguration(int commonID) { 220 ProviderCommon ret = null; 221 ret = getProvider(commonID, GET_OAI_PROVIDER); 222 if (ret == null) 223 ret = getProvider(commonID, GET_CSW_PROVIDER); 224 225 return ret; 222 ProviderCommon ret = null; 223 ret = getProvider(commonID, GET_OAI_PROVIDER); 224 if (ret == null) 225 ret = getProvider(commonID, GET_CSW_PROVIDER); 226 return ret; 226 227 } 227 228 228 229 @Override 229 230 public List<? extends ProviderCommon> getHarvesterConfiguration(List<Integer> commonIDs) { 230 List<ProviderCommon> ret = new ArrayList<ProviderCommon>();231 if (commonIDs == null || commonIDs.size() == 0) {232 Query query = em.createQuery(GET_PROVIDER_COMMON);233 return query.getResultList();234 }235 ProviderCommon provider = null;236 for (Integer id : commonIDs) {237 provider = getHarvesterConfiguration(id);238 if (provider != null)239 ret.add(provider);240 }241 return ret;231 List<ProviderCommon> ret = new ArrayList<ProviderCommon>(); 232 if (commonIDs == null || commonIDs.size() == 0) { 233 Query query = em.createQuery(GET_PROVIDER_COMMON); 234 return query.getResultList(); 235 } 236 ProviderCommon provider = null; 237 for (Integer id : commonIDs) { 238 provider = getHarvesterConfiguration(id); 239 if (provider != null) 240 ret.add(provider); 241 } 242 return ret; 242 243 } 243 244 244 245 private <T extends ProviderCommon> T getProvider(int id, String queryText) { 245 Query query = em.createQuery(queryText);246 query.setParameter("id", id);247 List<T> values = query.getResultList();248 if (values == null || values.size() == 0)249 return null;250 return values.get(0);251 }252 253 246 Query query = em.createQuery(queryText); 247 query.setParameter("id", id); 248 List<T> values = query.getResultList(); 249 if (values == null || values.size() == 0) { 250 return null; 251 } 252 return values.get(0); 253 } 254 254 255 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/exception/NdgHarvestNotExistingException.java
r7271 r7389 9 9 10 10 public NdgHarvestNotExistingException() { 11 // TODO Auto-generated constructor stub 11 12 12 } 13 13 14 14 public NdgHarvestNotExistingException(String arg0) { 15 15 super(arg0); 16 // TODO Auto-generated constructor stub17 16 } 18 17 19 18 public NdgHarvestNotExistingException(Throwable arg0) { 20 19 super(arg0); 21 // TODO Auto-generated constructor stub22 20 } 23 21 24 22 public NdgHarvestNotExistingException(NdgMessage bundleMessage) { 25 23 super(bundleMessage); 26 // TODO Auto-generated constructor stub27 24 } 28 25 29 26 public NdgHarvestNotExistingException(String arg0, Throwable arg1) { 30 27 super(arg0, arg1); 31 // TODO Auto-generated constructor stub32 28 } 33 29 34 30 public NdgHarvestNotExistingException(NdgMessage bundleMessage, Throwable th) { 35 31 super(bundleMessage, th); 36 // TODO Auto-generated constructor stub37 32 } 38 39 33 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/ExecuteDoIngest.java
r7319 r7389 1 /* 2 * BSD Licence 3 * Copyright (c) 2009, Science & Technology Facilities Council (STFC) 4 * All rights reserved. 5 6 * See the LICENSE file in the source distribution of this software for 7 * the full license text. 8 * Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 9 * This software may be distributed under the terms of the 10 * Q Public License, version 1.0 or later. 11 * http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 12 */ 1 13 package ndg.services.revitalization.executor; 2 14 … … 4 16 import ndg.services.revitalization.EJBBeanFactory; 5 17 import ndg.services.revitalization.MailHelper; 18 import ndg.services.revitalization.harvest.IngestRequest; 6 19 import ndg.services.schemas.revitalization.DoIngestRequest; 7 20 import ndg.services.schemas.revitalization.DoIngestResponse; … … 15 28 16 29 @Override 17 protected void execute(DoIngestRequest request) throws NdgExecutionException {18 if ( request.getProcessID() == null)30 protected void execute(DoIngestRequest doRequest) throws NdgExecutionException { 31 if (doRequest.getProcessID() == null) 19 32 throw new NdgExecutionException("The ProcessID cannot be empty"); 20 33 21 int processID = request.getProcessID().getId(); 22 DoIngestProcess ingester = new DoIngestProcess(processID); 23 EJBBeanFactory.getMessageDispatcher().dispatchHarvestRequest(ingester); 34 IngestRequest request = new IngestRequest(doRequest.getProcessID().getId(), doRequest.getEmailReportID()); 35 EJBBeanFactory.getMessageDispatcher().dispatchHarvestRequest(request); 24 36 MailHelper.getInstance().dispatchedDoIngestMail(request); 25 37 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/ExecuteDoNewProvider.java
r7360 r7389 7 7 import ndg.common.exception.NdgExecutionException; 8 8 import ndg.services.revitalization.EJBBeanFactory; 9 import ndg.services.revitalization.harvest.ProviderAdapter; 10 import ndg.services.revitalization.harvest.ProviderAdapterFactory; 11 import ndg.services.revitalization.harvest.ProviderAdapterHelper; 9 12 import ndg.services.revitalization.jpa.ProviderCommon; 10 13 import ndg.services.revitalization.jpa.ProviderEmail; … … 106 109 pct.setProviderURL(ret.getBaseUrl()); 107 110 extractProviderEmails(pct, ret); 108 ProviderAdapterHelper helper = ProviderAdapter Helper.getProviderAdapter(ret.getClass());111 ProviderAdapterHelper helper = ProviderAdapterFactory.getProviderAdapterHelper(ret.getClass()); 109 112 pd.setProviderType(helper.extractDetails(ret, getOf())); 110 113 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/ExecuteGetProviderDetails.java
r7312 r7389 7 7 import ndg.services.revitalization.EJBBeanFactory; 8 8 import ndg.services.revitalization.ejb.interfaces.ModelManagerRemote; 9 import ndg.services.revitalization.harvest.ProviderAdapter; 9 10 import ndg.services.revitalization.jpa.ProviderCommon; 10 11 import ndg.services.revitalization.jpa.ProviderEmail; -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/ExecuteHarvest.java
r7360 r7389 3 3 import java.io.Serializable; 4 4 5 import ndg.common.NdgMessage;6 5 import ndg.common.ejb.JMSDispatcherRemote; 7 6 import ndg.common.exception.NdgExecutionException; … … 9 8 import ndg.services.revitalization.MailHelper; 10 9 import ndg.services.revitalization.ejb.interfaces.ModelManagerRemote; 11 import ndg.services.revitalization.exception.NdgHarvestNotExistingException;12 10 import ndg.services.revitalization.harvest.HarvestRequest; 13 import ndg.services.revitalization.harvest. Harvester;11 import ndg.services.revitalization.harvest.ProviderAdapter; 14 12 import ndg.services.revitalization.jpa.HiProcess; 15 13 import ndg.services.schemas.revitalization.DoHarvestRequest; … … 25 23 26 24 @Override 27 protected void execute(DoHarvestRequest request)25 protected void execute(DoHarvestRequest doRequest) 28 26 throws NdgExecutionException { 29 HiProcess process = createHiProcess(request.getProviderID());27 HiProcess hiProcess = createHiProcess(doRequest.getProviderID()); 30 28 ProcessIDType procId = getOf().createProcessIDType(); 31 procId.setId(process.getId()); 29 procId.setId(hiProcess.getId()); 30 32 31 getResponse().setProcessID(procId); 33 32 getResponse().setConfirmation(getOf().createConfirmationType()); 34 35 //DispatchedHarvestRequest requestDispatch = new DispatchedHarvestRequest(request, process); 36 Harvester<? extends HarvestRequest> harvester; 37 try { 38 harvester = getHarvester(request, process); 39 dispatchHarvestRequest(harvester); 40 MailHelper.getInstance().newDispatchedHarvestMail(request, process); 41 } catch (NdgHarvestNotExistingException e) { 42 throw new NdgExecutionException(new NdgMessage("null.object", new Object[]{"Harvest"})); 43 } 33 HarvestRequest harvestRequest = ProviderAdapter.getInstance().getHarvesterRequest(doRequest, hiProcess); 34 dispatchHarvestRequest(harvestRequest); 35 MailHelper.getInstance().newDispatchedHarvestMail(doRequest.getEmailReportID(), hiProcess); 44 36 } 45 37 46 38 private HiProcess createHiProcess(int providerID) throws NdgExecutionException { 47 39 ModelManagerRemote modelManager = EJBBeanFactory.getModelManager(); 48 40 return modelManager.createNewProcess(providerID); 49 }50 51 private Harvester<? extends HarvestRequest> getHarvester(DoHarvestRequest doRequest, HiProcess process) throws NdgHarvestNotExistingException, NdgExecutionException {52 return ProviderAdapter.getInstance().getHarvester(doRequest, process);53 41 } 54 42 -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/executor/IngesterImpl.java
r7319 r7389 1 /* 2 * BSD Licence 3 * Copyright (c) 2009, Science & Technology Facilities Council (STFC) 4 * All rights reserved. 5 6 * See the LICENSE file in the source distribution of this software for 7 * the full license text. 8 * Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 9 * This software may be distributed under the terms of the 10 * Q Public License, version 1.0 or later. 11 * http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 12 */ 1 13 package ndg.services.revitalization.executor; 2 14 … … 9 21 import ndg.common.exception.NdgRunTimeProcessException; 10 22 import ndg.services.revitalization.EJBBeanFactory; 11 import ndg.services.revitalization.InvokeProcess;12 23 import ndg.services.revitalization.MailHelper; 13 24 import ndg.services.revitalization.dictionary.ServiceConfigurationParameter; 25 import ndg.services.revitalization.harvest.IngestRequest; 26 import ndg.services.revitalization.harvest.Ingester; 14 27 import ndg.services.revitalization.jpa.HiProcess; 15 28 16 29 import org.apache.commons.io.FileUtils; 17 30 18 public class DoIngestProcess implements InvokeProcess { 19 /** 20 * 21 */ 31 /** 32 * Exploits an Ingest request. 33 * 34 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 35 */ 36 public class IngesterImpl implements Ingester<IngestRequest> { 37 22 38 private static final long serialVersionUID = 3970390875989465160L; 23 private final int processID;39 private final IngestRequest ingestRequest; 24 40 25 public DoIngestProcess(int processID) {41 public IngesterImpl(IngestRequest request) { 26 42 super(); 27 this. processID = processID;43 this.ingestRequest = request; 28 44 } 45 46 @Override 47 public IngestRequest getIngestRequest() { 48 return ingestRequest; 49 } 50 51 29 52 30 53 private final String errProcMsg = "The process returned an errirID:{0}. \n The standard error stream returned: \n {1}"; … … 37 60 ServiceConfigurationParameter.DO_INGEST_CMD); 38 61 39 hiProcess = EJBBeanFactory.getModelManager().getHiProcess( processID);40 String formattedCmd = MessageFormatter.getFormattedText(cmd, new Object[] { processID});62 hiProcess = EJBBeanFactory.getModelManager().getHiProcess(ingestRequest.getProcessID()); 63 String formattedCmd = MessageFormatter.getFormattedText(cmd, new Object[] {ingestRequest.getProcessID() }); 41 64 manageSystemCall(formattedCmd); 42 65 File harvDir = new File(hiProcess.getHarvestDir()); … … 44 67 MailHelper.getInstance().terminatedIngestMail(hiProcess); 45 68 } catch (IOException e) { 46 MailHelper.getInstance().sentProcessFailedMail(hiProcess, formatError( processID, e.getMessage()));69 MailHelper.getInstance().sentProcessFailedMail(hiProcess, formatError(ingestRequest.getProcessID(), e.getMessage())); 47 70 } catch (NdgRunTimeProcessException e) { 48 MailHelper.getInstance().sentProcessFailedMail(hiProcess, formatError( processID, e.getMessage()));71 MailHelper.getInstance().sentProcessFailedMail(hiProcess, formatError(ingestRequest.getProcessID(), e.getMessage())); 49 72 } 50 73 } … … 56 79 exitVal = proc.waitFor(); 57 80 if (exitVal > 0) { 58 StreamReader stout = new StreamReader(proc.getInputStream());81 //StreamReader stout = new StreamReader(proc.getInputStream()); 59 82 StreamReader sterr = new StreamReader(proc.getErrorStream()); 60 83 throw new NdgRunTimeProcessException(MessageFormatter.getFormattedText(errProcMsg, new Object[]{1, sterr.extractStreamValue()})); -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/harvest/HarvestRequest.java
r7360 r7389 14 14 15 15 import java.io.Serializable; 16 import java.util.List; 17 18 import ndg.services.revitalization.jpa.HiProcess; 16 19 17 20 … … 29 32 */ 30 33 private static final long serialVersionUID = 4539301981210054562L; 31 /** The provider identificator */ 32 final private int providerID; 33 /** The provider URL */ 34 final private String url; 34 final private HiProcess process; 35 35 36 public HarvestRequest(int providerID, String url) { 36 final private List<Integer> emailID; 37 38 39 public HarvestRequest(HiProcess process, List<Integer> emailID) { 37 40 super(); 38 this.pro viderID = providerID;39 this. url = url;41 this.process = process; 42 this.emailID = emailID; 40 43 } 41 44 42 /** 43 * Returns the id that the application associates to this provider. Usually this id 44 * is supported by a DB providing the necessary persistence system. 45 * @return the provider id 46 **/ 47 public int getProviderID() { 48 return providerID; 45 public List<Integer> getEmailID() { 46 return emailID; 47 } 48 49 public HiProcess getProcess() { 50 return process; 49 51 } 50 52 51 /** 52 * Returns the URL that the application associates to this provider. Usually this URL 53 * is part of a more general configuration parameters, stored in a DB providing the necessary persistence system. 54 * @return the provider address 55 **/ 56 public String getUrl() { 57 return url; 58 } 53 59 54 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/harvest/HarvesterBase.java
r7360 r7389 13 13 package ndg.services.revitalization.harvest; 14 14 15 import java.io.File; 15 16 import java.io.Serializable; 16 17 import java.sql.Timestamp; 17 18 import java.util.ArrayList; 19 import java.util.Calendar; 18 20 import java.util.List; 19 21 … … 60 62 @Override 61 63 public final void invoke() throws NdgExecutionException { 62 initializeHarvesting(); 63 doHarvest(); 64 finalizeHarvesting(); 64 HarvestLog harvestLog = null; 65 initializeHarvesting(); 66 try { 67 doHarvest(); 68 } finally { 69 harvestLog = finalizeHarvesting(); 70 } 71 EJBBeanFactory.getModelManager().updateHarvestingLogAndStatus(hiProcess, harvestLog); 72 MailHelper.getInstance().terminatedHarvestMail(getHiProcess()); 65 73 } 66 74 … … 72 80 HarvestLog harvestLog = new HarvestLog(); 73 81 harvestLog.setReqId(hiProcess.getId()); 82 harvestLog.setStartHarvest(new Timestamp(Calendar.getInstance().getTimeInMillis())); 83 getHarvestResult().setStartTime(harvestLog.getStartHarvest()); 74 84 EJBBeanFactory.getModelManager().updateHarvestingLogAndStatus(hiProcess, harvestLog); 75 85 } 76 86 77 private voidfinalizeHarvesting() throws NdgExecutionException {87 private HarvestLog finalizeHarvesting() throws NdgExecutionException { 78 88 List<Integer> procId = new ArrayList<Integer>(); 79 89 procId.add(hiProcess.getId()); … … 86 96 87 97 harvestLog = harvestLogs.get(0); 88 harvestLog.setStartHarvest(getHarvestResult().getStartTime());89 harvestLog.setStopHarvest(getHarvestResult().getEndTime());90 harvestLog.setTotRecs(getHarvestResult().getTotRecs());91 98 92 EJBBeanFactory.getModelManager().updateHarvestingLogAndStatus(hiProcess, harvestLog); 99 harvestLog.setStopHarvest(new Timestamp(Calendar.getInstance().getTimeInMillis())); 100 getHarvestResult().setEndTime(harvestLog.getStopHarvest()); 93 101 94 MailHelper.getInstance().terminatedHarvestMail(getHiProcess()); 102 harvestLog.setTotRecs(getHowManyHarvestedFiles()); 103 getHarvestResult().setTotRecs(harvestLog.getTotRecs()); 104 return harvestLog; 95 105 } 96 106 … … 99 109 } 100 110 111 protected int getHowManyHarvestedFiles() { 112 File outDir = new File(getHiProcess().getHarvestDir()); 113 if (outDir.isDirectory()) { 114 String numfiles[] = outDir.list(); 115 if (numfiles != null) 116 return numfiles.length; 117 } 118 return 0; 119 } 120 101 121 protected class HarvestResult implements Serializable { 102 122 /** -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/harvest/ProviderAdapter.java
r7316 r7389 1 package ndg.services.revitalization.executor; 1 /* 2 * BSD Licence 3 * Copyright (c) 2009, Science & Technology Facilities Council (STFC) 4 * All rights reserved. 5 6 * See the LICENSE file in the source distribution of this software for 7 * the full license text. 8 * Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 9 * This software may be distributed under the terms of the 10 * Q Public License, version 1.0 or later. 11 * http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 12 */ 13 package ndg.services.revitalization.harvest; 2 14 3 15 import java.io.File; … … 11 23 import ndg.services.revitalization.dictionary.ServiceConfigurationParameter; 12 24 import ndg.services.revitalization.ejb.interfaces.ModelManagerRemote; 13 import ndg.services.revitalization.harvest.HarvestRequest;14 import ndg.services.revitalization.harvest.Harvester;15 25 import ndg.services.revitalization.jpa.HiProcess; 16 26 import ndg.services.revitalization.jpa.ProviderCommon; … … 26 36 * specific {@link ProviderCommon} 27 37 **/ 28 class ProviderAdapter<T extends HarvestRequest> {38 public class ProviderAdapter<T extends HarvestRequest> { 29 39 30 40 private ProviderAdapter() { … … 40 50 } 41 51 42 public Harvester<T> getHarvester(DoHarvestRequest doRequest, HiProcess hiProcess) throws NdgExecutionException { 43 if (doRequest == null) 44 throw new NdgExecutionException(new NdgMessage("null.object", new Object[] { "DoHarvestRequest" })); 45 52 public Harvester<T> getHarvester(HarvestRequest request) throws NdgExecutionException { 46 53 ModelManagerRemote mm = EJBBeanFactory.getModelManager(); 47 ProviderCommon provider = mm.getHarvesterConfiguration( doRequest.getProviderID());54 ProviderCommon provider = mm.getHarvesterConfiguration(request.getProcess().getProviderId()); 48 55 49 56 File tmpDir = new File(mm.getConfigurationParameter(ServiceConfigurationParameter.HARVEST_ROOT_PATH) … … 52 59 throw new NdgExecutionException(new NdgMessage("execution.error", new Object[] { "createNewFile()", 53 60 "Cannot create " + tmpDir.getAbsolutePath() }, null)); 54 55 return getHelper(provider.getClass()).assembleHarvester(provider, tmpDir, doRequest, hiProcess);61 request.getProcess().setHarvestDir(tmpDir.getAbsolutePath()); 62 return getHelper(provider.getClass()).assembleHarvester(provider, request); 56 63 } 57 64 65 public HarvestRequest getHarvesterRequest(DoHarvestRequest doRequest, HiProcess hiProcess) throws NdgExecutionException { 66 if (doRequest == null) 67 throw new NdgExecutionException(new NdgMessage("null.object", new Object[] { "DoHarvestRequest" })); 68 69 ModelManagerRemote mm = EJBBeanFactory.getModelManager(); 70 ProviderCommon provider = mm.getHarvesterConfiguration(doRequest.getProviderID()); 71 return new HarvestRequest(hiProcess, doRequest.getEmailReportID()); 72 } 73 58 74 /** 59 75 * Transforms the data from the <code>pdetails</code> parameter in a … … 73 89 74 90 private ProviderAdapterHelper getHelper(Class<?> clazz) throws NdgExecutionException { 75 return ProviderAdapter Helper.getProviderAdapter(clazz);91 return ProviderAdapterFactory.getProviderAdapterHelper(clazz); 76 92 } 77 93 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/harvest/ProviderAdapterFactory.java
r7312 r7389 1 package ndg.services.revitalization.executor; 2 3 import java.io.File; 4 5 import javax.xml.bind.JAXBElement; 1 package ndg.services.revitalization.harvest; 6 2 7 3 import ndg.common.exception.NdgExecutionException; 8 import ndg.services.revitalization.harvest.HarvestRequest; 9 import ndg.services.revitalization.harvest.Harvester; 4 import ndg.services.revitalization.harvest.csw.CSWAdapterHelper; 10 5 import ndg.services.revitalization.harvest.oai.OAIAdapterHelper; 11 import ndg.services.revitalization.jpa. HiProcess;6 import ndg.services.revitalization.jpa.CswProvider; 12 7 import ndg.services.revitalization.jpa.OaiProvider; 13 8 import ndg.services.revitalization.jpa.ProviderCommon; 14 import ndg.services.schemas.revitalization. DoHarvestRequest;9 import ndg.services.schemas.revitalization.CSWProviderDetailsType; 15 10 import ndg.services.schemas.revitalization.OAIProviderDetailsType; 16 import ndg.services.schemas.revitalization.ObjectFactory;17 11 import ndg.services.schemas.revitalization.ProviderDetailsType; 18 12 … … 23 17 * specific {@link ProviderCommon} 24 18 **/ 25 public abstract class ProviderAdapterHelper<T extends ProviderCommon, Y extends ProviderDetailsType>{19 public class ProviderAdapterFactory { 26 20 27 public static ProviderAdapterHelper getProviderAdapter(Class<?> clazz) throws NdgExecutionException { 21 public static ProviderAdapterHelper 22 getProviderAdapterHelper(Class<?> clazz) throws NdgExecutionException { 28 23 if (clazz.isAssignableFrom(OaiProvider.class) || clazz.isAssignableFrom(OAIProviderDetailsType.class)) { 29 24 return new OAIAdapterHelper(); 25 } 26 if (clazz.isAssignableFrom(CswProvider.class) || clazz.isAssignableFrom(CSWProviderDetailsType.class)) { 27 return new CSWAdapterHelper(); 30 28 } 31 29 32 30 throw new NdgExecutionException("Provider type does not exists"); 33 31 } 34 35 /* Specific implementation methods */36 37 abstract protected Harvester<? extends HarvestRequest> assembleHarvester(T provider, File tmpDir,38 DoHarvestRequest doRequest, HiProcess hiProcess) throws NdgExecutionException;39 40 abstract protected JAXBElement<? extends ProviderDetailsType> extractDetails(T oai, ObjectFactory of);41 42 /**43 * Fills the fields specific to a <code>T</code> class extending the44 * {@link ProviderCommon} class.45 *46 * @param providerDetails47 * a class extending the {@link ProviderDetailsType} class48 * @return a filled <code>T</code> instance49 **/50 abstract protected T assembleProvider(Y providerDetails);51 32 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/harvest/oai/OAIAdapterHelper.java
r7312 r7389 1 1 package ndg.services.revitalization.harvest.oai; 2 3 import java.io.File;4 2 5 3 import javax.xml.bind.JAXBElement; 6 4 7 5 import ndg.common.exception.NdgExecutionException; 8 import ndg.services.revitalization.executor.ProviderAdapterHelper;9 6 import ndg.services.revitalization.harvest.HarvestRequest; 10 import ndg.services.revitalization.harvest.Harvester; 11 import ndg.services.revitalization.jpa.HiProcess; 7 import ndg.services.revitalization.harvest.ProviderAdapterHelper; 12 8 import ndg.services.revitalization.jpa.OaiProvider; 13 import ndg.services. schemas.revitalization.DoHarvestRequest;9 import ndg.services.revitalization.jpa.ProviderCommon; 14 10 import ndg.services.schemas.revitalization.OAIProviderDetailsType; 15 11 import ndg.services.schemas.revitalization.ObjectFactory; 16 import ndg.services.schemas.revitalization.ProviderDetailsType;17 12 18 public class OAIAdapterHelper extends ProviderAdapterHelper<OaiProvider, OAIProviderDetailsType>{ 19 13 public class OAIAdapterHelper 14 implements ProviderAdapterHelper<OaiProvider, OAIProviderDetailsType, OAIHarvester>{ 15 20 16 @Override 21 protected Harvester<? extends HarvestRequest> assembleHarvester(OaiProvider provider, File tmpDir, 22 DoHarvestRequest doRequest, HiProcess hiProcess) throws NdgExecutionException { 23 OAIHarvestRequest harvesterReq = new OAIHarvestRequest(provider, doRequest); 24 harvesterReq.setOutdir(tmpDir.getAbsolutePath()); 25 return new OAIHarvester(harvesterReq, hiProcess); 17 public OAIHarvester assembleHarvester(ProviderCommon provider, HarvestRequest request) 18 throws NdgExecutionException { 19 OAIHarvestRequest harvesterReq = new OAIHarvestRequest(request, (OaiProvider)provider); 20 return new OAIHarvester(harvesterReq, request.getProcess()); 26 21 } 27 22 28 23 @Override 29 p rotectedOaiProvider assembleProvider(OAIProviderDetailsType providerDetails) {24 public OaiProvider assembleProvider(OAIProviderDetailsType providerDetails) { 30 25 OaiProvider nprovider = new OaiProvider(); 31 //If is an update retrieve the stored Provider32 //This part has to be generalized for all other provider types33 /*34 if (id != null) {35 ProviderCommon provider = EJBBeanFactory.getModelManager().getProviderCommon(id);36 if (!provider.getClass().isAssignableFrom(OaiProvider.class))37 throw new NdgExecutionException("Provide ID:" + id + " type does differ from the type stored one");38 nprovider = (OaiProvider)provider;39 }40 */41 42 26 nprovider.setFormat(providerDetails.getFormat()); 43 27 nprovider.setSet(providerDetails.getSetSpec()); … … 47 31 48 32 @Override 49 p rotected JAXBElement<? extendsProviderDetailsType> extractDetails(OaiProvider oai, ObjectFactory of) {33 public JAXBElement<OAIProviderDetailsType> extractDetails(OaiProvider oai, ObjectFactory of) { 50 34 OAIProviderDetailsType pdt = of.createOAIProviderDetailsType(); 51 35 pdt.setFormat(oai.getFormat()); -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/harvest/oai/OAIHarvestRequest.java
r7312 r7389 1 /* 2 * BSD Licence 3 * Copyright (c) 2009, Science & Technology Facilities Council (STFC) 4 * All rights reserved. 5 6 * See the LICENSE file in the source distribution of this software for 7 * the full license text. 8 * Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 9 * This software may be distributed under the terms of the 10 * Q Public License, version 1.0 or later. 11 * http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 12 */ 1 13 package ndg.services.revitalization.harvest.oai; 2 14 … … 5 17 import ndg.services.revitalization.harvest.HarvestRequest; 6 18 import ndg.services.revitalization.jpa.OaiProvider; 7 import ndg.services.schemas.revitalization.DoHarvestRequest;8 19 9 20 /** 10 * Represents an Harvest request 21 * Represents an Harvest request to an OAI provider 22 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 11 23 **/ 12 24 public class OAIHarvestRequest extends HarvestRequest { 13 25 14 public OAIHarvestRequest(OaiProvider provider, DoHarvestRequest doRequest) { 15 super(provider.getId(), provider.getBaseUrl()); 26 /** 27 * 28 */ 29 private static final long serialVersionUID = -7918884716907517029L; 30 31 public OAIHarvestRequest(HarvestRequest request, OaiProvider provider) { 32 super(request.getProcess(), request.getEmailID()); 33 url = provider.getBaseUrl(); 16 34 this.setSet(provider.getSet()); 17 35 if (!provider.getFormat().equals("ANY")) … … 27 45 */ 28 46 47 private String url; 48 29 49 /** MetadataPrefix. e.g., "oai_dc", or null to harvest all formats */ 30 50 private String metadataPrefix; … … 39 59 private Date until; 40 60 41 /** Path of output dir */42 private String outdir;43 44 45 61 private boolean splitBySet; 46 62 private String zipName; … … 54 70 private boolean harvestAllIfNoDeletedRecord; 55 71 72 public String getUrl() { 73 return url; 74 } 75 56 76 public String getMetadataPrefix() { 57 77 return metadataPrefix; … … 79 99 } 80 100 81 public String getOutdir() {82 return outdir;83 }84 public void setOutdir(String outdir) {85 this.outdir = outdir;86 }87 101 public boolean isSplitBySet() { 88 102 return splitBySet; -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/harvest/oai/OAIHarvester.java
r7312 r7389 1 /* 2 * BSD Licence 3 * Copyright (c) 2009, Science & Technology Facilities Council (STFC) 4 * All rights reserved. 5 6 * See the LICENSE file in the source distribution of this software for 7 * the full license text. 8 * Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 9 * This software may be distributed under the terms of the 10 * Q Public License, version 1.0 or later. 11 * http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 12 */ 1 13 package ndg.services.revitalization.harvest.oai; 2 3 import java.io.File;4 import java.sql.Timestamp;5 14 6 15 import ndg.common.NdgMessage; … … 12 21 import org.dlese.dpc.oai.harvester.OAIErrorException; 13 22 14 23 /** 24 * Represents an OAI able harvester. 25 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 26 */ 15 27 public class OAIHarvester extends HarvesterBase<OAIHarvestRequest> { 16 28 … … 35 47 protected void doHarvest() throws NdgExecutionException { 36 48 org.dlese.dpc.oai.harvester.Harvester harvester = new org.dlese.dpc.oai.harvester.Harvester(); 37 getHiProcess().setHarvestDir(getHarvestRequest().getOutdir());38 49 try { 39 50 harvester.doHarvest(getHarvestRequest().getUrl(), … … 42 53 getHarvestRequest().getFrom(), 43 54 getHarvestRequest().getUntil(), 44 getH arvestRequest().getOutdir(),55 getHiProcess().getHarvestDir(), 45 56 getHarvestRequest().isSplitBySet(), 46 57 getHarvestRequest().getZipName(), … … 48 59 getHarvestRequest().isWriteHeaders(), 49 60 getHarvestRequest().isHarvestAll(), 50 getHarvestRequest().isHarvestAllIfNoDeletedRecord()); 51 getHarvestResult().setStartTime(new Timestamp(harvester.getStartTime())); 52 getHarvestResult().setEndTime(new Timestamp(harvester.getEndTime())); 53 54 //getHarvestResult().setTotRecs(harvester.getNumRecordsHarvested()); 55 getHarvestResult().setTotRecs(getHowManyHarvestedFiles()); 61 getHarvestRequest().isHarvestAllIfNoDeletedRecord()); 56 62 } catch (Hexception e) { 57 63 throw new NdgExecutionException(new NdgMessage("execution.error", new Object[] {"doHarvest", e.getMessage()}, null)); … … 60 66 } 61 67 } 62 63 /*64 * This methods substitute the more direct harvester.getNumRecordsHarvested()65 * because such method may returns the wrong number of files in case of resumption66 * operation. Hopefully in a future release of the DLESE's Harvest library this "fix" could be removed.67 * */68 private int getHowManyHarvestedFiles(){69 File outDir = new File(getHarvestRequest().getOutdir());70 if (outDir.isDirectory()) {71 String numfiles[] = outDir.list();72 if (numfiles != null)73 return numfiles.length;74 }75 return 0;76 }77 68 } 78 69 -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/jpa/CswProvider.java
r7301 r7389 1 /* 2 * BSD Licence 3 * Copyright (c) 2009, Science & Technology Facilities Council (STFC) 4 * All rights reserved. 5 6 * See the LICENSE file in the source distribution of this software for 7 * the full license text. 8 * Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). 9 * This software may be distributed under the terms of the 10 * Q Public License, version 1.0 or later. 11 * http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt 12 */ 1 13 package ndg.services.revitalization.jpa; 2 14 15 import java.util.List; 16 17 import javax.persistence.Column; 3 18 import javax.persistence.Entity; 4 19 import javax.persistence.PrimaryKeyJoinColumn; 5 20 import javax.persistence.Table; 21 import javax.xml.namespace.QName; 22 23 import org.hibernate.annotations.Type; 6 24 7 25 8 26 /** 9 27 * The persistent class for the csw_provider database table. 10 * 28 * @author Maurizio Nagni <maurizio.nagni@stfc.ac.uk> 11 29 */ 12 30 @Entity … … 20 38 private static final long serialVersionUID = -8551777635863224854L; 21 39 40 private List<QName> typeNames; 41 42 private String outputSchema; 43 22 44 public CswProvider() { 23 45 } 46 47 @Type(type = "ndg.services.revitalization.jpa.usertype.QNames") 48 @Column(name="type_names") 49 public List<QName> getTypeNames() { 50 return typeNames; 51 } 52 53 public void setTypeNames(List<QName> typeNames) { 54 this.typeNames = typeNames; 55 } 56 57 @Column(name="output_schema") 58 public String getOutputSchema() { 59 return outputSchema; 60 } 61 62 public void setOutputSchema(String outputSchema) { 63 this.outputSchema = outputSchema; 64 } 24 65 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/jpa/IngestLoggingProblemFile.java
r7312 r7389 14 14 private static final long serialVersionUID = 1L; 15 15 private Integer problemFileId; 16 private Stringid;16 private Integer id; 17 17 private String problemFileMessage; 18 18 private String problemFileName; … … 33 33 34 34 35 public StringgetId() {35 public Integer getId() { 36 36 return this.id; 37 37 } 38 38 39 public void setId( Stringid) {39 public void setId(Integer id) { 40 40 this.id = id; 41 41 } -
RevitalizationWS/ws/DPWS/trunk/src/main/java/ndg/services/revitalization/jpa/IngestSearchLogging.java
r7312 r7389 15 15 private static final long serialVersionUID = 1L; 16 16 private Integer localIngestId; 17 private Stringid;17 private Integer id; 18 18 private Timestamp ingestDate; 19 19 private Integer numberProblemFiles; … … 41 41 42 42 43 public StringgetId() {43 public Integer getId() { 44 44 return this.id; 45 45 } 46 46 47 public void setId( Stringid) {47 public void setId(Integer id) { 48 48 this.id = id; 49 49 }
Note: See TracChangeset
for help on using the changeset viewer.