/** * Default constructor. */ public KdcServer() { kdcConfig = new KdcConfig(); backendConfig = new BackendConfig(); startupOptions = new KOptions(); kdcSetting = new KdcSetting(startupOptions, kdcConfig, backendConfig); }
try { BackendConfig backendConfig = KdcUtil.getBackendConfig(hasServer.getConfDir()); String backendJar = backendConfig.getString("kdc_identity_backend"); File conf; if (backendJar.equals("org.apache.kerby.kerberos.kdc.identitybackend.MySQLIdentityBackend")) {
/** * Get backend configuration * @param confDir configuration directory * @return backend configuration * @throws org.apache.kerby.kerberos.kerb.KrbException e. */ public static BackendConfig getBackendConfig(File confDir) throws KrbException { File backendConfigFile = new File(confDir, "backend.conf"); if (backendConfigFile.exists()) { BackendConfig backendConfig = new BackendConfig(); try { backendConfig.addIniConfig(backendConfigFile); } catch (IOException e) { throw new KrbException("Can not load the backend configuration file " + backendConfigFile.getAbsolutePath()); } return backendConfig; } return null; }
/** * Constructor given confDir where 'kdc.conf' and 'backend.conf' should be * available. * kdc.conf, that contains kdc server related items. * backend.conf, that contains identity backend related items. * * @param confDir The conf dir * @throws KrbException e */ public KdcServer(File confDir) throws KrbException { KdcConfig tmpKdcConfig = KdcUtil.getKdcConfig(confDir); if (tmpKdcConfig == null) { tmpKdcConfig = new KdcConfig(); } this.kdcConfig = tmpKdcConfig; BackendConfig tmpBackendConfig = KdcUtil.getBackendConfig(confDir); if (tmpBackendConfig == null) { tmpBackendConfig = new BackendConfig(); } tmpBackendConfig.setConfDir(confDir); this.backendConfig = tmpBackendConfig; startupOptions = new KOptions(); kdcSetting = new KdcSetting(startupOptions, kdcConfig, backendConfig); }
/** * {@inheritDoc} */ @Override protected void doInitialize() throws KrbException { LOG.info("Initializing the Json identity backend."); initGsonBuilder(); String dirPath = getConfig().getString(JSON_IDENTITY_BACKEND_DIR); File jsonFileDir; if (dirPath == null || dirPath.isEmpty()) { jsonFileDir = getBackendConfig().getConfDir(); } else { jsonFileDir = new File(dirPath); if (!jsonFileDir.exists() && !jsonFileDir.mkdirs()) { throw new KrbException("Failed to create json file dir " + jsonFileDir); } } jsonKdbFile = new File(jsonFileDir, "json-backend.json"); if (!jsonKdbFile.exists()) { try { jsonKdbFile.createNewFile(); } catch (IOException e) { throw new KrbException("Failed to create " + jsonKdbFile.getAbsolutePath()); } } }
/** * Constructor given confDir where 'kdc.conf' and 'backend.conf' should be * available. * kdc.conf, that contains kdc server related items. * backend.conf, that contains identity backend related items. * * @param confDir The conf dir * @throws KrbException e */ public KdcServer(File confDir) throws KrbException { KdcConfig tmpKdcConfig = KdcUtil.getKdcConfig(confDir); if (tmpKdcConfig == null) { tmpKdcConfig = new KdcConfig(); } this.kdcConfig = tmpKdcConfig; BackendConfig tmpBackendConfig = KdcUtil.getBackendConfig(confDir); if (tmpBackendConfig == null) { tmpBackendConfig = new BackendConfig(); } tmpBackendConfig.setConfDir(confDir); this.backendConfig = tmpBackendConfig; startupOptions = new KOptions(); kdcSetting = new KdcSetting(startupOptions, kdcConfig, backendConfig); }
/** * {@inheritDoc} */ @Override protected void doInitialize() throws KrbException { LOG.info("Initializing the Json identity backend."); initGsonBuilder(); String dirPath = getConfig().getString(JSON_IDENTITY_BACKEND_DIR); File jsonFileDir; if (dirPath == null || dirPath.isEmpty()) { jsonFileDir = getBackendConfig().getConfDir(); } else { jsonFileDir = new File(dirPath); if (!jsonFileDir.exists() && !jsonFileDir.mkdirs()) { throw new KrbException("Failed to create json file dir " + jsonFileDir); } } jsonKdbFile = new File(jsonFileDir, "json-backend.json"); if (!jsonKdbFile.exists()) { try { jsonKdbFile.createNewFile(); } catch (IOException e) { throw new KrbException("Failed to create " + jsonKdbFile.getAbsolutePath()); } } }
/** * Default constructor. */ public KdcServer() { kdcConfig = new KdcConfig(); backendConfig = new BackendConfig(); startupOptions = new KOptions(); kdcSetting = new KdcSetting(startupOptions, kdcConfig, backendConfig); }
/** * Get backend configuration * @param confDir configuration directory * @return backend configuration * @throws org.apache.kerby.kerberos.kerb.KrbException e. */ public static BackendConfig getBackendConfig(File confDir) throws KrbException { File backendConfigFile = new File(confDir, "backend.conf"); if (backendConfigFile.exists()) { BackendConfig backendConfig = new BackendConfig(); try { backendConfig.addIniConfig(backendConfigFile); } catch (IOException e) { throw new KrbException("Can not load the backend configuration file " + backendConfigFile.getAbsolutePath()); } return backendConfig; } return null; }
tmpBackendConfig = new BackendConfig(); tmpBackendConfig.setConfDir(confDir); this.backendConfig = tmpBackendConfig;
try { BackendConfig backendConfig = KdcUtil.getBackendConfig(hasServer.getConfDir()); String backendJar = backendConfig.getString("kdc_identity_backend"); File conf; if (backendJar.equals("org.apache.kerby.kerberos.kdc.identitybackend.MySQLIdentityBackend")) {
String dataDirString = getConfig().getString(ZKConfKey.DATA_DIR, true); if (dataDirString == null || dataDirString.isEmpty()) { File zooKeeperDir = new File(getBackendConfig().getConfDir(), "zookeeper"); dataDir = new File(zooKeeperDir, "data"); } else {
/** * Default constructor. */ public AdminServer() { adminServerConfig = new AdminServerConfig(); backendConfig = new BackendConfig(); kdcConfig = new KdcConfig(); startupOptions = new KOptions(); adminServerSetting = new AdminServerSetting(startupOptions, adminServerConfig, kdcConfig, backendConfig); }
/** * Get backend configuration * @param confDir configuration directory * @return backend configuration * @throws KrbException e. */ public static BackendConfig getBackendConfig(File confDir) throws KrbException { File backendConfigFile = new File(confDir, "backend.conf"); if (backendConfigFile.exists()) { BackendConfig backendConfig = new BackendConfig(); try { backendConfig.addIniConfig(backendConfigFile); } catch (IOException e) { throw new KrbException("Can not load the backend configuration file " + backendConfigFile.getAbsolutePath()); } return backendConfig; } return null; }
tmpBackendConfig = new BackendConfig(); tmpBackendConfig.setConfDir(confDir); this.backendConfig = tmpBackendConfig;
try { BackendConfig backendConfig = KdcUtil.getBackendConfig(hasServer.getConfDir()); String backendJar = backendConfig.getString("kdc_identity_backend"); File conf; if (backendJar.equals("org.apache.kerby.kerberos.kdc.identitybackend.MySQLIdentityBackend")) {
/** * Default constructor. */ public AdminServer() { adminServerConfig = new AdminServerConfig(); backendConfig = new BackendConfig(); kdcConfig = new KdcConfig(); startupOptions = new KOptions(); adminServerSetting = new AdminServerSetting(startupOptions, adminServerConfig, kdcConfig, backendConfig); }
/** * Get backend configuration * @param confDir configuration directory * @return backend configuration * @throws KrbException e. */ public static BackendConfig getBackendConfig(File confDir) throws KrbException { File backendConfigFile = new File(confDir, "backend.conf"); if (backendConfigFile.exists()) { BackendConfig backendConfig = new BackendConfig(); try { backendConfig.addIniConfig(backendConfigFile); } catch (IOException e) { throw new KrbException("Can not load the backend configuration file " + backendConfigFile.getAbsolutePath()); } return backendConfig; } return null; }
try { BackendConfig backendConfig = KdcUtil.getBackendConfig(hasServer.getConfDir()); String backendJar = backendConfig.getString("kdc_identity_backend"); File conf; if (backendJar.equals("org.apache.kerby.kerberos.kdc.identitybackend.MySQLIdentityBackend")) {
/** * Construct with prepared conf dir. * * @param confDir The path of conf dir * @throws KrbException e */ public LocalKadminImpl(File confDir) throws KrbException { KdcConfig tmpKdcConfig = KdcUtil.getKdcConfig(confDir); if (tmpKdcConfig == null) { tmpKdcConfig = new KdcConfig(); } BackendConfig tmpBackendConfig = KdcUtil.getBackendConfig(confDir); if (tmpBackendConfig == null) { tmpBackendConfig = new BackendConfig(); } this.serverSetting = new KdcSetting(tmpKdcConfig, tmpBackendConfig); backend = KdcUtil.getBackend(tmpBackendConfig); }