private void validateMaximumPayloadSize ( int currentPayloadSize ) throws PayloadMaxSizeExceededException { int maximumPayloadSize = getMaximumPayloadSize ( ) ; if ( currentPayloadSize > maximumPayloadSize ) { throw new PayloadMaxSizeExceededException ( maximumPayloadSize , currentPayloadSize ) ; } }
Validate that the payload does not exceed the maximum size allowed . If the limit is exceeded a PayloadMaxSizeExceededException is thrown .