// Create the Transformations that will be applied to this connection
List<Transformation> transformations = createTransformations(negotiatedExtensions);
// Build the transformation pipeline
Transformation transformation = null;
StringBuilder responseHeaderExtensions = new StringBuilder();
boolean first = true;
for (Transformation t : transformations) {
if (first) {
first = false;
} else {
responseHeaderExtensions.append(',');
}
append(responseHeaderExtensions, t.getExtensionResponse());
if (transformation == null) {
transformation = t;
} else {
transformation.setNext(t);
}
}
// Now we have the full pipeline, validate the use of the RSV bits.
if (transformation != null && !transformation.validateRsvBits(0)) {
// TODO i18n
throw new ServletException("Incompatible RSV bit usage");
}
// If we got this far, all is good. Accept the connection.