com.endeca.portal.data.config
Class DataSourceConfigValidator

java.lang.Object
  extended by com.endeca.portal.data.config.DataSourceConfigValidator

public class DataSourceConfigValidator
extends java.lang.Object

A class of static methods used to verify whether or not various items in a data source definition are valid.


Constructor Summary
DataSourceConfigValidator()
           
 
Method Summary
static boolean validDatabaseName(java.lang.String databaseName)
          Returns true if the provided name is a valid database name.
static boolean validDataSourceId(java.lang.String id)
          Returns true if the provided id is a valid datasource id.
static boolean validPort(java.lang.String port)
          Returns true if the provided port is a valid port number.
static boolean validPropertyName(java.lang.String name)
          Returns true if the provided name is a valid property name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceConfigValidator

public DataSourceConfigValidator()
Method Detail

validDataSourceId

public static boolean validDataSourceId(java.lang.String id)
Returns true if the provided id is a valid datasource id. A valid id is formatted the same as an HTML ID (but case-sensitive), as defined by the Regex above.

Parameters:
id - The datasource id to be checked
Returns:
true if id is a valid datasource id, false otherwise

validDatabaseName

public static boolean validDatabaseName(java.lang.String databaseName)
Returns true if the provided name is a valid database name. A valid database name is defined as a name that is valid within one's file system.

Parameters:
databaseName - The database name to be checked
Returns:
true if databaseName is a valid database name, false otherwise

validPropertyName

public static boolean validPropertyName(java.lang.String name)
Returns true if the provided name is a valid property name. A valid property name is a non empty string.

Parameters:
name - The database name to be checked
Returns:
true if name is a valid property name, false otherwise

validPort

public static boolean validPort(java.lang.String port)
Returns true if the provided port is a valid port number. A valid port is a non-negative number.

Parameters:
port - String representation of the port number
Returns:
true if port is a valid port, false otherwise