Class ListUploadService

    • Field Detail

      • USAGE

        public static final java.lang.String USAGE
        A usage string to return for bad requests.
        See Also:
        Constant Field Values
      • BAG_QUERY_MAX_BATCH_SIZE

        public static final int BAG_QUERY_MAX_BATCH_SIZE
        The maximum number of ids to query for each batch.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ListUploadService

        public ListUploadService​(InterMineAPI im)
        Constructor
        Parameters:
        im - A reference to the main settings bundle
    • Method Detail

      • getHeaderAttributes

        protected java.util.Map<java.lang.String,​java.lang.Object> getHeaderAttributes()
        Gets the header attributes on the output object.
        Overrides:
        getHeaderAttributes in class ListMakerService
        Returns:
        A map of header attributes for JSON output.
      • setListSize

        protected void setListSize​(java.lang.Integer size)
        Sets the size of the list on the header attributes.
        Parameters:
        size - The size of the newly created list.
      • setListId

        protected void setListId​(java.lang.Integer id)
        Sets the id of the list on the header attributes.
        Parameters:
        id - The id of the newly created list.
      • getMatcher

        protected org.apache.commons.lang.text.StrMatcher getMatcher()
        Get the String Matcher for parsing the list of identifiers.
        Returns:
        The matcher to use.
      • getNewListType

        protected java.lang.String getNewListType​(ListInput input)
        Description copied from class: ListMakerService
        Calculate the type of the new list.
        Specified by:
        getNewListType in class ListMakerService
        Parameters:
        input - The parsed parameter input.
        Returns:
        The type name.
      • makeList

        protected void makeList​(ListInput listInput,
                                java.lang.String type,
                                Profile profile,
                                java.util.Set<java.lang.String> temporaryBagNamesAccumulator)
                         throws java.lang.Exception
        Description copied from class: ListMakerService
        Make the list requested by the user.
        Specified by:
        makeList in class ListMakerService
        Parameters:
        listInput - The parsed parameter input.
        type - The type of the new list.
        profile - The profile to save the list in.
        temporaryBagNamesAccumulator - The accumulator to store the list of bags to delete.
        Throws:
        java.lang.Exception - If something goes wrong.
      • processIdentifiers

        protected void processIdentifiers​(java.lang.String type,
                                          ListCreationInput input,
                                          java.util.Set<java.lang.String> ids,
                                          java.util.Set<java.lang.String> unmatchedIds,
                                          InterMineBag tempBag)
                                   throws java.io.IOException,
                                          java.lang.ClassNotFoundException,
                                          InterMineException,
                                          ObjectStoreException
        Process the identifiers.
        Parameters:
        type - The type of thing these identifiers are.
        input - The creation input.
        ids - The identifiers.
        unmatchedIds - A collector for unmatched identifiers.
        tempBag - The temporary bag to add results to.
        Throws:
        java.io.IOException - If we can't from the request.
        java.lang.ClassNotFoundException - if the type is not valid.
        InterMineException - If something goes wrong building the bag.
        ObjectStoreException - If there is a problem on the database level.
      • getReader

        protected java.io.BufferedReader getReader​(javax.servlet.http.HttpServletRequest request)
        Get the reader for the identifiers uploaded with this request.
        Parameters:
        request - The request object.
        Returns:
        A buffered reader for reading the identifiers.
      • requestIsOfSuitableType

        protected boolean requestIsOfSuitableType()
        Determine if we should service this request.
        Returns:
        whether or not this request's content is of the right type for us to read it.
      • addIdsToList

        protected void addIdsToList​(java.util.Collection<? extends java.lang.String> ids,
                                    InterMineBag bag,
                                    java.lang.String type,
                                    java.lang.String extraFieldValue,
                                    java.util.Set<java.lang.String> unmatchedIds,
                                    java.util.Collection<java.lang.String> acceptableIssues)
                             throws java.lang.ClassNotFoundException,
                                    InterMineException,
                                    ObjectStoreException
        Adds objects to the a bag for the matches against a set of identifiers.
        Parameters:
        ids - A collection of identifiers
        bag - The bag to add the objects to
        type - The type of this bag
        extraFieldValue - An extra value for disambiguation.
        unmatchedIds - An accumulator to store the failed matches.
        acceptableIssues - the list of issues that are OK to ignore.
        Throws:
        java.lang.ClassNotFoundException - if the type is not a valid class.
        InterMineException - If something goes wrong building the bag.
        ObjectStoreException - If there is a problem on the database level.