Class FSMigrationTool

  • All Implemented Interfaces:
    edu.uiuc.ncsa.security.core.Logable

    public class FSMigrationTool
    extends edu.uiuc.ncsa.security.util.cli.CLITool
    Migration tool for old style file stores to (at this point) a Derby store. This loads or creates stores needed and then runs the FSMigrater The issue is that a lot of installs have been using file stores which have become immense -- hundreds of thousands of auto-registered clients -- most of which are one-time use or similar. The Upkeep facility cannot stay ahead of this since the assumption with the store initially was pretty small sized. The solution is to have an actual migration tool that will read the entire source store and batch it up a target store.

    Created by Jeff Gaynor
    on 2/24/24 at 7:09 AM

    • Constructor Detail

      • FSMigrationTool

        public FSMigrationTool()
    • Method Detail

      • getComponentName

        public String getComponentName()
        Specified by:
        getComponentName in class edu.uiuc.ncsa.security.util.cli.CLITool
      • getLoader

        public edu.uiuc.ncsa.security.core.util.ConfigurationLoader<? extends edu.uiuc.ncsa.security.core.util.AbstractEnvironment> getLoader()
                                                                                                                                       throws Exception
        Specified by:
        getLoader in class edu.uiuc.ncsa.security.util.cli.CLITool
        Throws:
        Exception
      • setMigrater

        public void setMigrater​(FSMigrater migrater)
      • doIt

        public void doIt()
                  throws Exception
        Specified by:
        doIt in class edu.uiuc.ncsa.security.util.cli.CLITool
        Throws:
        Exception
      • help

        public void help()
        Specified by:
        help in class edu.uiuc.ncsa.security.util.cli.CLITool
      • setSourceFile

        public void setSourceFile​(String sourceFile)
      • setTargetFile

        public void setTargetFile​(String targetFile)
      • setSourceConfigName

        public void setSourceConfigName​(String sourceConfigName)
      • setTargetConfigName

        public void setTargetConfigName​(String targetConfigName)
      • setVerbose

        public void setVerbose​(boolean verbose)
        Overrides:
        setVerbose in class edu.uiuc.ncsa.security.util.cli.CLITool
      • setBatchSize

        public void setBatchSize​(int batchSize)
      • isPacerOn

        public boolean isPacerOn()
      • setPacerOn

        public void setPacerOn​(boolean pacerOn)
      • setNoTransactions

        public void setNoTransactions​(boolean noTransactions)
      • getSourceSE

        public org.oa4mp.server.loader.oauth2.OA2SE getSourceSE()
      • getTargetSE

        public org.oa4mp.server.loader.oauth2.OA2SE getTargetSE()
      • getSourceFile

        public String getSourceFile()
      • getTargetFile

        public String getTargetFile()
      • getSourceConfigName

        public String getSourceConfigName()
      • getTargetConfigName

        public String getTargetConfigName()
      • isVerbose

        public boolean isVerbose()
        Overrides:
        isVerbose in class edu.uiuc.ncsa.security.util.cli.CLITool
      • getBatchSize

        public int getBatchSize()
      • loadEnvironments

        protected boolean loadEnvironments()
        Loads the environment. This returns true if the operation succeeded.
        Returns:
      • vsay

        protected void vsay​(String x)
      • setMigrateStore

        public void setMigrateStore​(MigrateStore migrateStore)
      • isUpkeepOn

        public boolean isUpkeepOn()
      • setUpkeepOn

        public void setUpkeepOn​(boolean upkeepOn)
      • say

        public static void say​(String x)
      • echoOn

        protected static boolean echoOn()
      • getHelpMap

        protected static Map<String,​FSMigrationTool.HelpEntry> getHelpMap()
        Creates the help map. This adds the entry by key. Later these are alphabetized, formatted, etc.
        Returns:
      • addHelpEntry

        protected static void addHelpEntry​(String name,
                                           String type,
                                           String description)
      • addHelpEntry

        protected static void addHelpEntry​(String name,
                                           String type,
                                           String description,
                                           String[] description2)
      • addHelpEntry

        protected static void addHelpEntry​(String name,
                                           String type,
                                           String defaultValue,
                                           String description)
      • isNoTransactions

        public boolean isNoTransactions()
      • removeMigrationDB

        protected void removeMigrationDB​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
      • getDBDir

        protected File getDBDir()
      • nukeDir

        protected void nukeDir​(File dir)
        Removes EVERYTHING in the directory, AND the directory itself.
        Parameters:
        dir -
      • getArgs

        protected boolean getArgs​(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
                           throws IOException
        Throws:
        IOException
      • isEchoAppend

        public boolean isEchoAppend()
      • setEchoAppend

        public void setEchoAppend​(boolean echoAppend)