/** * Parse the given attribute as a set of integer ranges. * @param name the attribute name * @param defaultValue the default value if it is not set * @return a new set of ranges from the configured value */ public IntegerRanges getRange(String name, String defaultValue) { return new IntegerRanges(get(name, defaultValue)); }
/** * Set the array of string values for the <code>name</code> property as * as comma delimited values. * * @param name property name. * @param values The values */ public void setStrings(String name, String... values) { set(name, StringUtils.arrayToString(values)); }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s. * If no such property is specified then <code>null</code> is returned. * * @param name property name. * @return property value as an array of <code>String</code>s, * or <code>null</code>. */ public String[] getStrings(String name) { String valueString = get(name); return StringUtils.getStrings(valueString); }
private static int getPort(CConfiguration cConf) { return cConf.getBoolean(Constants.Security.SSL.EXTERNAL_ENABLED) ? cConf.getInt(Constants.Security.AuthenticationServer.SSL_PORT) : cConf.getInt(Constants.Security.AUTH_SERVER_BIND_PORT); } }
RunRecordCorrectorService(CConfiguration cConf, Store store, ProgramStateWriter programStateWriter, ProgramRuntimeService runtimeService, NamespaceAdmin namespaceAdmin, DatasetFramework datasetFramework) { this(cConf, store, programStateWriter, runtimeService, namespaceAdmin, datasetFramework, 2L * cConf.getLong(Constants.AppFabric.PROGRAM_MAX_START_SECONDS), cConf.getInt(Constants.AppFabric.PROGRAM_RUNID_CORRECTOR_TX_BATCH_SIZE)); }
/** * Checks if authorization is enabled */ public static boolean isSecurityAuthorizationEnabled(CConfiguration cConf) { return cConf.getBoolean(Constants.Security.ENABLED) && cConf.getBoolean(Constants.Security.Authorization.ENABLED); }
public AbstractDistributedMasterServiceManager(CConfiguration cConf, String serviceName, TwillRunnerService twillRunnerService, DiscoveryServiceClient discoveryServiceClient) { this.cConf = cConf; this.serviceName = serviceName; this.twillRunnerService = twillRunnerService; this.discoveryTimeout = cConf.getLong(Constants.Monitor.DISCOVERY_TIMEOUT_SECONDS); this.discoveryServiceClient = discoveryServiceClient; }
/** * Constructor only takes the configuration to determine the maximal allowed length for a key. */ public MetadataValidator(CConfiguration cConf) { maxCharacters = cConf.getInt(Constants.Metadata.MAX_CHARS_ALLOWED); }
/** * Creates an instance of configuration. * @param resource the resource to be added to the configuration * @return an instance of CConfiguration */ public static CConfiguration create(InputStream resource) { CConfiguration conf = new CConfiguration(); conf.addResource(resource); return conf; }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then an empty array is returned. * * @param name property name. * @return property value as an array of trimmed <code>String</code>s, * or empty array. */ public String[] getTrimmedStrings(String name) { String valueString = get(name); return StringUtils.getTrimmedStrings(valueString); }
/** * Get the comma delimited values of the <code>name</code> property as * a collection of <code>String</code>s. * If no such property is specified then empty collection is returned. * <p> * This is an optimized version of {@link #getStrings(String)} * * @param name property name. * @return property value as a collection of <code>String</code>s. */ public Collection<String> getStringCollection(String name) { String valueString = get(name); return StringUtils.getStringCollection(valueString); }
/** * Add a configuration resource. * * The properties of this resource will override properties of previously * added resources, unless they were marked <a href="#Final">final</a>. * * @param name resource to be added, the classpath is examined for a file * with that name. */ public void addResource(String name) { addResourceObject(name); }
DatasetModulesDeployer(DatasetFramework datasetFramework, DatasetFramework inMemoryDatasetFramework, CConfiguration cConf) { this.datasetFramework = datasetFramework; this.systemDatasetFramework = inMemoryDatasetFramework; this.allowDatasetUncheckedUpgrade = cConf.getBoolean(Constants.Dataset.DATASET_UNCHECKED_UPGRADE); }
/** * Parse the given attribute as a set of integer ranges. * @param name the attribute name * @param defaultValue the default value if it is not set * @return a new set of ranges from the configured value */ public IntegerRanges getRange(String name, String defaultValue) { return new IntegerRanges(get(name, defaultValue)); }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s. * If no such property is specified then <code>null</code> is returned. * * @param name property name. * @return property value as an array of <code>String</code>s, * or <code>null</code>. */ public String[] getStrings(String name) { String valueString = get(name); return StringUtils.getStrings(valueString); }
/** * Get the comma delimited values of the <code>name</code> property as * an array of <code>String</code>s, trimmed of the leading and trailing whitespace. * If no such property is specified then an empty array is returned. * * @param name property name. * @return property value as an array of trimmed <code>String</code>s, * or empty array. */ public String[] getTrimmedStrings(String name) { String valueString = get(name); return StringUtils.getTrimmedStrings(valueString); }
/** * Get the comma delimited values of the <code>name</code> property as * a collection of <code>String</code>s. * If no such property is specified then empty collection is returned. * <p> * This is an optimized version of {@link #getStrings(String)} * * @param name property name. * @return property value as a collection of <code>String</code>s. */ public Collection<String> getStringCollection(String name) { String valueString = get(name); return StringUtils.getStringCollection(valueString); }
/** * Set the array of string values for the <code>name</code> property as * as comma delimited values. * * @param name property name. * @param values The values */ public void setStrings(String name, String... values) { set(name, StringUtils.arrayToString(values)); }