Exemple #1
0
  @Override
  public int getCountOfImeisRecorded(String userAdmin) throws MSMApplicationException {
    IMEIManager imeiManager = null;

    int qtde = 0;

    try {
      InitialContext initialContext = new InitialContext();
      imeiManager = (IMEIManager) initialContext.lookup("ndg-core/IMEIManagerBean/remote");
    } catch (NamingException e) {
      e.printStackTrace();
    }

    ArrayList<Object> queryResult = listAllUsers(userAdmin, null).getQueryResult();

    ArrayList<UserVO> listUsers = new ArrayList<UserVO>();

    for (Iterator iterator = queryResult.iterator(); iterator.hasNext(); ) {
      UserVO object = (UserVO) iterator.next();
      listUsers.add(object);
    }

    for (UserVO userVO : listUsers) {
      qtde += imeiManager.findImeiByUser(userVO.getUsername(), null, true).getQueryResult().size();
    }

    return qtde;
  }
 public QueryInputOutputVO getImeisByUser(
     String username, QueryInputOutputVO queryIOVO, boolean withFakeImeis)
     throws MSMApplicationException {
   return imeiManager.findImeiByUser(username, queryIOVO, withFakeImeis);
 }