本文整理汇总了Java中org.apache.directory.fortress.core.model.UserAudit.setBeginDate方法的典型用法代码示例。如果您正苦于以下问题:Java UserAudit.setBeginDate方法的具体用法?Java UserAudit.setBeginDate怎么用?Java UserAudit.setBeginDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.directory.fortress.core.model.UserAudit
的用法示例。
在下文中一共展示了UserAudit.setBeginDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBindReport
import org.apache.directory.fortress.core.model.UserAudit; //导入方法依赖的package包/类
/**
*
*/
void getBindReport()
{
ReaderUtil.clearScreen();
try
{
System.out.println("Enter userId value to search Audit Binds with or null to retrieve all:");
String val = ReaderUtil.readLn();
UserAudit uAudit = new UserAudit();
uAudit.setUserId(val);
System.out.println("Check for failed only? (Enter 'Y' for yes or 'N' for no");
val = ReaderUtil.readLn();
if (val.equalsIgnoreCase("Y"))
uAudit.setFailedOnly(true);
System.out.println("Check within the last n hours? Enter number of hours or null for unlimited");
val = ReaderUtil.readLn();
if (val != null && val.length() > 0)
{
int hours = Integer.parseInt(val);
Date date = new Date();
long millis = date.getTime();
millis = millis - (1000 * 60 * 60 * hours);
Date date2 = new Date(millis);
uAudit.setBeginDate(date2);
}
List<Bind> list = am.searchBinds(uAudit);
printAuthNReport(list);
System.out.println("ENTER to continue");
}
catch (SecurityException e)
{
LOG.error("getBindReport caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
示例2: getAuthReport
import org.apache.directory.fortress.core.model.UserAudit; //导入方法依赖的package包/类
/**
*
*/
void getAuthReport()
{
ReaderUtil.clearScreen();
try
{
UserAudit uAudit = new UserAudit();
System.out.println("Enter userId to search Audit AuthZs with:");
String val = ReaderUtil.readLn();
if(StringUtils.isNotEmpty( val ))
{
uAudit.setUserId(val);
System.out.println("size=" + val.length() + " val=" + val);
}
else
{
System.out.println("val is empty or null");
}
//uAudit.setUserId(val);
System.out.println("Check for failed only? (Enter 'Y' for yes or 'N' for no");
val = ReaderUtil.readLn();
if (val.equalsIgnoreCase("Y"))
uAudit.setFailedOnly(true);
System.out.println("Check within the last n hours? Enter number of hours or null for unlimited");
val = ReaderUtil.readLn();
if (val != null && val.length() > 0)
{
int hours = Integer.parseInt(val);
Date date = new Date();
long millis = date.getTime();
millis = millis - (1000 * 60 * 60 * hours);
Date date2 = new Date(millis);
uAudit.setBeginDate(date2);
}
List<AuthZ> list = am.getUserAuthZs(uAudit);
printAuthZReport(list);
System.out.println("ENTER to continue");
}
catch (SecurityException e)
{
LOG.error("getAuthReport caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
示例3: getModReport
import org.apache.directory.fortress.core.model.UserAudit; //导入方法依赖的package包/类
/**
*
*/
void getModReport()
{
ReaderUtil.clearScreen();
try
{
UserAudit uAudit = new UserAudit();
System.out.println("Enter userId to search Audit Mods with:");
String val = ReaderUtil.readLn();
if(StringUtils.isNotEmpty( val ))
{
uAudit.setUserId(val);
System.out.println("size=" + val.length() + " val=" + val);
}
else
{
System.out.println("val is empty or null");
}
System.out.println("Check within the last n hours? Enter number of hours or null for unlimited");
val = ReaderUtil.readLn();
if (val != null && val.length() > 0)
{
int hours = Integer.parseInt(val);
Date date = new Date();
long millis = date.getTime();
millis = millis - (1000 * 60 * 60 * hours);
Date date2 = new Date(millis);
uAudit.setBeginDate(date2);
}
List<Mod> list = am.searchUserSessions(uAudit);
printMods(list);
System.out.println("ENTER to continue");
}
catch (SecurityException e)
{
LOG.error("getModReport caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
示例4: getAdminModReport
import org.apache.directory.fortress.core.model.UserAudit; //导入方法依赖的package包/类
void getAdminModReport()
{
ReaderUtil.clearScreen();
try
{
UserAudit uAudit = new UserAudit();
System.out.println("Enter userId to search Audit Mods with or NULL for skip:");
String val = ReaderUtil.readLn();
if(StringUtils.isNotEmpty( val ))
{
uAudit.setUserId(val);
System.out.println("size=" + val.length() + " val=" + val);
}
System.out.println("Check within the last n hours? Enter number of hours or null for unlimited");
val = ReaderUtil.readLn();
if (val != null && val.length() > 0)
{
int hours = Integer.parseInt(val);
Date date = new Date();
long millis = date.getTime();
millis = millis - (1000 * 60 * 60 * hours);
Date date2 = new Date(millis);
uAudit.setBeginDate(date2);
}
/*
System.out.println("Enter begin time and date - format YYYYMMDDHHMM or null for unlimited");
val = ReaderUtil.readLn();
if (val != null && val.length() > 0)
{
//int hours = Integer.parseInt(val);
int year = new Integer(val.substring(0, 3));
int month = new Integer(val.substring(0, 3));
int day = new Integer(val.substring(0, 3));
Date date = new Date();
java.sql.Date date2 = new java.sql.Date(2011, 11, 25);
date2.getTime();
long millis = date.getTime();
millis = millis - (1000 * 60 * 60 * hours);
Date date2 = new Date(millis);
uAudit.setBeginDate(date2);
} */
System.out.println("Enter admin object name to search Audit Mods with or NULL for skip:");
val = ReaderUtil.readLn();
if(StringUtils.isNotEmpty( val ))
{
uAudit.setObjName(val);
System.out.println("size=" + val.length() + " val=" + val);
}
System.out.println("Enter admin operation name to search Audit Mods with or NULL for skip:");
val = ReaderUtil.readLn();
if(StringUtils.isNotEmpty( val ))
{
uAudit.setOpName(val);
System.out.println("size=" + val.length() + " val=" + val);
}
List<Mod> list = am.searchAdminMods(uAudit);
printMods(list);
System.out.println("ENTER to continue");
}
catch (SecurityException e)
{
LOG.error("getAdminModReport caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
示例5: getAuthNInvalidReport
import org.apache.directory.fortress.core.model.UserAudit; //导入方法依赖的package包/类
void getAuthNInvalidReport()
{
ReaderUtil.clearScreen();
try
{
UserAudit uAudit = new UserAudit();
System.out.println("Enter userId to search Audit AuthZs with:");
String val = ReaderUtil.readLn();
if( StringUtils.isNotEmpty( val ))
{
uAudit.setUserId(val);
System.out.println("size=" + val.length() + " val=" + val);
}
else
{
System.out.println("val is empty or null");
}
//uAudit.setUserId(val);
//System.out.println("Check for failed only? (Enter 'Y' for yes or 'N' for no");
//val = ReaderUtil.readLn();
//if (val.equalsIgnoreCase("Y"))
uAudit.setFailedOnly(true);
System.out.println("Check within the last n hours? Enter number of hours or null for unlimited");
val = ReaderUtil.readLn();
if (val != null && val.length() > 0)
{
int hours = Integer.parseInt(val);
Date date = new Date();
long millis = date.getTime();
millis = millis - (1000 * 60 * 60 * hours);
Date date2 = new Date(millis);
uAudit.setBeginDate(date2);
}
List<AuthZ> list = am.searchInvalidUsers(uAudit);
printfailedAuthNReport(list);
System.out.println("ENTER to continue");
}
catch (SecurityException e)
{
LOG.error("getAuthNInvalidReport caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}