Class FeedTaskProcessor

  • Direct Known Subclasses:
    LocalFeedTaskProcessor

    public abstract class FeedTaskProcessor
    extends java.lang.Object
    Responsible for processing the individual task
    • Constructor Detail

      • FeedTaskProcessor

        public FeedTaskProcessor()
    • Method Detail

      • setUserNamesAreCaseSensitive

        public void setUserNamesAreCaseSensitive​(boolean userNamesAreCaseSensitive)
      • process

        public void process​(int jobTaskNode,
                            long minSeq,
                            long maxSeq,
                            RepoCtx ctx)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • startTransaction

        public abstract void startTransaction()
                                       throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • commitTransaction

        public abstract void commitTransaction()
                                        throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • rollbackTransaction

        public abstract void rollbackTransaction()
                                          throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • endTransaction

        public abstract void endTransaction()
                                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • selectUserFeedControls

        public abstract java.util.List<FeedControlEntity> selectUserFeedControls​(java.lang.String userId)
                                                                          throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • insertFeedEntry

        public abstract long insertFeedEntry​(ActivityFeedEntity feed)
                                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • updatePostStatus

        public abstract int updatePostStatus​(long id,
                                             ActivityPostEntity.STATUS status)
                                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • callWebScript

        protected java.lang.String callWebScript​(java.lang.String urlString,
                                                 java.lang.String ticket)
                                          throws java.net.MalformedURLException,
                                                 java.net.URISyntaxException,
                                                 java.io.IOException
        Throws:
        java.net.MalformedURLException
        java.net.URISyntaxException
        java.io.IOException
      • getTenantName

        protected java.lang.String getTenantName​(java.lang.String name,
                                                 java.lang.String tenantDomain)
      • getTenantDomain

        protected java.lang.String getTenantDomain​(java.lang.String name)
      • getSiteMembers

        protected java.util.Set<java.lang.String> getSiteMembers​(RepoCtx ctx,
                                                                 java.lang.String siteId,
                                                                 java.lang.String tenantDomain)
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getFollowers

        protected abstract java.util.Set<java.lang.String> getFollowers​(java.lang.String userId,
                                                                        java.lang.String tenantDomain)
                                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • canReadSite

        protected abstract boolean canReadSite​(RepoCtx ctx,
                                               java.lang.String siteIdIn,
                                               java.lang.String connectedUser,
                                               java.lang.String tenantDomain)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • canRead

        protected abstract boolean canRead​(RepoCtx ctx,
                                           java.lang.String connectedUser,
                                           java.util.Map<java.lang.String,​java.lang.Object> model)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getActivityTypeTemplates

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getActivityTypeTemplates​(java.lang.String repoEndPoint,
                                                                                                                  java.lang.String ticket,
                                                                                                                  java.lang.String subPath)
                                                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getActivityTemplates

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getActivityTemplates​(java.util.List<java.lang.String> allTemplateNames)
      • getFreemarkerConfiguration

        protected freemarker.template.Configuration getFreemarkerConfiguration​(RepoCtx ctx)
      • processFreemarker

        protected java.lang.String processFreemarker​(java.util.Map<java.lang.String,​freemarker.template.Template> templateCache,
                                                     java.lang.String fmTemplate,
                                                     freemarker.template.Configuration cfg,
                                                     java.util.Map<java.lang.String,​java.lang.Object> model)
                                              throws java.io.IOException,
                                                     freemarker.template.TemplateException,
                                                     java.lang.Exception
        Throws:
        java.io.IOException
        freemarker.template.TemplateException
        java.lang.Exception
      • getFeedControls

        protected java.util.List<FeedControlEntity> getFeedControls​(java.lang.String connectedUser)
                                                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • addMissingFormats

        protected void addMissingFormats​(java.lang.String activityType,
                                         java.util.List<java.lang.String> fmTemplates,
                                         java.util.List<java.lang.String> templatesToAdd)
      • getTemplateSubPath

        protected java.lang.String getTemplateSubPath​(java.lang.String activityType)
      • getBaseActivityType

        protected java.lang.String getBaseActivityType​(java.lang.String activityType)