예제 #1
0
 @Override
 public void add(SSOProviderVO provider) {
   PtBaseDAO dao = new PtBaseDAO();
   PtSsopropVO vo = SSOUtil.provider2prop(provider);
   try {
     dao.insertVO(vo);
   } catch (DAOException e) {
     LfwLogger.error(e.getMessage(), e);
   }
   PortalCacheManager.notify(
       CacheKeys.PORTAL_SSO_PROVIDER_CACHE, CacheKeys.PORTAL_SSO_PROVIDER_MAP_CACHE);
 }
예제 #2
0
  @SuppressWarnings("unchecked")
  @Override
  public void update(SSOProviderVO provider) {
    PtBaseDAO dao = new PtBaseDAO();
    try {
      List<PtSsopropVO> vos =
          (List<PtSsopropVO>)
              dao.retrieveByClause(
                  PtSsopropVO.class, " systemcode = '" + provider.getSystemCode() + "'");
      if (vos == null || vos.isEmpty()) {
        add(provider);
      } else {
        PtSsopropVO vo = SSOUtil.provider2prop(provider);
        vo.setPk_ssoprop(vos.get(0).getPk_ssoprop());
        dao.updateVO(vo);
      }

    } catch (Exception e) {
      LfwLogger.error(e.getMessage(), e);
    }
    PortalCacheManager.notify(
        CacheKeys.PORTAL_SSO_PROVIDER_CACHE, CacheKeys.PORTAL_SSO_PROVIDER_MAP_CACHE);
  }