Skip to content

Commit

Permalink
Merge pull request #41 from oneteme/develop
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
usfalami authored Feb 29, 2024
2 parents 4e3cbf7 + cbad4ab commit 1bcf5f1
Show file tree
Hide file tree
Showing 17 changed files with 509 additions and 499 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>io.github.oneteme.traceapi</groupId>
<artifactId>traceapi-core</artifactId>
<version>0.0.15-SNAPSHOT</version>
<version>0.0.16-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.github.oneteme</groupId>
Expand Down
112 changes: 0 additions & 112 deletions src/main/java/org/usf/trace/api/server/ApiController.java

This file was deleted.

14 changes: 6 additions & 8 deletions src/main/java/org/usf/trace/api/server/Exchange.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package org.usf.trace.api.server;

import org.usf.traceapi.core.IncomingRequest;
import org.usf.traceapi.core.OutcomingRequest;
import lombok.Setter;
import org.usf.traceapi.core.ApiSession;
import org.usf.traceapi.core.ApiRequest;

import lombok.Getter;

Expand All @@ -11,12 +12,9 @@
*
*/
@Getter
public final class Exchange extends OutcomingRequest {
@Setter
public final class Exchange extends ApiRequest {

private IncomingRequest remoteTrace;

public Exchange(String id) {
super(id);
}
private ApiSession remoteTrace;

}
15 changes: 5 additions & 10 deletions src/main/java/org/usf/trace/api/server/FilterCriteria.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
@AllArgsConstructor
public class FilterCriteria {

private final String[] idIncoming; //

private final String[] idMain;
private final String[] idSession; //
private final String[] name;
private final String[] env;
private final String[] port;
Expand All @@ -33,8 +31,7 @@ public class FilterCriteria {
private final Instant end;


public String toSql(Filters idIncomingColname,
Filters idMainColname,
public String toSql(Filters idSession,
Filters nameColname,
Filters envColname,
Filters portColname,
Expand All @@ -45,8 +42,7 @@ public String toSql(Filters idIncomingColname,
Collection<Integer> argTypes) {

var sql = " WHERE 1 = 1";
sql += toSql(idIncomingColname,args,argTypes,getIdIncoming());
sql += toSql(idMainColname,args,argTypes,getIdMain());
sql += toSql(idSession,args,argTypes,getIdSession());
sql += toSql(nameColname,args,argTypes,getName());
sql += toSql(envColname,args,argTypes,getEnv());
sql += toSql(portColname,args,argTypes,getPort());
Expand All @@ -70,7 +66,7 @@ String toSql(Filters colname, Collection<Object> args, Collection<Integer> argTy
if(values.length == 1){
return " AND "+ sql;
}
return " AND (" + sql + " " + colname + "IN(" + Utils.nArg(values.length) + "))";//error
return " AND (" + sql + " " + colname + " IN(" + Utils.nArg(values.length) + "))";//error
}
args.addAll(Arrays.asList(values));
argTypes.addAll(Collections.nCopies(values.length, colname.getType()));
Expand Down Expand Up @@ -101,8 +97,7 @@ String endToSql(Filters end , Collection<Object> args, Collection<Integer> argTy
@Override
public String toString() {
return "FilterCriteria{" +
"id=" + Arrays.toString(idIncoming) +
", host=" + Arrays.toString(name) +
"host=" + Arrays.toString(name) +
", env=" + Arrays.toString(env) +
", port=" + Arrays.toString(port) +
", start='" + start + '\'' +
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/usf/trace/api/server/Filters.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@


public enum Filters {
ID_IN_REQ(VARCHAR),
ID_MAIN_REQ(VARCHAR),
ID_SES(VARCHAR),
VA_APP_NME(VARCHAR),
VA_ENV(VARCHAR),
CD_PRT(INTEGER),
Expand Down
Loading

0 comments on commit 1bcf5f1

Please sign in to comment.