Class BaseInstaller

java.lang.Object
com.altibase.document.installer.BaseInstaller
Direct Known Subclasses:
DatabaseInstaller

public abstract class BaseInstaller extends Object
Altibase Document API 설치 도구의 추상 기본 클래스 Java API와 REST API 설치의 공통 로직을 정의 템플릿 메서드 패턴을 사용하여 설치 단계를 제어
  • Field Details

    • mConsole

      protected final InstallerConsole mConsole
    • mJdbcUrl

      protected final String mJdbcUrl
    • mSysPassword

      protected final String mSysPassword
    • mApiAdminPassword

      protected final String mApiAdminPassword
  • Constructor Details

    • BaseInstaller

      public BaseInstaller(String aJdbcUrl, String aSysPassword, String aApiAdminPassword)
      생성자
  • Method Details

    • isAlreadyInstalled

      public boolean isAlreadyInstalled()
      템플릿 메서드: 설치 여부 확인 메타테이블이 이미 존재하는지 확인한다.
      Returns:
      이미 설치되어 있으면 true
    • install

      public boolean install()
      템플릿 메서드: 설치 프로세스 제어
    • createAccounts

      protected abstract void createAccounts(Connection aConnection) throws SQLException
      추상 메서드: 계정 생성 (java: 1개, rest: 2개)
      Throws:
      SQLException
    • setupMetadata

      protected abstract void setupMetadata(Connection aConnection) throws SQLException, IOException
      추상 메서드: 메타데이터 설정
      Throws:
      SQLException
      IOException
    • grantPermissions

      protected abstract void grantPermissions(Connection aConnection) throws SQLException, IOException
      추상 메서드: 권한 설정
      Throws:
      SQLException
      IOException
    • verifyInstallation

      protected abstract boolean verifyInstallation(Connection aConnection) throws SQLException
      추상 메서드: 설치 검증
      Throws:
      SQLException
    • getInstallerTitle

      protected abstract String getInstallerTitle()
      추상 메서드: 설치 도구 제목
    • createAdminAccount

      protected void createAdminAccount(Connection aConnection, String aAdminUsername, String aAdminPassword) throws SQLException
      공통 메서드: API 관리자 계정 생성 (sys 권한 필요)
      Throws:
      SQLException
    • printStepHeader

      protected void printStepHeader(int aStepNumber, String aStepName)
      헬퍼 메서드: 설치 단계 헤더 출력
    • createVariables

      protected Map<String,String> createVariables()
      헬퍼 메서드: SQL 변수 맵 생성
    • readDatabaseConnection

      protected static String readDatabaseConnection(InstallerConsole aConsole) throws IOException
      정적 메서드: 데이터베이스 연결 정보 입력 (환경변수 우선) 환경변수: KADA_ALTIBASE_HOST, KADA_ALTIBASE_PORT, KADA_ALTIBASE_DBNAME
      Parameters:
      aConsole - 콘솔 인스턴스
      Returns:
      JDBC URL
      Throws:
      IOException - 입력 오류
    • readSysPassword

      protected static String readSysPassword(InstallerConsole aConsole) throws IOException
      정적 메서드: sys 비밀번호 입력 (환경변수 우선) 환경변수: KADA_ALTIBASE_SYS_PASSWORD
      Parameters:
      aConsole - 콘솔 인스턴스
      Returns:
      sys 비밀번호
      Throws:
      IOException - 입력 오류
    • readPasswordWithEnv

      protected static String readPasswordWithEnv(InstallerConsole aConsole, String aEnvVarName, String aPrompt) throws IOException
      정적 메서드: 비밀번호 입력 (환경변수 우선)
      Parameters:
      aConsole - 콘솔 인스턴스
      aEnvVarName - 환경변수 이름
      aPrompt - 프롬프트 메시지
      Returns:
      비밀번호
      Throws:
      IOException - 입력 오류
    • confirmInstallation

      protected boolean confirmInstallation() throws IOException
      공통 메서드: 설치 확인 환경변수 기반 비대화형 모드에서는 확인 절차를 스킵한다.
      Returns:
      사용자 확인 여부
      Throws:
      IOException - 입력 오류
    • isNonInteractiveMode

      protected boolean isNonInteractiveMode()
      비대화형 모드 여부 확인 모든 필수 환경변수가 설정되어 있으면 비대화형 모드로 간주한다.
      Returns:
      비대화형 모드 여부
    • checkAdditionalEnvVars

      protected boolean checkAdditionalEnvVars()
      추가 환경변수 확인 (하위 클래스에서 오버라이드) DatabaseInstaller: 추가 확인 불필요 (true 반환) RestApiInstaller: KADA_API_USER_PASSWORD 확인
      Returns:
      추가 환경변수 설정 여부
    • runInstallationAndExit

      protected void runInstallationAndExit()
      공통 메서드: 설치 실행 및 결과 처리