Package com.foxconn.gds.security.model

Examples of com.foxconn.gds.security.model.BlackItem


public class BlackListServicesTest {

  @Test
  public void testCreateBlackItem() {
    IBlackListServices blackSrv = BlackListServices.getInstance();
    BlackItem blackItem = new BlackItem("1-acc-0", BlackItem.UserStatus.PENDING, "http://10.148.73.52:8080/FHS/redirectPage.jsp");
    blackSrv.createBlackItem(blackItem);
  }
View Full Code Here


    } else {
      userId = (String) req.getSession(true).getAttribute("__USER_ID__");
    }
    if (userId != null) {
      // 檢查此用戶是否在黑名單中
      BlackItem item = BlackListServices.getInstance()
          .findBlackItemByUserId(userId);
      if (item != null) {
        // forward or redirect
        logger.info("callback.URL=" + item.getCallbackURL());
        if (!(req.getRequestURL().toString()).endsWith(item.getCallbackURL())) {
          res.sendRedirect(item.getCallbackURL());
          return;
        }
      }
    }
    chain.doFilter(request, response);
View Full Code Here

    // 若狀態為killed 或者 pending的使用者企圖使用本應用系統時(例如:傳送新的request),
    // 需拒絕存取並將該使用者重新導向到對應的callbackURL當中。
   
    if (isKilled(status) || isPending(status))  {
      BlackItem item = new BlackItem(userid, status, callbackURL);
      BlackListServices.getInstance().saveOrUpdateBlackItem(item);
    }
   
//    if (isPending(status))
//      ;
View Full Code Here

   */
  public BlackItem findBlackItemByUserId(String userId) {
    log.info("enter findBlackItemByUserId ...");
    String hql = "FROM BlackItem WHERE userId=:userId";
    EntityManager em = null;
    BlackItem item = null;
    try {
      em = entityManagerFactory.createEntityManager();
      item = (BlackItem) em.createQuery(hql).setParameter("userId",
          userId).getSingleResult();
    } catch (NoResultException err) {
View Full Code Here

TOP

Related Classes of com.foxconn.gds.security.model.BlackItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.