org.jwarp.service.param
Interface IParamService

All Superinterfaces:
IConfigurable, IExceptionProvider, IService
All Known Implementing Classes:
ParamService

public interface IParamService
extends IService

This is the parameters providing and validating service interface. You can initiliaze all setting and sub-services by a configuration file. Most of time you will define all you need in such a configuration file and you do not dynamically add new settings and definitions. But if you need do - do it!


Field Summary
static java.lang.String SERVICE_TYPE
          The service type constant
 
Fields inherited from interface org.jwarp.service.IService
SERVICE_STATUS_CREATED, SERVICE_STATUS_NOT_AVAILABLE, SERVICE_STATUS_READY, SERVICE_STATUS_RESUMING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STARTING, SERVICE_STATUS_STOPPED, SERVICE_STATUS_STOPPING, SERVICE_STATUS_SUSPENDED
 
Method Summary
 void addValidation(IValidation validation, java.lang.String name)
          Add a new validation.
 IValidator addValidator(IValidator validator, java.lang.String name)
          Add a validator.
 IValidation getValidation(java.lang.String name)
          Gets the validation with the givwen name.
 java.util.Iterator getValidations()
          Return all defined validations.
 IValidator getValidator(java.lang.String paramName)
          Returns the validator with the given name.
 java.util.Iterator getValidators()
          Returns an iteratotr with all currently defined validators.
 IValidation removeValidation(java.lang.String name)
          Removes and returns the validation given.
 IValidator removeValidator(java.lang.String paramName)
          Remove a validator.
 void validate(Parameter[] params, java.lang.String validationName)
          Validates a parameter block with the validation given by its name.
 void validate(Parameter param, java.lang.String validatorName)
          Validates a parameter with the validator given by its name.
 
Methods inherited from interface org.jwarp.service.IService
checkContext, getDependencies, getLogLevel, getName, getStatus, getType, resume, setContext, setDependencies, setLogLevel, shutdown, start, suspend
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 
Methods inherited from interface org.jwarp.common.IExceptionProvider
addExceptionListener, getExceptionListeners, removeAllExceptionListeners, removeExceptionListener
 

Field Detail

SERVICE_TYPE

public static final java.lang.String SERVICE_TYPE
The service type constant
Method Detail

getValidator

public IValidator getValidator(java.lang.String paramName)
Returns the validator with the given name. If the validator can not be found, null is returned.
Returns:
The validator to the parameter type

addValidator

public IValidator addValidator(IValidator validator,
                               java.lang.String name)
Add a validator. A previous existing validator is returned as a method result.
Parameters:
The - new validator
Returns:
The previous validator or null

removeValidator

public IValidator removeValidator(java.lang.String paramName)
                           throws NotFoundException
Remove a validator. The validator is returned as a method result.
Parameters:
The - new validator
Returns:
The previous validator
Throws:
NotFoundException - Raised when no validator with the given name exists.

getValidators

public java.util.Iterator getValidators()
Returns an iteratotr with all currently defined validators.
Returns:
All validators.

getValidations

public java.util.Iterator getValidations()
Return all defined validations.
Returns:
All validations.

addValidation

public void addValidation(IValidation validation,
                          java.lang.String name)
Add a new validation. A previous validation is returned as method result.
Parameters:
validation - The new validation
Returns:
The previous validation or null

removeValidation

public IValidation removeValidation(java.lang.String name)
                             throws NotFoundException
Removes and returns the validation given.
Parameters:
name - The name of the validation to be removed.
Returns:
The validation removed.
Throws:
NotFoundException - If the validation doesnot exist

getValidation

public IValidation getValidation(java.lang.String name)
Gets the validation with the givwen name.
Returns:
The validation or null

validate

public void validate(Parameter[] params,
                     java.lang.String validationName)
              throws NotFoundException,
                     ParameterNotFoundException,
                     ParameterException
Validates a parameter block with the validation given by its name.
Parameters:
params - The parameters.
validationName - The name of the validation.
Throws:
NotFoundExceptino - If the validation could not be found.
ParameterNotFoundException - If a parameter is missing
ParameterException - If a parameter could not be validated

validate

public void validate(Parameter param,
                     java.lang.String validatorName)
              throws NotFoundException,
                     ParameterNotFoundException,
                     ParameterException
Validates a parameter with the validator given by its name.
Parameters:
param - The parameter.
validatorName - The name of the validator.
Throws:
NotFoundExceptino - If the validator could not be found.
ParameterNotFoundException - If the parameter is missing
ParameterException - If the parameter could not be validated

©   O R C A   S y s t e m s