public CacheServerDetails(final String bindAddress, final int port) { this.bindAddress = StringUtils.defaultIfBlank(bindAddress, "*"); this.port = port; }
void recordRedisDaoPayloadSize(String action, int size, String taskType, String workflowType) { Monitors.recordDaoPayloadSize(DAO_NAME, action, StringUtils.defaultIfBlank(taskType,""), StringUtils.defaultIfBlank(workflowType,""), size); } }
void recordCassandraDaoPayloadSize(String action, int size, String taskType, String workflowType) { Monitors.recordDaoPayloadSize(DAO_NAME, action, StringUtils.defaultIfBlank(taskType, ""), StringUtils.defaultIfBlank(workflowType, ""), size); }
/** * Gets the name of the log file used to log information about this Server. * * @return a String value indicating the name of this Server's log file. */ @Override public String getLogFileName() { return defaultIfBlank(getMemberName(), DEFAULT_SERVER_LOG_NAME).concat(DEFAULT_SERVER_LOG_EXT); }
/** * Gets the name of this member (this Server) in the GemFire distributed system as determined by * the 'name' GemFire property. * * @return a String indicating the name of the member (this Server) in the GemFire distributed * system. */ @Override public String getMemberName() { return defaultIfBlank(this.memberName, super.getMemberName()); }
/** * Gets the name of this member (this Locator) in the GemFire distributed system and determined by * the 'name' GemFire property. * * @return a String indicating the name of the member (this Locator) in the GemFire distributed * system. */ @Override public String getMemberName() { return defaultIfBlank(this.memberName, super.getMemberName()); }
/** * Gets the working directory pathname in which the Locator will be ran. If the directory is * unspecified, then working directory defaults to the current directory. * * @return a String indicating the working directory pathname. * @see #setWorkingDirectory(String) */ public String getWorkingDirectory() { return tryGetCanonicalPathElseGetAbsolutePath( new File(defaultIfBlank(this.workingDirectory, DEFAULT_WORKING_DIRECTORY))); }
/** * Gets the name of the log file used to log information about this Locator. * * @return a String value indicating the name of this Locator's log file. */ @Override public String getLogFileName() { return defaultIfBlank(getMemberName(), DEFAULT_LOCATOR_LOG_NAME) .concat(DEFAULT_LOCATOR_LOG_EXT); }
/** * Gets the working directory pathname in which the Server will be ran. If the directory is * unspecified, then working directory defaults to the current directory. * * @return a String indicating the working directory pathname. * @see #setWorkingDirectory(String) */ public String getWorkingDirectory() { return tryGetCanonicalPathElseGetAbsolutePath( new File(defaultIfBlank(this.workingDirectory, DEFAULT_WORKING_DIRECTORY))); }
protected String getDiskStoreName(final GatewaySender gateway) { return StringUtils.defaultIfBlank(gateway.getDiskStoreName(), DiskStoreDetails.DEFAULT_DISK_STORE_NAME); }
protected String getDiskStoreName(final AsyncEventQueue queue) { return StringUtils.defaultIfBlank(queue.getDiskStoreName(), DiskStoreDetails.DEFAULT_DISK_STORE_NAME); }
@Test public void testDefaultIfBlank_CharBuffers() { assertEquals("NULL", StringUtils.defaultIfBlank(CharBuffer.wrap(""), CharBuffer.wrap("NULL")).toString()); assertEquals("NULL", StringUtils.defaultIfBlank(CharBuffer.wrap(" "), CharBuffer.wrap("NULL")).toString()); assertEquals("abc", StringUtils.defaultIfBlank(CharBuffer.wrap("abc"), CharBuffer.wrap("NULL")).toString()); assertNull(StringUtils.defaultIfBlank(CharBuffer.wrap(""), null)); // Tests compatibility for the API return type final CharBuffer s = StringUtils.defaultIfBlank(CharBuffer.wrap("abc"), CharBuffer.wrap("NULL")); assertEquals("abc", s.toString()); }
@Test public void testDefaultIfBlank_StringBuffers() { assertEquals("NULL", StringUtils.defaultIfBlank(new StringBuffer(""), new StringBuffer("NULL")).toString()); assertEquals("NULL", StringUtils.defaultIfBlank(new StringBuffer(" "), new StringBuffer("NULL")).toString()); assertEquals("abc", StringUtils.defaultIfBlank(new StringBuffer("abc"), new StringBuffer("NULL")).toString()); assertNull(StringUtils.defaultIfBlank(new StringBuffer(""), null)); // Tests compatibility for the API return type final StringBuffer s = StringUtils.defaultIfBlank(new StringBuffer("abc"), new StringBuffer("NULL")); assertEquals("abc", s.toString()); }
@Test public void testDefaultIfBlank_StringBuilders() { assertEquals("NULL", StringUtils.defaultIfBlank(new StringBuilder(""), new StringBuilder("NULL")).toString()); assertEquals("NULL", StringUtils.defaultIfBlank(new StringBuilder(" "), new StringBuilder("NULL")).toString()); assertEquals("abc", StringUtils.defaultIfBlank(new StringBuilder("abc"), new StringBuilder("NULL")).toString()); assertNull(StringUtils.defaultIfBlank(new StringBuilder(""), null)); // Tests compatibility for the API return type final StringBuilder s = StringUtils.defaultIfBlank(new StringBuilder("abc"), new StringBuilder("NULL")); assertEquals("abc", s.toString()); }
protected String getDiskStoreName(final Region region) { return StringUtils.defaultIfBlank(region.getAttributes().getDiskStoreName(), DiskStoreDetails.DEFAULT_DISK_STORE_NAME); }
@Test public void testDefaultIfBlank_StringString() { assertEquals("NULL", StringUtils.defaultIfBlank(null, "NULL")); assertEquals("NULL", StringUtils.defaultIfBlank("", "NULL")); assertEquals("NULL", StringUtils.defaultIfBlank(" ", "NULL")); assertEquals("abc", StringUtils.defaultIfBlank("abc", "NULL")); assertNull(StringUtils.defaultIfBlank("", null)); // Tests compatibility for the API return type final String s = StringUtils.defaultIfBlank("abc", "NULL"); assertEquals("abc", s); }
@Override public List<Command> getHighWatermarkMetadata(String schema, String entity, String watermarkColumn, List<Predicate> predicateList) throws HighWatermarkException { log.debug("Build query to get high watermark"); List<Command> commands = new ArrayList<>(); String columnProjection = "max(" + Utils.getCoalesceColumnNames(watermarkColumn) + ")"; String watermarkFilter = StringUtils.defaultIfBlank(this.concatPredicates(predicateList), EMPTY_CONDITION); String query = this.getExtractSql(); query = query.replace(this.getOutputColumnProjection(), columnProjection) .replace(ConfigurationKeys.DEFAULT_SOURCE_QUERYBASED_WATERMARK_PREDICATE_SYMBOL, watermarkFilter); commands.add(getCommand(query, JdbcCommand.JdbcCommandType.QUERY)); return commands; }
protected String getDiskStoreName(final CacheServer cacheServer) { return (cacheServer.getClientSubscriptionConfig() == null ? null : StringUtils.defaultIfBlank(cacheServer.getClientSubscriptionConfig().getDiskStoreName(), DiskStoreDetails.DEFAULT_DISK_STORE_NAME)); }
protected void setPdxSerializationDetails(final InternalCache cache, final DiskStore diskStore, final DiskStoreDetails diskStoreDetails) { if (cache.getPdxPersistent()) { String diskStoreName = StringUtils.defaultIfBlank(cache.getPdxDiskStore(), DiskStoreDetails.DEFAULT_DISK_STORE_NAME); diskStoreDetails.setPdxSerializationMetaDataStored( ObjectUtils.equals(diskStoreName, diskStore.getName())); } }
private void setRegionDetails(final Region<?, ?> region, final DiskStore diskStore, final DiskStoreDetails diskStoreDetails) { if (isUsingDiskStore(region, diskStore)) { String regionFullPath = region.getFullPath(); DiskStoreDetails.RegionDetails regionDetails = new DiskStoreDetails.RegionDetails( regionFullPath, StringUtils.defaultIfBlank(region.getName(), regionFullPath)); regionDetails.setOverflowToDisk(isOverflowToDisk(region)); regionDetails.setPersistent(isPersistent(region)); diskStoreDetails.add(regionDetails); } for (Region<?, ?> subregion : region.subregions(false)) { setRegionDetails(subregion, diskStore, diskStoreDetails); // depth-first, recursive strategy } }