// initialize
AsnContext context = this.getAssertionContext();
AsnFactory factory = context.getAssertionFactory();
AsnRequestOptions rOptions = context.getRequestOptions();
AsnResponse opResponse = context.getOperationResponse();
ParseHelper pHelper = new ParseHelper();
String[] parsed;
// parse the HTTP request
if (request != null) {
// set the IP address
rOptions.setIPAddress(request.getRemoteAddr());
// parse an operations request
boolean isOperationsRequest = false;
if (request.getRequestURI() != null) {
isOperationsRequest = request.getRequestURI().toLowerCase().endsWith("/operations");
}
if (isOperationsRequest) {
rOptions.setSubject(AsnConstants.APP_URN_PREFIX);
rOptions.setPredicate(AsnConstants.APP_URN_PREFIX+":assertion:operations");
// parse a non-operations request
} else {
// subject
parsed = pHelper.getParameterValues(request,"s");
if ((parsed == null) || (parsed.length) == 0) {
parsed = pHelper.getParameterValues(request,"subject");
}
if ((parsed != null) && (parsed.length) > 0) {
rOptions.setSubject(parsed[0]);
}
// predicate
parsed = pHelper.getParameterValues(request,"p");
if ((parsed == null) || (parsed.length) == 0) {
parsed = pHelper.getParameterValues(request,"predicate");
}
if ((parsed != null) && (parsed.length) > 0) {
rOptions.setPredicate(parsed[0]);
}
// value
parsed = pHelper.getParameterValues(request,"v");
if ((parsed == null) || (parsed.length) == 0) {
parsed = pHelper.getParameterValues(request,"value");
}
if ((parsed != null) && (parsed.length) > 0) {
rOptions.setValue(parsed[0]);
}
// output format
parsed = pHelper.getParameterValues(request,"f");
if ((parsed == null) || (parsed.length) == 0) {
parsed = pHelper.getParameterValues(request,"format");
}
if ((parsed != null) && (parsed.length) > 0) {
opResponse.setOutputFormat(parsed[0]);
}
// start and max records start=&max=
parsed = pHelper.getParameterValues(request,"start");
if ((parsed == null) || (parsed.length) == 0) {