1 package org.apache.beehive.controls.runtime.servlet; 2 19 20 import javax.servlet.http.HttpServletRequest ; 21 import javax.servlet.http.HttpServletRequestWrapper ; 22 import javax.servlet.ServletRequest ; 23 24 31 class HttpRequestService extends ServletRequestService implements HttpServletRequest 32 { 33 38 private static class Wrapper extends HttpServletRequestWrapper 39 { 40 Wrapper(HttpRequestService requestService) 41 { 42 super(requestService); 43 _requestService = requestService; 44 } 45 46 52 public HttpServletRequest getRequest() 53 { 54 return _requestService.getHttpServletRequest(); 55 } 56 57 HttpRequestService _requestService; 58 } 59 60 HttpRequestService(ServletBeanContext beanContext) 61 { 62 super(beanContext); 63 } 64 65 final protected HttpServletRequest getHttpServletRequest() 66 { 67 ServletRequest servletRequest = getServletBeanContext().getServletRequest(); 68 if (! (servletRequest instanceof HttpServletRequest )) 69 throw new IllegalStateException ("Current request is not an HttpServletRequest"); 70 return (HttpServletRequest )servletRequest; 71 } 72 73 78 HttpServletRequestWrapper getHttpRequestWrapper() 79 { 80 return new Wrapper (this); 81 } 82 83 public java.lang.String getAuthType() 84 { 85 return getHttpServletRequest().getAuthType(); 86 } 87 88 public javax.servlet.http.Cookie [] getCookies() 89 { 90 return getHttpServletRequest().getCookies(); 91 } 92 93 public long getDateHeader(java.lang.String name) 94 { 95 return getHttpServletRequest().getDateHeader(name); 96 } 97 98 public java.lang.String getHeader(java.lang.String name) 99 { 100 return getHttpServletRequest().getHeader(name); 101 } 102 103 public java.util.Enumeration getHeaders(java.lang.String name) 104 { 105 return getHttpServletRequest().getHeaders(name); 106 } 107 108 public java.util.Enumeration getHeaderNames() 109 { 110 return getHttpServletRequest().getHeaderNames(); 111 } 112 113 public int getIntHeader(java.lang.String name) 114 { 115 return getHttpServletRequest().getIntHeader(name); 116 } 117 118 public java.lang.String getMethod() 119 { 120 return getHttpServletRequest().getMethod(); 121 } 122 123 public java.lang.String getPathInfo() 124 { 125 return getHttpServletRequest().getPathInfo(); 126 } 127 128 public java.lang.String getPathTranslated() 129 { 130 return getHttpServletRequest().getPathTranslated(); 131 } 132 133 public java.lang.String getContextPath() 134 { 135 return getHttpServletRequest().getContextPath(); 136 } 137 138 public java.lang.String getQueryString() 139 { 140 return getHttpServletRequest().getQueryString(); 141 } 142 143 public java.lang.String getRemoteUser() 144 { 145 return getHttpServletRequest().getRemoteUser(); 146 } 147 148 public boolean isUserInRole(java.lang.String role) 149 { 150 return getHttpServletRequest().isUserInRole(role); 151 } 152 153 public java.security.Principal getUserPrincipal() 154 { 155 return getHttpServletRequest().getUserPrincipal(); 156 } 157 158 public java.lang.String getRequestedSessionId() 159 { 160 return getHttpServletRequest().getRequestedSessionId(); 161 } 162 163 public java.lang.String getRequestURI() 164 { 165 return getHttpServletRequest().getRequestURI(); 166 } 167 168 public java.lang.StringBuffer getRequestURL() 169 { 170 return getHttpServletRequest().getRequestURL(); 171 } 172 173 public java.lang.String getServletPath() 174 { 175 return getHttpServletRequest().getServletPath(); 176 } 177 178 public javax.servlet.http.HttpSession getSession(boolean create) 179 { 180 return getHttpServletRequest().getSession(create); 181 } 182 183 public javax.servlet.http.HttpSession getSession() 184 { 185 return getHttpServletRequest().getSession(); 186 } 187 188 public boolean isRequestedSessionIdValid() 189 { 190 return getHttpServletRequest().isRequestedSessionIdValid(); 191 } 192 193 public boolean isRequestedSessionIdFromCookie() 194 { 195 return getHttpServletRequest().isRequestedSessionIdFromCookie(); 196 } 197 198 public boolean isRequestedSessionIdFromURL() 199 { 200 return getHttpServletRequest().isRequestedSessionIdFromURL(); 201 } 202 203 public boolean isRequestedSessionIdFromUrl() 204 { 205 return getHttpServletRequest().isRequestedSessionIdFromUrl(); 206 } 207 } 208 | Popular Tags |