-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
172 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 2 additions & 23 deletions
25
web/src/main/java/com/navercorp/pinpoint/web/vo/agent/AgentStatusFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,7 @@ | ||
package com.navercorp.pinpoint.web.vo.agent; | ||
|
||
import com.navercorp.pinpoint.common.server.util.AgentLifeCycleState; | ||
import java.util.function.Predicate; | ||
|
||
public interface AgentStatusFilter { | ||
boolean ACCEPT = true; | ||
boolean REJECT = false; | ||
public interface AgentStatusFilter extends Predicate<AgentStatus> { | ||
|
||
boolean filter(AgentStatus agentStatus); | ||
|
||
static boolean accept(AgentStatus agentStatus) { | ||
return ACCEPT; | ||
} | ||
|
||
static boolean reject(AgentStatus agentStatus) { | ||
return REJECT; | ||
} | ||
|
||
static boolean filterRunning(AgentStatus agentStatus) { | ||
if (agentStatus == null) { | ||
return REJECT; | ||
} | ||
if (agentStatus.getState() == AgentLifeCycleState.RUNNING) { | ||
return ACCEPT; | ||
} | ||
return REJECT; | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
web/src/main/java/com/navercorp/pinpoint/web/vo/agent/AgentStatusFilterChain.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
web/src/main/java/com/navercorp/pinpoint/web/vo/agent/AgentStatusFilters.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.navercorp.pinpoint.web.vo.agent; | ||
|
||
import com.navercorp.pinpoint.common.server.util.AgentLifeCycleState; | ||
|
||
public class AgentStatusFilters { | ||
|
||
private static final AgentStatusFilter RUNNING = new RunningAgentStatusFilter(); | ||
|
||
public static AgentStatusFilter running() { | ||
return RUNNING; | ||
} | ||
|
||
public static AgentStatusFilter common(long minEventTimestamp) { | ||
return new DefaultAgentStatusFilter(minEventTimestamp); | ||
} | ||
|
||
private static class RunningAgentStatusFilter implements AgentStatusFilter { | ||
@Override | ||
public boolean test(AgentStatus agentStatus) { | ||
if (agentStatus == null) { | ||
return false; | ||
} | ||
return agentStatus.getState() == AgentLifeCycleState.RUNNING; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.