Change-Id: I3eadc1e238a6f73d2dee1b6ced9b1d6033ded85e
Issue-ID: AAI-1203
Signed-off-by: Shwetank Dave <shwetank.dave@amdocs.com>
import java.util.Map;
import java.util.Optional;
import java.util.Timer;
import java.util.Map;
import java.util.Optional;
import java.util.Timer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
private Logger logger = LoggerFactory.getInstance().getLogger(ChampRESTAPI.class);
Logger auditLogger = LoggerFactory.getInstance().getAuditLogger(ChampRESTAPI.class.getName());
private static Logger metricsLogger = LoggerFactory.getInstance().getMetricsLogger(ChampRESTAPI.class.getName());
private Logger logger = LoggerFactory.getInstance().getLogger(ChampRESTAPI.class);
Logger auditLogger = LoggerFactory.getInstance().getAuditLogger(ChampRESTAPI.class.getName());
private static Logger metricsLogger = LoggerFactory.getInstance().getMetricsLogger(ChampRESTAPI.class.getName());
+ private static final Pattern QUERY_OBJECT_ID_URL_MATCH = Pattern.compile("_reserved_(.*)");
+
public ChampRESTAPI(ChampDataService champDataService, ChampAsyncRequestProcessor champAsyncRequestProcessor) {
this.champDataService = champDataService;
public ChampRESTAPI(ChampDataService champDataService, ChampAsyncRequestProcessor champAsyncRequestProcessor) {
this.champDataService = champDataService;
Map<String, Object> filter = new HashMap<>();
for (Map.Entry<String, List<String>> e : uriInfo.getQueryParameters().entrySet()) {
Map<String, Object> filter = new HashMap<>();
for (Map.Entry<String, List<String>> e : uriInfo.getQueryParameters().entrySet()) {
- if (!e.getKey().equals(propertiesKey)) {
+ if ((!e.getKey().equals(propertiesKey)) && !reservedKeyMatcher ( QUERY_OBJECT_ID_URL_MATCH, e.getKey () )) {
filter.put(e.getKey(), e.getValue().get(0));
}
}
filter.put(e.getKey(), e.getValue().get(0));
}
}
List<ChampRelationship> list;
Map<String, Object> filter = new HashMap<>();
for (Map.Entry<String, List<String>> e : uriInfo.getQueryParameters().entrySet()) {
List<ChampRelationship> list;
Map<String, Object> filter = new HashMap<>();
for (Map.Entry<String, List<String>> e : uriInfo.getQueryParameters().entrySet()) {
- filter.put(e.getKey(), e.getValue().get(0));
+ if (!reservedKeyMatcher ( QUERY_OBJECT_ID_URL_MATCH, e.getKey () )) {
+ filter.put ( e.getKey (), e.getValue ().get ( 0 ) );
+ }
}
Response response = null;
try {
}
Response response = null;
try {
+ private boolean reservedKeyMatcher(Pattern p, String key) {
+ Matcher m = p.matcher ( key );
+ if (m.matches()) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+