Package com.wot.shared

Examples of com.wot.shared.CommunityClan


  /**
   * getAllMembersClan : REcupére tous les menbres du clan
   */
  @Override
  public CommunityClan getAllMembersClan(String idClan) {
    CommunityClan communityClan = null;
   
    DaoCommunityClan2 daoCommunityClan = null;
    Clan desClan =null;
    // Verify that the input is valid.
    if (!FieldVerifier.isValidName(idClan)) {
View Full Code Here


    DaoCommunityClan2 daoCommunityClan = gson.fromJson(AllLines, DaoCommunityClan2.class);
    daoCommunityClan.setIdClan(idClan);
    daoCommunityClan.setDateCommunityClan(date);
    //persist clan ?
   
    CommunityClan communityClan = TransformDtoObject.TransformCommunityDaoCommunityClanToCommunityClan(daoCommunityClan);
    if (communityClan != null) {
 
      DataCommunityClan myDataCommunityClan = communityClan.getData();
      List<DataCommunityClanMembers> listClanMembers = myDataCommunityClan.getMembers();
 
      for (DataCommunityClanMembers dataClanMember : listClanMembers) {
        for (DataCommunityMembers member : dataClanMember.getMembers()) {
          log.warning("membermember " + member.getAccount_name() + " " + member.getAccount_id() );
View Full Code Here

        if(resultsTmp.size() >= )
        {      
          DaoCommunityClan2 myPrevDaoCommunityClan = resultsTmp.get(0);
         
          //construction de la hashMap des id et name du ser
        CommunityClan prevCommunityClan = TransformDtoObject.TransformCommunityDaoCommunityClanToCommunityClan(myPrevDaoCommunityClan);
        if (prevCommunityClan != null) {

          DataCommunityClan myDataCommunityClan = prevCommunityClan.getData();
          List<DataCommunityClanMembers> listClanMembers = myDataCommunityClan.getMembers();

          for (DataCommunityClanMembers dataClanMember : listClanMembers) {
            for (DataCommunityMembers member : dataClanMember.getMembers()) {
              log.warning("previous member " + member.getAccount_name() + " " + member.getAccount_id() );
              String idUser = member.getAccount_id();
              //log.warning("Previous User " + member.getAccount_name());
              mapPrevDaoMembers.put(idUser, member.getAccount_name());
            }
          }//for (DataCommunityClanMembers
        } else {

          log.severe("Erreur de parse sur myPrevDaoCommunityClan");
        }
         
          //recup des membres courant
          if (mapPrevDaoMembers != null && mapPrevDaoMembers.size() > 0 ) {
          CommunityClan currentCommunityClan = TransformDtoObject.TransformCommunityDaoCommunityClanToCommunityClan(daoCommunityClan);

          if (currentCommunityClan != null) {

            DataCommunityClan myDataCommunityClan = currentCommunityClan.getData();
            List<DataCommunityClanMembers> listClanMembers = myDataCommunityClan.getMembers();

            for (DataCommunityClanMembers dataClanMember : listClanMembers) {
              for (DataCommunityMembers member : dataClanMember.getMembers()) {
                log.warning("member " + member.getAccount_name() + " " + member.getAccount_id() );
                String idUser = member.getAccount_id();
                //log.warning("Previous User " + member.getAccount_name());
                mapCurrentDaoMembers.put(idUser, member.getAccount_name());
              }
            }//for (DataCommunityClanMembers
          } else {

            log.severe("Erreur de parse sur currentCommunityClan");
          }
          }
         
          //comparaison des 2 liste de users
           Set<Entry<String, String>>  entryCurrentDaoMembers =  mapCurrentDaoMembers.entrySet();
           Set<Entry<String, String>>  entryPrevDaoMembers =  mapPrevDaoMembers.entrySet();
          
           String userAdded = "";
           String userDeleted = "";
          
           for(Entry<String, String> entryCurrentDaoMember : entryCurrentDaoMembers) {
            
             if (!mapPrevDaoMembers.containsKey(entryCurrentDaoMember.getKey())  ) {
               //joueur nouveau ds Clan
               log.warning("joueur ajouté " + entryCurrentDaoMember.getValue());
               userAdded = userAdded + " " + entryCurrentDaoMember.getValue();

             }else {
               log.warning("joueur deja la  " + entryCurrentDaoMember.getValue());
             }
            
           }
          
           for(Entry<String, String> entryPrevDaoMember : entryPrevDaoMembers) {
            
             if (!mapCurrentDaoMembers.containsKey(entryPrevDaoMember.getKey())) {
               //Joueur parti du clan
               log.warning("joueur parti du clan " + entryPrevDaoMember.getValue());
               userDeleted = userDeleted + " " + entryPrevDaoMember.getValue();
             }else {
               log.warning("joueur tjrs la " + entryPrevDaoMember.getValue());
             }
            
           }
           daoCommunityClan.setUserAdded(userAdded);
           daoCommunityClan.setUserDeleted(userDeleted);
         
        }
       
        }
      catch(Exception e){
        e.printStackTrace();
        log.log(Level.SEVERE, "Exception while saving daoCommunityClan", e);
          pm.currentTransaction().rollback();
        }
   
       
    //On persist le clan et ses joueurs pour trouver ceux qui partent et qui arrivent
    //pm = PMF.get().getPersistenceManager();
    pm =null;
    pm = PMF.get().getPersistenceManager();
        try {
          pm.currentTransaction().begin();
          pm.makePersistent(daoCommunityClan);
          pm.currentTransaction().commit();
        }
      catch(Exception e){
        e.printStackTrace();
        log.log(Level.SEVERE, "Exception while saving daoCommunityClan", e);
          pm.currentTransaction().rollback();
        }
         

   
 
   
    //construction de la hashMap des id et name du ser
    CommunityClan communityClan = TransformDtoObject.TransformCommunityDaoCommunityClanToCommunityClan(daoCommunityClan);
    if (communityClan != null) {

      DataCommunityClan myDataCommunityClan = communityClan.getData();
      List<DataCommunityClanMembers> listClanMembers = myDataCommunityClan.getMembers();

      for (DataCommunityClanMembers dataClanMember : listClanMembers) {
        for (DataCommunityMembers member : dataClanMember.getMembers()) {
          log.warning("membermember " + member.getAccount_name() + " " + member.getAccount_id() );
View Full Code Here

    DaoCommunityClan2 daoCommunityClan = gson.fromJson(AllLines, DaoCommunityClan2.class);
    daoCommunityClan.setIdClan(idClan);
    daoCommunityClan.setDateCommunityClan(date);
    //persist clan ?
   
    CommunityClan communityClan = TransformDtoObject.TransformCommunityDaoCommunityClanToCommunityClan(daoCommunityClan);
    if (communityClan != null) {

      DataCommunityClan myDataCommunityClan = communityClan.getData();
      List<DataCommunityClanMembers> listClanMembers = myDataCommunityClan.getMembers();
     
      String accountName = null;
      for (DataCommunityClanMembers dataClanMember : listClanMembers) {
        for (DataCommunityMembers member : dataClanMember.getMembers()) {
View Full Code Here

//  }

  //== new 
  public static CommunityClan TransformCommunityDaoCommunityClanToCommunityClan(DaoCommunityClan2 daoCommunityClan ) {
   
    CommunityClan communityClan = new CommunityClan();
    //communityClan.setStatus( daoCommunityClan.getStatus());
    //communityClan.setStatus_code(daoCommunityClan.getStatus_code());
   
    communityClan.setIdClan(daoCommunityClan.getIdClan());
    communityClan.setDateCommunityClan(daoCommunityClan.getDateCommunityClan());
   
    communityClan.setData(TransformDaoDataCommunityClanToDataCommunityClan(daoCommunityClan.getData()));
    return communityClan;
  }
View Full Code Here

  /**
   * getAllMembersClan : REcupére tous les menbres du clan
   */
  @Override
  public CommunityClan getAllMembersClan(String idClan) {
    CommunityClan communityClan = null;
   
    DaoCommunityClan2 daoCommunityClan = null;
    Clan desClan =null;
    // Verify that the input is valid.
    if (!FieldVerifier.isValidName(idClan)) {
View Full Code Here

      DaoCommunityClan2 daoCommunityClan = gson.fromJson(AllLines, DaoCommunityClan2.class);
      daoCommunityClan.setIdClan(idClan);
      daoCommunityClan.setDateCommunityClan(date);
      //persist clan ?
     
      CommunityClan communityClan = TransformDtoObject.TransformCommunityDaoCommunityClanToCommunityClan(daoCommunityClan);
      if (communityClan != null) {
 
        DataCommunityClan myDataCommunityClan = communityClan.getData();
        List<DataCommunityClanMembers> listClanMembers = myDataCommunityClan.getMembers();
 
        for (DataCommunityClanMembers dataClanMember : listClanMembers) {
          for (DataCommunityMembers member : dataClanMember.getMembers()) {
            log.warning("membermember " + member.getAccount_name() + " " + member.getAccount_id() );
View Full Code Here

//  }

  //== new 
  public static CommunityClan TransformCommunityDaoCommunityClanToCommunityClan(DaoCommunityClan2 daoCommunityClan ) {
   
    CommunityClan communityClan = new CommunityClan();
    communityClan.setStatus( daoCommunityClan.getStatus());
    communityClan.setStatus_code(daoCommunityClan.getStatus_code());
   
    communityClan.setIdClan(daoCommunityClan.getIdClan());
    communityClan.setDateCommunityClan(daoCommunityClan.getDateCommunityClan());
   
    communityClan.setData(TransformDaoDataCommunityClanToDataCommunityClan(daoCommunityClan.getData()));
    return communityClan;
  }
View Full Code Here

TOP

Related Classes of com.wot.shared.CommunityClan

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.