Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
usfalami committed Jul 23, 2024
1 parent 55bf5bf commit 7c57ec7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
29 changes: 13 additions & 16 deletions src/main/java/org/usf/inspect/core/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,25 @@ public interface Session extends Metric {

default boolean append(SessionStage stage) {
if(stage instanceof RestRequest req) {
getRestRequests().add(req);
return getRestRequests().add(req);
}
else if(stage instanceof DatabaseRequest req) {
getDatabaseRequests().add(req);
if(stage instanceof DatabaseRequest req) {
return getDatabaseRequests().add(req);
}
else if(stage instanceof FtpRequest req) {
getFtpRequests().add(req);
if(stage instanceof FtpRequest req) {
return getFtpRequests().add(req);
}
else if(stage instanceof MailRequest req) {
getMailRequests().add(req);
if(stage instanceof MailRequest req) {
return getMailRequests().add(req);
}
else if(stage instanceof NamingRequest req) {
getLdapRequests().add(req);
if(stage instanceof NamingRequest req) {
return getLdapRequests().add(req);
}
else if(stage instanceof LocalRequest req) {
getLocalRequests().add(req);
if(stage instanceof LocalRequest req) {
return getLocalRequests().add(req);
}
else {
log.warn("unsupported session stage {}", stage);
return false;
}
return true;
log.warn("unsupported session stage {}", stage);
return false;
}

default void lock(){
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/usf/inspect/core/SessionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static <S extends Session> S requireCurrentSession(Class<S> clazz) {
if(clazz.isInstance(ses)) { //nullable
return clazz.cast(ses);
}
log.warn("unexpected session type expected={}, but was {}", clazz.getSimpleName(), ses);
log.warn("unexpected session type: expected={}, but was={}", clazz.getSimpleName(), ses);
return null;
}

Expand Down

0 comments on commit 7c57ec7

Please sign in to comment.