METRON-503: Metron REST API #316
Changes from 60 commits
b7d310e
77e79ab
b042dfd
2012369
d9ea03e
b73e808
072f3ec
d4ff470
50b4cf4
46d0ff3
53c3340
0a329c7
ce11ab5
7db0810
8825a85
35240d2
d38b626
f1ce2d0
25bc44e
a91ce50
c916800
b8ef856
6be6a0a
786aa97
385bcb0
5d86575
edd4b87
11fa4ae
07f1a5f
bd4b81b
6b8babc
adce921
8040ab3
2861756
55fb3d0
9bab502
2fc78d6
a76ba8e
b1a19d5
901a6b7
0a784d5
88c1f7d
98f6caf
1253242
6f75348
fd62add
7b5da86
13e3520
9b75f7e
8ea6ae5
e46a0f1
45f94a8
42d0491
a03f78c
5443cd8
f26c166
0ca2dc7
a354591
d07f31f
940f7ba
65f5173
a3d36d2
39ffba8
23cd26e
cc84429
11fb735
6f3fc0b
1d397f6
de99543
5db12aa
3fcf123
52f87fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Licensed to the Apache Software | ||
Foundation (ASF) under one or more contributor license agreements. See the | ||
NOTICE file distributed with this work for additional information regarding | ||
copyright ownership. The ASF licenses this file to You under the Apache License, | ||
Version 2.0 (the "License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software distributed | ||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES | ||
OR CONDITIONS OF ANY KIND, either express or implied. See the License for | ||
the specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.apache.metron</groupId> | ||
<artifactId>metron-interface</artifactId> | ||
<version>0.3.0</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we need to update this to 0.3.1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
</parent> | ||
<artifactId>metron-rest-client</artifactId> | ||
<properties> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.metron</groupId> | ||
<artifactId>metron-common</artifactId> | ||
<version>${project.parent.version}</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4 spaces instead of 2. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realized after I opened the PR that there were files that had different spacing. I was planning on waiting until we finished the review process to do this because it will make it easier for you to review the incremental changes. Is that ok? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @merrimanr i think that's a really good idea. You're right, changing the spaces would add a lot of distractions. |
||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.metron.rest.model; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class GrokValidation { | ||
|
||
private String statement; | ||
private String sampleData; | ||
private Map<String, Object> results; | ||
|
||
public String getStatement() { | ||
return statement; | ||
} | ||
|
||
public void setStatement(String statement) { | ||
this.statement = statement; | ||
} | ||
|
||
public String getSampleData() { | ||
return sampleData; | ||
} | ||
|
||
public void setSampleData(String sampleData) { | ||
this.sampleData = sampleData; | ||
} | ||
|
||
public Map<String, Object> getResults() { | ||
if (results == null) { | ||
return new HashMap<>(); | ||
} | ||
return results; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could possible result in a NPE. Does it make sense to check for this and return an empty map if that is the case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
} | ||
|
||
public void setResults(Map<String, Object> results) { | ||
this.results = results; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
GrokValidation that = (GrokValidation) o; | ||
|
||
if (statement != null ? !statement.equals(that.statement) : that.statement != null) return false; | ||
if (sampleData != null ? !sampleData.equals(that.sampleData) : that.sampleData != null) return false; | ||
return results != null ? results.equals(that.results) : that.results == null; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = statement != null ? statement.hashCode() : 0; | ||
result = 31 * result + (sampleData != null ? sampleData.hashCode() : 0); | ||
result = 31 * result + (results != null ? results.hashCode() : 0); | ||
return result; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is very minor, but are we doing the 2 space indent rule? If so this looks to be 4.