Skip to content

Commit

Permalink
Merge pull request #258 from gzurowski/fix-overrides
Browse files Browse the repository at this point in the history
Consistently use @OverRide annotation across all classes
  • Loading branch information
mikeycohen committed Aug 15, 2016
2 parents f5cdee4 + be3ad62 commit cdfd9c0
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class ZuulServletFilter implements Filter {

private ZuulRunner zuulRunner;

@Override
public void init(FilterConfig filterConfig) throws ServletException {

String bufferReqsStr = filterConfig.getInitParameter("buffer-requests");
Expand All @@ -59,6 +60,7 @@ public void init(FilterConfig filterConfig) throws ServletException {
zuulRunner = new ZuulRunner(bufferReqs);
}

@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
try {
init((HttpServletRequest) servletRequest, (HttpServletResponse) servletResponse);
Expand Down Expand Up @@ -117,8 +119,8 @@ void error(ZuulException e) {
zuulRunner.error();
}

@Override
public void destroy() {

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class GroovyCompiler implements DynamicCodeCompiler {
* @param sName
* @return
*/
@Override
public Class compile(String sCode, String sName) {
GroovyClassLoader loader = getGroovyClassLoader();
LOG.warn("Compiling filter: " + sName);
Expand All @@ -70,6 +71,7 @@ GroovyClassLoader getGroovyClassLoader() {
* @return
* @throws java.io.IOException
*/
@Override
public Class compile(File file) throws IOException {
GroovyClassLoader loader = getGroovyClassLoader();
Class groovyClass = loader.parseClass(file);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
*
*/
public class GroovyFileFilter implements FilenameFilter {

@Override
public boolean accept(File dir, String name) {
return name.endsWith(".groovy");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public HttpServletRequestWrapper(HttpServletRequest request) {
*
* @return The wrapped HttpServletRequest.
*/
@Override
public HttpServletRequest getRequest() {
try {
parseRequest();
Expand Down Expand Up @@ -262,6 +263,7 @@ public long getBodyBufferingTimeNs()
*
* @return A new ServletInputStream.
*/
@Override
public ServletInputStream getInputStream() throws IOException {
parseRequest();

Expand All @@ -275,6 +277,7 @@ public ServletInputStream getInputStream() throws IOException {
*
* @return A new BufferedReader with the wrapped request's character encoding (or UTF-8 if null).
*/
@Override
public BufferedReader getReader() throws IOException {
parseRequest();

Expand All @@ -289,6 +292,7 @@ public BufferedReader getReader() throws IOException {
*
* @see javax.servlet.ServletRequest#getParameter(java.lang.String)
*/
@Override
public String getParameter(String name) {
try {
parseRequest();
Expand All @@ -309,6 +313,7 @@ public String getParameter(String name) {
* @see javax.servlet.ServletRequest#getParameterMap()
*/
@SuppressWarnings("unchecked")
@Override
public Map getParameterMap() {
try {
parseRequest();
Expand All @@ -324,6 +329,7 @@ public Map getParameterMap() {
* @see javax.servlet.ServletRequest#getParameterNames()
*/
@SuppressWarnings("unchecked")
@Override
public Enumeration getParameterNames() {
try {
parseRequest();
Expand All @@ -334,10 +340,12 @@ public Enumeration getParameterNames() {
private String[] arr = getParameters().keySet().toArray(new String[0]);
private int idx = 0;

@Override
public boolean hasMoreElements() {
return idx < arr.length;
}

@Override
public String nextElement() {
return arr[idx++];
}
Expand All @@ -351,6 +359,7 @@ public String nextElement() {
*
* @see javax.servlet.ServletRequest#getParameterValues(java.lang.String)
*/
@Override
public String[] getParameterValues(String name) {
try {
parseRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public boolean hasRouteVIPOrHost() {
/**
* unsets the requestContextVariables
*/
@Override
public void unset() {
if (getZuulResponse() != null) {
getZuulResponse().close(); //check this?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private DefaultCassandraCache(ConcurrentMap<String, K> cacheMap) {
* @param keys
* @return
*/
@Override
public K fetchQuery(String... keys) {
final String key = buildKey(keys);
final K result = cacheMap.get(key);
Expand All @@ -92,6 +93,7 @@ public K fetchQuery(String... keys) {
* @param response
* @param keys
*/
@Override
public void storeQuery(K response, String... keys) {
final String key = buildKey(keys);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public void addFilterIdToIndex(String index, String filter_id) {
cassandraGateway.updateFilterIndex(index, filterIds);
}

@Override
public String getFilterIdsRaw(String index) {
Rows<String, String> result = cassandraGateway.select("select filter_ids from zuul_filter_indices where index_name = '" + index + "'");
if (result == null || result.isEmpty()) {
Expand All @@ -129,7 +130,7 @@ public String getFilterIdsRaw(String index) {
}
}


@Override
public List<String> getFilterIdsIndex(String index) {

String filter_ids = getFilterIdsRaw(index);
Expand Down Expand Up @@ -174,6 +175,7 @@ public List<String> getAllFilterIDs() {
return getFilterIdsIndex(FILTER_ID + ZuulApplicationInfo.getApplicationName());
}

@Override
public FilterInfo getFilterInfo(String filter_id, int revision) {
List<FilterInfo> filters = getZuulFiltersForFilterId(filter_id);
if (filters == null) return null;
Expand Down Expand Up @@ -509,6 +511,7 @@ public CassandraGatewayProd(Keyspace keyspace) {
this.keyspace = keyspace;
}

@Override
public void updateFilterIndex(String rowKey, String filter_ids) {

HashMap<String, Object> attributes = new HashMap<String, Object>();
Expand All @@ -523,6 +526,7 @@ public void updateFilterIndex(String rowKey, String filter_ids) {
* @param rowKey
* @param attributes
*/
@Override
public void upsert(String rowKey, Map<String, Object> attributes) {
new HystrixCassandraPut<String>(keyspace, COLUMN_FAMILY, rowKey, attributes).execute();
}
Expand All @@ -533,10 +537,12 @@ public void upsert(String rowKey, Map<String, Object> attributes) {
* @param cql
* @return
*/
@Override
public Rows<String, String> select(String cql) {
return new HystrixCassandraGetRowsByQuery<String>(keyspace, COLUMN_FAMILY, String.class, cql).execute();
}

@Override
public Rows<String, String> getByFilterIds(List<String> filterIds) {
String[] list = new String[filterIds.size()];
for (int i = 0; i < filterIds.size(); i++) {
Expand Down

0 comments on commit cdfd9c0

Please sign in to comment.