throws HTTPException
{
Request request = (Request) req;
Reply reply = (Reply) rep;
HttpBag pics = isPICSQuery (request) ;
if ( pics == null )
return reply ;
// Get the requested services:
HttpBag params = pics.getBag("params") ;
HttpBag services = params.getBag("services") ;
URL url = request.getURL();
int format = LabelBureauInterface.FMT_MINIMAL ;
// Get any format parameter:
if ( params.hasItem ("minimal") ) {
format = LabelBureauInterface.FMT_MINIMAL ;
} else if ( params.hasItem ("short") ) {
format = LabelBureauInterface.FMT_SHORT ;
} else if ( params.hasItem ("full") ) {
format = LabelBureauInterface.FMT_FULL ;
} else if ( params.hasItem ("signed") ) {
format = LabelBureauInterface.FMT_SIGNED ;
} else {
Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
error.setContent ("Invalid label format: "+format) ;
throw new HTTPException (error) ;
}
// Get labels for each service, building out the ret hashtable
StringBuffer sb = new StringBuffer(128) ;
Enumeration e = services.keys() ;
sb.append ("("+PICS.PICS_PROTOCOL_ID) ;
sloop:
while ( e.hasMoreElements() ) {
String n = (String) e.nextElement() ;
LabelServiceInterface s = bureau.getLabelService (n) ;