*/
protected void validate() throws StreamServiceNotValidException {
if (getServiceName() == null
|| !getServiceName().matches("\\A[a-zA-Z]+\\z"))
throw new StreamServiceNotValidException(
"Service-name is empty or contains invalid characters.", this);
if (getStreamsPerSession() <= 0)
throw new StreamServiceNotValidException(
"A session can not have less than one stream.", this);
if (getChunkSize().length < getStreamsPerSession())
throw new StreamServiceNotValidException(
"Chunk-size has to be set for every stream.", this);
if (getMaximumDelay().length < getStreamsPerSession())
throw new StreamServiceNotValidException(
"Delays have to be set for every stream.", this);
if (getBufferSize().length < getStreamsPerSession())
throw new StreamServiceNotValidException(
"Buffer-sizes have to be set for every stream.", this);
for (int chunkSize : getChunkSize()) {
if (chunkSize < 0)
throw new StreamServiceNotValidException(
"Chunk-sizes have to be greater-than-or-equal 0.", this);
}
for (long delay : getMaximumDelay()) {
if (delay < 0)
throw new StreamServiceNotValidException(
"Delay has to be greater-than-or-equal 0.", this);
}
for (int bufferSize : getChunkSize()) {
if (bufferSize <= 0)
throw new StreamServiceNotValidException(
"Chunk-size has to be greater than 0.", this);
}
}