當前位置: 首頁>>代碼示例>>Java>>正文


Java ConfigProperties類代碼示例

本文整理匯總了Java中org.uberfire.commons.config.ConfigProperties的典型用法代碼示例。如果您正苦於以下問題:Java ConfigProperties類的具體用法?Java ConfigProperties怎麽用?Java ConfigProperties使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ConfigProperties類屬於org.uberfire.commons.config包,在下文中一共展示了ConfigProperties類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
public void init(final ConfigProperties config) {
    final ConfigProperties.ConfigProperty authServer = config.get("org.uberfire.ext.security.management.keycloak.authServer",
                                                                  DEFAULT_AUTH_SERVER);
    final ConfigProperties.ConfigProperty realm = config.get("org.uberfire.ext.security.management.keycloak.realm",
                                                             DEFAULT_REALM);
    final ConfigProperties.ConfigProperty user = config.get("org.uberfire.ext.security.management.keycloak.user",
                                                            DEFAULT_USER);
    final ConfigProperties.ConfigProperty password = config.get("org.uberfire.ext.security.management.keycloak.password",
                                                                DEFAULT_PASSWORD);
    final ConfigProperties.ConfigProperty clientId = config.get("org.uberfire.ext.security.management.keycloak.clientId",
                                                                DEFAULT_CLIENT_ID);
    final ConfigProperties.ConfigProperty clientSecret = config.get("org.uberfire.ext.security.management.keycloak.clientSecret",
                                                                    DEFAULT_CLIENT_SECRET);

    this.client = Keycloak.getInstance(authServer.getValue(),
                                       realm.getValue(),
                                       new AuthTokenManager(new AuthSettings(authServer.getValue(),
                                                                             realm.getValue(),
                                                                             user.getValue(),
                                                                             password.getValue(),
                                                                             clientId.getValue(),
                                                                             clientSecret.getValue())));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:24,代碼來源:CredentialsClientFactory.java

示例2: loadConfig

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
protected void loadConfig(final ConfigProperties config) {
    final ConfigProperties.ConfigProperty host = config.get("org.uberfire.ext.security.management.wildfly.cli.host",
                                                            DEFAULT_HOST);
    final ConfigProperties.ConfigProperty port = config.get("org.uberfire.ext.security.management.wildfly.cli.port",
                                                            Integer.toString(DEFAULT_PORT));
    final ConfigProperties.ConfigProperty user = config.get("org.uberfire.ext.security.management.wildfly.cli.user",
                                                            DEFAULT_ADMIN_USER);
    final ConfigProperties.ConfigProperty password = config.get("org.uberfire.ext.security.management.wildfly.cli.password",
                                                                DEFAULT_ADMIN_PASSWORD);
    final ConfigProperties.ConfigProperty realm = config.get("org.uberfire.ext.security.management.wildfly.cli.realm",
                                                             DEFAULT_REALM);

    this.host = host.getValue();
    this.port = Integer.decode(port.getValue());
    this.adminUser = user.getValue();
    this.adminPassword = password.getValue();
    this.realm = realm.getValue();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:19,代碼來源:BaseWildflyCLIManager.java

示例3: loadConfig

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
protected void loadConfig(final ConfigProperties config) {
    final ConfigProperties.ConfigProperty catalinaBasePath = config.get("org.uberfire.ext.security.management.tomcat.catalina-base",
                                                                        DEFAULT_CATALINA_BASE);
    final ConfigProperties.ConfigProperty usersName = config.get("org.uberfire.ext.security.management.tomcat.users-file",
                                                                 USERS_FILE);

    // Check mandatory properties.
    if (!isConfigPropertySet(catalinaBasePath)) {
        throw new IllegalArgumentException("Property 'org.uberfire.ext.security.management.tomcat.catalina-base' is mandatory and not set.");
    }
    if (!isConfigPropertySet(usersName)) {
        throw new IllegalArgumentException("Property 'org.uberfire.ext.security.management.tomcat.users-file' is mandatory and not set.");
    }

    this.defaultCatalinaBase = catalinaBasePath.getValue();
    this.usersFile = usersName.getValue();
    initializeTomcatProperties();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:19,代碼來源:BaseTomcatManager.java

示例4: setup

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
@Before
public void setup() throws Exception {
    URL templateURL = Thread.currentThread().getContextClassLoader().getResource(USERS_FILE_PATH + USERS_FILE_NAME);
    File templateFile = new File(templateURL.getFile());
    FileUtils.cleanDirectory(elHome);
    FileUtils.copyFileToDirectory(templateFile,
                                  elHome);
    String full = new File(elHome,
                           templateFile.getName()).getAbsolutePath();
    String path = full.substring(0,
                                 full.lastIndexOf(File.separator));
    String name = full.substring(full.lastIndexOf(File.separator) + 1,
                                 full.length());
    Map<String, String> props = new HashMap<String, String>(1);
    props.put("org.uberfire.ext.security.management.tomcat.catalina-base",
              path);
    props.put("org.uberfire.ext.security.management.tomcat.users-file",
              name);
    System.setProperty(BaseTomcatManager.CATALINA_BASE_PROPERTY,
                       "");
    groupsManager.loadConfig(new ConfigProperties(props));
    groupsManager.initialize(userSystemManager);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:24,代碼來源:TomcatGroupManagerTest.java

示例5: setup

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
@Before
public void setup() throws Exception {
    URL templateURL = Thread.currentThread().getContextClassLoader().getResource(USERS_FILE_PATH + USERS_FILE_NAME);
    File templateFile = new File(templateURL.getFile());
    FileUtils.cleanDirectory(elHome);
    FileUtils.copyFileToDirectory(templateFile,
                                  elHome);
    String full = new File(elHome,
                           templateFile.getName()).getAbsolutePath();
    String path = full.substring(0,
                                 full.lastIndexOf(File.separator));
    String name = full.substring(full.lastIndexOf(File.separator) + 1,
                                 full.length());
    Map<String, String> props = new HashMap<String, String>(1);
    props.put("org.uberfire.ext.security.management.tomcat.catalina-base",
              path);
    props.put("org.uberfire.ext.security.management.tomcat.users-file",
              name);
    System.setProperty(BaseTomcatManager.CATALINA_BASE_PROPERTY,
                       "");
    usersManager.loadConfig(new ConfigProperties(props));
    usersManager.initialize(userSystemManager);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:24,代碼來源:TomcatUserManagerTest.java

示例6: initRetryValue

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
private static int initRetryValue() {
    final ConfigProperties config = new ConfigProperties(System.getProperties());
    final String osName = config.get("os.name",
                                     "any").getValue();
    final String defaultRetryTimes;
    if (osName.toLowerCase().contains("windows")) {
        defaultRetryTimes = "10";
    } else {
        defaultRetryTimes = "0";
    }
    try {
        return config.get("org.uberfire.nio.git.retry.onfail.times",
                          defaultRetryTimes).getIntValue();
    } catch (NumberFormatException ex) {
        return 0;
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:18,代碼來源:GitImpl.java

示例7: GitHubRepository

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
public GitHubRepository(final Host host,
                        final String id,
                        final String group,
                        final String name,
                        final URI uri,
                        final GitCredentials credentials,
                        final Map<String, String> env,
                        final ConfigProperties config) {
    super(host,
          id,
          name,
          uri,
          credentials,
          env,
          config);
    this.group = checkNotEmpty("group",
                               group);
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:19,代碼來源:GitHubRepository.java

示例8: init

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
@PostConstruct
public void init() {
    clientFactory.init(new ConfigProperties(System.getProperties()),
                       request);
    this.userManager.init(clientFactory);
    this.groupManager.init(clientFactory);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:8,代碼來源:KCAdapterUserManagementService.java

示例9: init

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
public void init(final ConfigProperties config,
                 HttpServletRequest request) {

    // Check mandatory properties.
    final ConfigProperties.ConfigProperty authServer = config.get("org.uberfire.ext.security.management.keycloak.authServer",
                                                                  DEFAULT_AUTH_SERVER);

    final KCAdapterContextTokenManager tokenManager = new KCAdapterContextTokenManager(request);
    this.client = Keycloak.getInstance(authServer.getValue(),
                                       tokenManager.getRealm(),
                                       tokenManager);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:13,代碼來源:KCAdapterClientFactory.java

示例10: testInit

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
@Test
public void testInit() {
    this.tested.init();
    verify(clientFactory,
           times(1)).init(any(ConfigProperties.class),
                          eq(request));
    verify(userManager,
           times(1)).init(clientFactory);
    verify(groupManager,
           times(1)).init(clientFactory);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:12,代碼來源:KCSSOUserManagementServiceTest.java

示例11: testInit

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
@Test
public void testInit() {
    this.tested.init();
    verify(clientFactory,
           times(1)).init(any(ConfigProperties.class));
    verify(userManager,
           times(1)).init(clientFactory);
    verify(groupManager,
           times(1)).init(clientFactory);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:11,代碼來源:KCCredentialsUserManagementServiceTest.java

示例12: isConfigPropertySet

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
protected static boolean isConfigPropertySet(ConfigProperties.ConfigProperty property) {
    if (property == null) {
        return false;
    }
    String value = property.getValue();
    return !isEmpty(value);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:8,代碼來源:BaseWildflyPropertiesManager.java

示例13: loadConfig

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
protected void loadConfig(final ConfigProperties config) {
    LOG.debug("Configuring JBoss Wildfly provider from properties.");
    super.loadConfig(config);
    final ConfigProperties.ConfigProperty usersFilePathProperty = config.get("org.uberfire.ext.security.management.wildfly.properties.users-file-path",
                                                                             DEFAULT_USERS_FILE);
    if (!isConfigPropertySet(usersFilePathProperty)) {
        throw new IllegalArgumentException("Property 'org.uberfire.ext.security.management.wildfly.properties.users-file-path' is mandatory and not set.");
    }
    this.usersFilePath = usersFilePathProperty.getValue();
    LOG.debug("Configuration of JBoss WildFly provider finished.");
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:12,代碼來源:WildflyUserPropertiesManager.java

示例14: loadConfig

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
protected void loadConfig(final ConfigProperties config) {
    LOG.debug("Configuring JBoss provider from properties.");
    super.loadConfig(config);
    // Configure properties.
    final ConfigProperties.ConfigProperty groupsFilePathProperty = config.get("org.uberfire.ext.security.management.wildfly.properties.groups-file-path",
                                                                              DEFAULT_GROUPS_FILE);
    if (!isConfigPropertySet(groupsFilePathProperty)) {
        throw new IllegalArgumentException("Property 'org.uberfire.ext.security.management.wildfly.properties.groups-file-path' is mandatory and not set.");
    }
    this.groupsFilePath = groupsFilePathProperty.getValue();

    LOG.debug("Configuration of JBoss provider provider finished.");
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:14,代碼來源:WildflyGroupPropertiesManager.java

示例15: loadConfig

import org.uberfire.commons.config.ConfigProperties; //導入依賴的package包/類
private void loadConfig(final ConfigProperties systemConfig) {

        config.load(systemConfig);

        if (config.httpProxyIsDefined()) {
            setupProxyAuthentication();
        }
    }
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:9,代碼來源:JGitFileSystemProvider.java


注:本文中的org.uberfire.commons.config.ConfigProperties類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。