public MessageBytes get( String name) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return fields[i].value; } } return null; }
public int findFirst( String name ) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
public MessageBytes get( String name) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return fields[i].value; } } return null; }
public int findFirst( String name ) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
public MessageBytes get( String name) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return fields[i].value; } } return null; }
public int findFirst( String name ) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
public MessageBytes get( String name) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return fields[i].value; } } return null; }
public int findFirst( String name ) { for (int i = 0; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
public int findNext( int startPos ) { int next= fields[startPos].nextPos; if( next != MultiMap.NEED_NEXT ) { return next; } // next==NEED_NEXT, we never searched for this header MessageBytes name=fields[startPos].name; for (int i = startPos; i < count; i++) { if (fields[i].name.equals(name)) { // cache the search result fields[startPos].nextPos=i; return i; } } fields[startPos].nextPos= MultiMap.LAST; return -1; }
public int findNext( int startPos ) { int next= fields[startPos].nextPos; if( next != MultiMap.NEED_NEXT ) { return next; } // next==NEED_NEXT, we never searched for this header MessageBytes name=fields[startPos].name; for (int i = startPos; i < count; i++) { if (fields[i].name.equals(name)) { // cache the search result fields[startPos].nextPos=i; return i; } } fields[startPos].nextPos= MultiMap.LAST; return -1; }
/** Find the index of a field with the given name. */ public int find( String name, int starting ) { // We can use a hash - but it's not clear how much // benefit you can get - there is an overhead // and the number of headers is small (4-5 ?) // Another problem is that we'll pay the overhead // of constructing the hashtable // A custom search tree may be better for (int i = starting; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
/** Find the index of a field with the given name. */ public int find( String name, int starting ) { // We can use a hash - but it's not clear how much // benefit you can get - there is an overhead // and the number of headers is small (4-5 ?) // Another problem is that we'll pay the overhead // of constructing the hashtable // A custom search tree may be better for (int i = starting; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
/** Find the index of a field with the given name. */ public int find( String name, int starting ) { // We can use a hash - but it's not clear how much // benefit you can get - there is an overhead // and the number of headers is small (4-5 ?) // Another problem is that we'll pay the overhead // of constructing the hashtable // A custom search tree may be better for (int i = starting; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
/** Find the index of a field with the given name. */ public int find( String name, int starting ) { // We can use a hash - but it's not clear how much // benefit you can get - there is an overhead // and the number of headers is small (4-5 ?) // Another problem is that we'll pay the overhead // of constructing the hashtable // A custom search tree may be better for (int i = starting; i < count; i++) { if (fields[i].name.equals(name)) { return i; } } return -1; }
public int findNext( int startPos ) { int next= fields[startPos].nextPos; if( next != MultiMap.NEED_NEXT ) { return next; } // next==NEED_NEXT, we never searched for this header MessageBytes name=fields[startPos].name; for (int i = startPos; i < count; i++) { if (fields[i].name.equals(name)) { // cache the search result fields[startPos].nextPos=i; return i; } } fields[startPos].nextPos= MultiMap.LAST; return -1; }
public int findNext( int startPos ) { int next= fields[startPos].nextPos; if( next != MultiMap.NEED_NEXT ) { return next; } // next==NEED_NEXT, we never searched for this header MessageBytes name=fields[startPos].name; for (int i = startPos; i < count; i++) { if (fields[i].name.equals(name)) { // cache the search result fields[startPos].nextPos=i; return i; } } fields[startPos].nextPos= MultiMap.LAST; return -1; }
/** * Was this request received on a secure connection? */ public boolean isSecure() { if (secure == null) { secure = request.scheme().equals("https"); } return (secure); }
/** * Parses the value of the JROUTE cookie, if present. */ void parseJrouteCookie() { Cookies serverCookies = request.getCookies(); int count = serverCookies.getCookieCount(); if (count <= 0) { return; } for (int i=0; i<count; i++) { ServerCookie scookie = serverCookies.getCookie(i); if (scookie.getName().equals(Constants.JROUTE_COOKIE)) { setJrouteId(scookie.getValue().toString()); break; } } }
/** * Parses the value of the JROUTE cookie, if present. */ void parseJrouteCookie() { Cookies serverCookies = request.getCookies(); int count = serverCookies.getCookieCount(); if (count <= 0) { return; } for (int i=0; i<count; i++) { ServerCookie scookie = serverCookies.getCookie(i); if (scookie.getName().equals(Constants.JROUTE_COOKIE)) { setJrouteId(scookie.getValue().toString()); break; } } }
/** * Parses the value of the JROUTE cookie, if present. */ void parseJrouteCookie() { Cookies serverCookies = request.getCookies(); int count = serverCookies.getCookieCount(); if (count <= 0) { return; } for (int i=0; i<count; i++) { ServerCookie scookie = serverCookies.getCookie(i); if (scookie.getName().equals(Constants.JROUTE_COOKIE)) { setJrouteId(scookie.getValue().toString()); break; } } }