📄 muniqueipstatus.java
字号:
package net.jumperz.app.MGuardian.console;
import net.jumperz.util.*;
import java.awt.Color;
import java.util.*;
import net.jumperz.app.MGuardian.*;
public final class MUniqueIpStatus
extends MAbstractStatus
implements MObserver2
{
Set ipSet = new HashSet();
//--------------------------------------------------------------------------------
public void update( Object eventName, Object source )
{
if( eventName.equals( "getAccessLog" ) )
{
MSession session = ( MSession )source;
synchronized( ipSet )
{
ipSet.add( session.getClientRemoteAddr() );
}
}
}
//--------------------------------------------------------------------------------
public String getStatusName()
{
return "uniqueIp";
}
//--------------------------------------------------------------------------------
public String getStatusValue()
{
int count = ipSet.size();
synchronized( ipSet )
{
ipSet.clear();
}
return Integer.toString( count );
}
//--------------------------------------------------------------------------------
public String getTitle()
{
return "Unique IP Addresses";
}
//--------------------------------------------------------------------------------
public Color getAreaColor()
{
return new Color( 0xB5, 0xAB, 0x8C );
}
//--------------------------------------------------------------------------------
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -