diff --git a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailDataManager.java b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailDataManager.java index 86223c97de4b1476fdeb9538102c0dbae79e0712..afce37a6324bfa1212fe06054dd8fa4e39523d3b 100644 --- a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailDataManager.java +++ b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailDataManager.java @@ -28,7 +28,6 @@ import ch.systemsx.cisd.common.mail.EMailAddress; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; /** * Manager that groups data about tracked entities into {@link EntityTrackingEmailData} objects. @@ -43,8 +42,6 @@ class EntityTrackingEmailDataManager private final static String PRINCIPAL_INVESTIGATOR_EMAIL = "PRINCIPAL_INVESTIGATOR_EMAIL"; - private final static String MASTER_SAMPLE_TYPE = "MASTER_SAMPLE"; - private static Map<String, String> recipientsByAffiliation; public static void initialize(final Map<String, String> recipients) @@ -125,7 +122,8 @@ class EntityTrackingEmailDataManager } /** - * Returns a set of emails of recipients that should get a tracking information about given <var>sequencingSample</var>.<br> + * Returns a set of emails of recipients that should get a tracking information about given + * <var>sequencingSample</var>.<br> */ // NOTE: Set is needed because one recipient can occur in many roles for one sample private static Set<EMailAddress> getSequencingSampleTrackingRecipients( @@ -140,91 +138,58 @@ class EntityTrackingEmailDataManager recipientPropertyTypeCodes.add(CONTACT_PERSON_EMAIL); recipientPropertyTypeCodes.add(PRINCIPAL_INVESTIGATOR_EMAIL); - SampleType masterSampleType = new SampleType(); - masterSampleType.setCode(MASTER_SAMPLE_TYPE); - for (Sample sequencingSample : sequencingSamples) { - - findMasterSample(sequencingSample, recipients); - - } - return recipients; - } - - private static void findMasterSample(Sample s, Set<EMailAddress> recipients) - { - SampleType masterSampleType = new SampleType(); - masterSampleType.setCode(MASTER_SAMPLE_TYPE); - // Recipients are taken from properties of the sequencing sample. - final Set<String> recipientPropertyTypeCodes = new HashSet<String>(); - recipientPropertyTypeCodes.add(CONTACT_PERSON_EMAIL); - recipientPropertyTypeCodes.add(PRINCIPAL_INVESTIGATOR_EMAIL); - - SampleType seqSampleSampleType = s.getSampleType(); - if (seqSampleSampleType.equals(masterSampleType)) - { - Set<EMailAddress> r = extractProperties(recipientPropertyTypeCodes, s); - recipients.addAll(r); - } - else - { - for (Sample parent : s.getParents()) - { - findMasterSample(parent, recipients); - - } - } - - } - - private static Set<EMailAddress> extractProperties(final Set<String> recipientPropertyTypeCodes, Sample sequencingSample) - { - Set<EMailAddress> recipients = new HashSet<EMailAddress>(); - for (IEntityProperty property : sequencingSample.getProperties()) - { - final String propertyCode = property.getPropertyType().getCode(); - EMailAddress propertyValue = new EMailAddress(property.tryGetAsString()); - if (recipientPropertyTypeCodes.contains(propertyCode)) + for (IEntityProperty property : sequencingSample.getProperties()) { - recipients.add(propertyValue); - } else - { - // add recipient for affiliation if his email was specified in properties - if (propertyCode.equals(AFFILIATION)) + final String propertyCode = property.getPropertyType().getCode(); + final String propertyValue = property.tryGetAsString(); + if (recipientPropertyTypeCodes.contains(propertyCode)) + { + EMailAddress myEmail = new EMailAddress(propertyValue); + recipients.add(myEmail); + } else { - EMailAddress affiliationRecipientOrNull = new EMailAddress( - recipientsByAffiliation.get(propertyValue)); - if (affiliationRecipientOrNull != null) + // add recipient for affiliation if his email was specified in properties + if (propertyCode.equals(AFFILIATION)) { - recipients.add(affiliationRecipientOrNull); + String affiliationRecipientOrNull = + recipientsByAffiliation.get(propertyValue); + if (affiliationRecipientOrNull != null) + { + EMailAddress myEmail = new EMailAddress(affiliationRecipientOrNull); + recipients.add(myEmail); + } } } } } + return recipients; } /** - * Returns a set of emails of recipients that should get a tracking information about given <var>flowLaneSample</var>. + * Returns a set of emails of recipients that should get a tracking information about given + * <var>flowLaneSample</var>. */ - private static Set<EMailAddress> getSampleTrackingRecipients(Sample sample) + private static Set<EMailAddress> getFlowLaneSampleTrackingRecipients(Sample flowLaneSample) { - // Recipients are taken from properties of master sample - // that is a parent/grandparent of a library/raw sample - assert sample != null; - return getSequencingSampleTrackingRecipients(sample.getParents()); + // Recipients are taken from properties of sequencing sample + // that is a parent of the flow lane sample. + assert flowLaneSample != null; + return getSequencingSampleTrackingRecipients(flowLaneSample.getParents()); } /** - * Returns a set of emails of recipients that should get a tracking information about given <var>dataSet</var>. + * Returns a set of emails of recipients that should get a tracking information about given + * <var>dataSet</var>. */ private static Set<EMailAddress> getDataSetTrackingRecipients(AbstractExternalData dataSet) { - // Recipients are taken from properties of master sample - // that is a parent/grandparent of a library/raw sample connected with the data set. + // Recipients are taken from properties of sequencing sample + // that is a parent of a flow lane sample connected directly with the data set. assert dataSet != null; - return getSampleTrackingRecipients(dataSet.getSample()); + return getFlowLaneSampleTrackingRecipients(dataSet.getSample()); } } \ No newline at end of file diff --git a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailGenerator.java b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailGenerator.java index 35a8e19d03c3b270c413e3386f8c72bb0fc2684b..e0cf1d25a0320fd51480b81cb46596e774817f83 100644 --- a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailGenerator.java +++ b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/email/EntityTrackingEmailGenerator.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; -import java.util.Set; import java.util.TreeMap; import ch.ethz.bsse.cisd.dsu.tracking.dto.TrackedEntities; @@ -176,11 +175,11 @@ public class EntityTrackingEmailGenerator implements IEntityTrackingEmailGenerat private static final String PERMLINK_LABEL = "See details in openBIS"; - private static final String GENERATED_CONTENT_TARGET = "{generated-content}"; + private static final String GENARATED_CONTENT_TARGET = "{generated-content}"; public static String fillTemplateWithData(String template, EntityTrackingEmailData emailData) { - return template.replace(GENERATED_CONTENT_TARGET, generateContent(emailData)); + return template.replace(GENARATED_CONTENT_TARGET, generateContent(emailData)); } private static String generateContent(EntityTrackingEmailData emailData) @@ -192,33 +191,12 @@ public class EntityTrackingEmailGenerator implements IEntityTrackingEmailGenerat return sb.toString(); } - private static String getName(Sample sequencingSample) - { - /** - * We try to get the external sample name recursively in the sample tree. This means we take the first name in the tree. This results in - * the following precedence: LIBARY -> RAW - */ - - String externalSampleName = getExternalSampleName(sequencingSample); - if (externalSampleName == null || externalSampleName.isEmpty()) - { - Set<Sample> parents = sequencingSample.getParents(); - for (Sample parent : parents) - { - externalSampleName = getName(parent); - } - } - - return externalSampleName; - - } - private static void appendSequencingSamplesData(StringBuilder sb, Collection<Sample> sequencingSamples, boolean processed) { for (Sample sequencingSample : sequencingSamples) { - String externalSampleName = getName(sequencingSample); + final String externalSampleName = getExternalSampleName(sequencingSample); appendln(sb, SECTION_SEPARATOR_LINE); appendln(sb, SUBSECTION_SEPARATOR_LINE); @@ -263,19 +241,18 @@ public class EntityTrackingEmailGenerator implements IEntityTrackingEmailGenerat appendln(sb, SUBSECTION_SEPARATOR_LINE); appendln(sb, "There are new sequencing results available to you."); appendln(sb, SUBSECTION_SEPARATOR_LINE); - + // Using a TreeMap, so the keys are sorted TreeMap<String, List<AbstractExternalData>> sampleMap = new TreeMap<String, List<AbstractExternalData>>(); - List<AbstractExternalData> dsList = new ArrayList<AbstractExternalData>(); - + List <AbstractExternalData> dsList = new ArrayList<AbstractExternalData>(); + // we just loop over the data sets and write the connected samples as keys - // and the data sets as values in a map, so that we can group together as + // and the data sets as values in a map, so that we can group together as // data sets per lane for (AbstractExternalData dataSet : dataSets) { Sample s = dataSet.getSample(); - if (sampleMap.containsKey(s.getIdentifier())) - { + if (sampleMap.containsKey(s.getIdentifier())) { dsList = sampleMap.get(s.getIdentifier()); } dsList.add(dataSet); @@ -285,13 +262,11 @@ public class EntityTrackingEmailGenerator implements IEntityTrackingEmailGenerat // now we can write out this per sample Iterator<Entry<String, List<AbstractExternalData>>> it = sampleMap.entrySet().iterator(); - while (it.hasNext()) - { - Map.Entry pairs = (Map.Entry) it.next(); + while (it.hasNext()) { + Map.Entry pairs = (Map.Entry)it.next(); appendln(sb, String.format("Results for %s", pairs.getKey())); dsList = (List<AbstractExternalData>) pairs.getValue(); - for (AbstractExternalData ed : dsList) - { + for (AbstractExternalData ed : dsList) { appendDataSetDetails(sb, ed); } it.remove(); // avoids a ConcurrentModificationException @@ -307,18 +282,16 @@ public class EntityTrackingEmailGenerator implements IEntityTrackingEmailGenerat assert flowLaneSample != null; sequencingSamples = flowLaneSample.getParents(); assert sequencingSamples != null; - + String Index1 = getIndex1(dataSet); String Index2 = getIndex2(dataSet); String externalSampleName = externalSampleNameFromDataSet(dataSet); String Index = null; - if (Index1 != null) - { + if (Index1 != null) { Index = Index1; } - if (Index2 != null) - { + if (Index2 != null) { Index = Index + "-" + Index2; } @@ -327,8 +300,7 @@ public class EntityTrackingEmailGenerator implements IEntityTrackingEmailGenerat appendln(sb, "Data Set Type: " + dataSet.getDataSetType().toString() + " Index: " + Index + ", External Sample Name: " + externalSampleName); } - else - { + else { appendln(sb, "Data Set Type: " + dataSet.getDataSetType().toString()); } appendln(sb, dataSet.getPermlink()); @@ -338,45 +310,33 @@ public class EntityTrackingEmailGenerator implements IEntityTrackingEmailGenerat { String externalSampleName = tryGetSamplePropertyValue(sequencingSample, EXTERNAL_SAMPLE_NAME_PROPERTY_CODE); - // assert externalSampleName != null; - if (externalSampleName == null) - { - externalSampleName = ""; - } + assert externalSampleName != null; return externalSampleName; } - - private static String getIndex1(AbstractExternalData dataSet) - { + + private static String getIndex1(AbstractExternalData dataSet) { List<IEntityProperty> properties = dataSet.getProperties(); - - String Index = null; - for (IEntityProperty p : properties) - { - if (p.getPropertyType().getCode().equals(INDEX1_PROPERTY_CODE)) - { + + String Index = null; + for (IEntityProperty p : properties) { + if (p.getPropertyType().getCode().equals(INDEX1_PROPERTY_CODE)) { Index = p.getVocabularyTerm().getCode(); - if (!Index.equals("NOINDEX")) - { + if (! Index.equals("NOINDEX")) { return Index; } } } return null; } - - private static String getIndex2(AbstractExternalData dataSet) - { + + private static String getIndex2(AbstractExternalData dataSet) { List<IEntityProperty> properties = dataSet.getProperties(); - - String Index = null; - for (IEntityProperty p : properties) - { - if (p.getPropertyType().getCode().equals(INDEX2_PROPERTY_CODE)) - { + + String Index = null; + for (IEntityProperty p : properties) { + if (p.getPropertyType().getCode().equals(INDEX2_PROPERTY_CODE)) { Index = p.getVocabularyTerm().getCode(); - if (!Index.equals("NOINDEX")) - { + if (! Index.equals("NOINDEX")) { return Index; } } diff --git a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingBO.java b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingBO.java index 36b121623cf42207b03b374ccae996574b5fbcff..0305f8bba570bdbc6eddb69fa708da225237f38d 100644 --- a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingBO.java +++ b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingBO.java @@ -21,7 +21,6 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.TreeSet; @@ -35,19 +34,9 @@ import ch.systemsx.cisd.common.collection.CollectionUtils; import ch.systemsx.cisd.common.mail.EMailAddress; import ch.systemsx.cisd.common.mail.IMailClient; import ch.systemsx.cisd.openbis.generic.shared.ITrackingServer; -import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; -import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SampleFetchOption; -import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria; -import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClause; -import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.MatchClauseAttribute; -import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.SearchCriteria.SearchOperator; import ch.systemsx.cisd.openbis.generic.shared.basic.IIdAndCodeHolder; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.AbstractExternalData; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.EntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.IEntityProperty; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.PropertyType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Sample; -import ch.systemsx.cisd.openbis.generic.shared.basic.dto.SampleType; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TrackingDataSetCriteria; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.TrackingSampleCriteria; import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; @@ -61,38 +50,27 @@ public class TrackingBO private static final String EXTERNAL_SAMPLE_NAME = "EXTERNAL_SAMPLE_NAME"; - private static final String LIBRARY_SAMPLE_TYPE = "LIBRARY"; + private static final String SEQUENCING_SAMPLE_TYPE = "ILLUMINA_SEQUENCING"; - private static final String RAW_SAMPLE_TYPE = "RAW_SAMPLE"; + private static final String FLOW_LANE_SAMPLE_TYPE = "ILLUMINA_FLOW_LANE"; - private static final String DATASET_ATTACHED_TO_SAMPLE_TYPE = "LIBRARY"; - - private static final String PROCESSING_POSSIBLE_PROPERTY_CODE = "LIBRARY_PROCESSING_POSSIBLE_YES_NO"; + private static final String PROCESSING_POSSIBLE_PROPERTY_CODE = "LIBRARY_PROCESSING_POSSIBLE"; private static final String PROCESSING_SUCCESSFUL_PROPERTY_CODE = "LIBRARY_PROCESSING_SUCCESSFUL"; - private final static String CONTACT_PERSON_EMAIL = "CONTACT_PERSON_EMAIL"; - - private final static String PRINCIPAL_INVESTIGATOR_EMAIL = "PRINCIPAL_INVESTIGATOR_EMAIL"; - private static final String TRUE = "true"; - private static final String YES = "YES"; - private final ITrackingServer trackingServer; - private final IGeneralInformationService gis; - private final IEntityTrackingEmailGenerator emailGenerator; private final IMailClient mailClient; - public TrackingBO(ITrackingServer trackingServer, IGeneralInformationService gis, IEntityTrackingEmailGenerator emailGenerator, + public TrackingBO(ITrackingServer trackingServer, IEntityTrackingEmailGenerator emailGenerator, IMailClient mailClient) { this.trackingServer = trackingServer; - this.gis = gis; this.emailGenerator = emailGenerator; this.mailClient = mailClient; } @@ -102,7 +80,7 @@ public class TrackingBO TrackingStateDTO prevTrackingState = trackingDAO.getTrackingState(); TrackedEntities changedEntities = - fetchChangedEntities(prevTrackingState, trackingServer, gis, session); + fetchChangedEntities(prevTrackingState, trackingServer, session); List<EmailWithSummary> emailsWithSummary = emailGenerator.generateEmails(changedEntities); sendEmails(emailsWithSummary, mailClient); saveTrackingState(prevTrackingState, changedEntities, trackingDAO); @@ -197,18 +175,17 @@ public class TrackingBO } private static TrackedEntities fetchChangedEntities(TrackingStateDTO trackingState, - ITrackingServer trackingServer, IGeneralInformationService gis, SessionContextDTO session) + ITrackingServer trackingServer, SessionContextDTO session) { List<Sample> sequencingSamplesToBeProcessed = - listSequencingSamples(RAW_SAMPLE_TYPE, YES, PROCESSING_POSSIBLE_PROPERTY_CODE, trackingState - .getAlreadyTrackedSampleIdsToBeProcessed(), trackingServer, gis, session); - + listSequencingSamples(PROCESSING_POSSIBLE_PROPERTY_CODE, trackingState + .getAlreadyTrackedSampleIdsToBeProcessed(), trackingServer, session); List<Sample> sequencingSamplesSuccessfullyProcessed = - listSequencingSamples(LIBRARY_SAMPLE_TYPE, TRUE, PROCESSING_SUCCESSFUL_PROPERTY_CODE, trackingState - .getAlreadyTrackedSampleIdsProcessed(), trackingServer, gis, session); + listSequencingSamples(PROCESSING_SUCCESSFUL_PROPERTY_CODE, trackingState + .getAlreadyTrackedSampleIdsProcessed(), trackingServer, session); TrackingDataSetCriteria dataSetCriteria = - new TrackingDataSetCriteria(DATASET_ATTACHED_TO_SAMPLE_TYPE, trackingState + new TrackingDataSetCriteria(FLOW_LANE_SAMPLE_TYPE, trackingState .getLastSeenDatasetId()); List<AbstractExternalData> dataSets = trackingServer.listDataSets(session.getSessionToken(), dataSetCriteria); @@ -217,108 +194,22 @@ public class TrackingBO sequencingSamplesSuccessfullyProcessed, dataSets); } - private static List<Sample> listSequencingSamples(String SampleType, String propertyValue, String propertyTypeCode, - Set<Long> alreadyTrackedSampleIds, ITrackingServer trackingServer, IGeneralInformationService gis, + private static List<Sample> listSequencingSamples(String propertyTypeCode, + Set<Long> alreadyTrackedSampleIds, ITrackingServer trackingServer, SessionContextDTO session) { - List<Sample> completeList = new ArrayList<Sample>(); - - for (String sampleType : SEQUENCING_SAMPLE_TYPES) - { - completeList.addAll(listSamples(SampleType, propertyTypeCode, propertyValue, alreadyTrackedSampleIds, - trackingServer, gis, session)); - - } - return completeList; - + return listSamples(SEQUENCING_SAMPLE_TYPE, propertyTypeCode, TRUE, alreadyTrackedSampleIds, + trackingServer, session); } private static List<Sample> listSamples(String sampleType, String propertyTypeCode, String propertyValue, Set<Long> alreadyTrackedSampleIds, - ITrackingServer trackingServer, IGeneralInformationService gis, SessionContextDTO session) + ITrackingServer trackingServer, SessionContextDTO session) { TrackingSampleCriteria criteria = new TrackingSampleCriteria(sampleType, propertyTypeCode, propertyValue, alreadyTrackedSampleIds); - List<Sample> samples = trackingServer.listSamples(session.getSessionToken(), criteria); - - for (Sample sample : samples) - { - SearchCriteria parentCriteria = new SearchCriteria(); - parentCriteria.setOperator(SearchOperator.MATCH_ANY_CLAUSES); - - for (Sample parent : sample.getParents()) - { - parentCriteria.addMatchClause(MatchClause.createAttributeMatch(MatchClauseAttribute.CODE, parent.getCode())); - } - - List<ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample> apiParents = - gis.searchForSamples(session.getSessionToken(), parentCriteria, - EnumSet.of(SampleFetchOption.PARENTS, SampleFetchOption.PROPERTIES)); - Set<Sample> dtoParents = new HashSet<Sample>(); - - for (ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample apiParent : apiParents) - { - dtoParents.add(convertSample(apiParent)); - } - sample.setParents(dtoParents); - } - - return samples; - } - - private static Sample convertSample(ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample apiSample) - { - Sample dtoSample = new Sample(); - - EntityProperty person = new EntityProperty(); - EntityProperty pi = new EntityProperty(); - EntityProperty externalSampleName = new EntityProperty(); - - List<IEntityProperty> propertyList = new ArrayList<IEntityProperty>(); - - dtoSample.setCode(apiSample.getCode()); - String sampleTypeCode = apiSample.getSampleTypeCode(); - - SampleType stc = new SampleType(); - stc.setCode(sampleTypeCode); - - dtoSample.setSampleType(stc); - - Map<String, String> properties = apiSample.getProperties(); - - PropertyType personType = new PropertyType(); - PropertyType piType = new PropertyType(); - PropertyType externalSampleNameType = new PropertyType(); - - personType.setCode(CONTACT_PERSON_EMAIL); - piType.setCode(PRINCIPAL_INVESTIGATOR_EMAIL); - externalSampleNameType.setCode(EXTERNAL_SAMPLE_NAME); - - person.setPropertyType(personType); - person.setValue(properties.get(CONTACT_PERSON_EMAIL)); - propertyList.add(person); - - pi.setPropertyType(piType); - pi.setValue(properties.get(PRINCIPAL_INVESTIGATOR_EMAIL)); - propertyList.add(pi); - - externalSampleName.setPropertyType(externalSampleNameType); - externalSampleName.setValue(properties.get(EXTERNAL_SAMPLE_NAME)); - propertyList.add(externalSampleName); - - dtoSample.setProperties(propertyList); - - if (apiSample.getRetrievedFetchOptions().contains(SampleFetchOption.PARENTS)) - { - Set<Sample> dtoParents = new HashSet<Sample>(); - for (ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample apiParent : apiSample.getParents()) - { - dtoParents.add(convertSample(apiParent)); - } - dtoSample.setParents(dtoParents); - } - return dtoSample; + return trackingServer.listSamples(session.getSessionToken(), criteria); } static class TrackingStateUpdateHelper diff --git a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java index 780ce7375d81fc30334ae52a58a9a9cc7d16a567..bdaf5b9c4d55ecaf08c36fdaa5267e4e777fbd98 100644 --- a/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java +++ b/deep_sequencing_unit/source/java/ch/ethz/bsse/cisd/dsu/tracking/main/TrackingClient.java @@ -38,7 +38,6 @@ import ch.systemsx.cisd.common.mail.IMailClient; import ch.systemsx.cisd.common.shared.basic.string.StringUtils; import ch.systemsx.cisd.common.spring.HttpInvokerUtils; import ch.systemsx.cisd.openbis.generic.shared.ITrackingServer; -import ch.systemsx.cisd.openbis.generic.shared.api.v1.IGeneralInformationService; import ch.systemsx.cisd.openbis.generic.shared.dto.SessionContextDTO; /** @@ -75,11 +74,10 @@ public class TrackingClient Parameters params = new Parameters(props); ITrackingServer trackingServer = createOpenBISTrackingServer(params); - IGeneralInformationService gis = createOpenBISGeneralInformationService(params); IEntityTrackingEmailGenerator emailGenerator = new EntityTrackingEmailGenerator(props, retrieveEmailTemplate()); IMailClient mailClient = params.getMailClient(); - TrackingBO trackingBO = new TrackingBO(trackingServer, gis, emailGenerator, mailClient); + TrackingBO trackingBO = new TrackingBO(trackingServer, emailGenerator, mailClient); ITrackingDAO trackingDAO = new FileBasedTrackingDAO(LOCAL_STORAGE_FILE); @@ -95,13 +93,6 @@ public class TrackingClient 5 * DateUtils.MILLIS_PER_MINUTE); } - private static IGeneralInformationService createOpenBISGeneralInformationService(Parameters params) - { - String serviceURL = params.getOpenbisServerURL() + IGeneralInformationService.SERVICE_URL; - return HttpInvokerUtils.createServiceStub(IGeneralInformationService.class, serviceURL, - 5 * DateUtils.MILLIS_PER_MINUTE); - } - private static SessionContextDTO authentificateInOpenBIS(Parameters params, ITrackingServer trackingServer) {