Package profil

Examples of profil.ProfilSocial


  public static void main(String[] args) {

    try {
      new Serveur();
     
      Client.newProfil(new ProfilSocial("tarek", "azerty", "JAOUANI", "Tarek", Sexe.H));

      System.out.println(Client.getProfil("tarek").getNom());
    } catch (RemoteException e) {
      e.printStackTrace();
    } catch (ProfilException e) {
View Full Code Here


  }

  @Override
  public boolean publier(String pseudo, Publication publication) throws RemoteException {
    HashMap<String, Profil> profils;
    ProfilSocial profil;
    try {
      // Récupération de la liste des profils
      profils = Serialiser.deserialiser(Constantes.PROFIL);
     
      // Récupération du profil correspondant
      profil = (ProfilSocial)profils.get(pseudo);
     
      // Ajout de la publication à la liste des publications
      profil.addPublication(publication);
     
      // Mise à jour de la liste des profils
      profils.put(pseudo, profil);
     
      // Enregistrement de la nouvelle liste
View Full Code Here

  @Override
  public boolean commenter(Publication publication, Commentaire commentaire, String nom) throws RemoteException {
    Publication pb = null;
   
    HashMap<String, Profil> profils;
    ProfilSocial profil;
   
    try {
      // Récupération de la liste des profils
      profils = Serialiser.deserialiser(Constantes.PROFIL);

      try {
        // Récupération du profil correspondant
        profil = (ProfilSocial)profils.get(nom);
       
        // Récupération de la publication à commenter
        for (Publication pub : profil.getPublications()) {
          if (pub.getDate().compareTo(publication.getDate()) == 0 || pub.getPseudo().equals(publication.getPseudo())) {
            pb = pub;
            break;
          }
        }
View Full Code Here

  @Override
  public boolean like(Publication publication, String nom, boolean like, String pseudo) throws RemoteException {
    Publication pb = null;
   
    HashMap<String, Profil> profils;
    ProfilSocial profil;
   
    try {
      // Récupération de la liste des profils
      profils = Serialiser.deserialiser(Constantes.PROFIL);

      try {
        // Récupération du profil correspondant
        profil = (ProfilSocial)profils.get(nom);
       
        // Récupération de la publication à aimer (ou non)
        for (Publication pub : profil.getPublications()) {
          if (pub.getDate().equals(publication.getDate()) && pub.getPseudo().equals(publication.getPseudo())) {
            pb = pub;
            break;
          }
        }
View Full Code Here

      // Récupération de la liste des groupes
      HashMap<String,Groupe> groupes = Serialiser.deserialiser(Constantes.GROUPES);
      HashMap<String,Profil> profils = Serialiser.deserialiser(Constantes.PROFIL);

      // Ajout du groupe aux centres d'interets du profil
      ProfilSocial profil = (ProfilSocial)profils.get(pseudo);
      profil.addInteret(groupe);
      profils.put(pseudo, profil);
     
      // Récupération du groupe concerné
      Groupe gr = groupes.get(groupe);
     
View Full Code Here

  public static void main(String[] args) {
    File f = new File(Constantes.PROFIL);
    f.delete();
   
    try {
      Client.newProfil(new ProfilSocial("tarek.tarek13", "azerty", "JAOUANI", "Tarek", Sexe.H));
      Client.newProfil(new ProfilSocial("kevkev69", "azerty", "FRANCES", "Kévin", Sexe.H));
      Client.newProfil(new ProfilSocial("dalleria", "azerty", "DALLE-RIVE", "Antoine", Sexe.H));
      Client.newProfil(new ProfilSocial("calleay", "azerty", "CALLEA", "Yohann", Sexe.H));
      Client.newProfil(new ProfilSocial("bab", "azerty", "CISSE", "Babacar", Sexe.H));
      Client.newProfil(new ProfilSocial("aitmachin", "azerty", "AIT-MAMA", "Meryeme", Sexe.F));
    } catch (IOException e) {
      System.err.println("Une erreur est survenue durant la création d'un profil.");
      System.exit(1);
    } catch (ProfilException e) {
      System.err.println("ProfilException : " + e.getMessage());
      System.exit(1);
    }
   
   
    try {
      ProfilSocial ps = (ProfilSocial)Client.getProfil("tarek.tarek13");
      ps.addPublication(new Publication("tarek.tarek13", "Ceci est une publication!"));
     
      Client.modifyProfil("tarek.tarek13", ps);
     
      ps = (ProfilSocial)Client.getProfil("tarek.tarek13");
      System.out.println(ps.getPublications().get(0).toString());
    } catch (RemoteException e) {
      System.err.println("RemoteEX");
      System.exit(1);
    } catch (ProfilException e) {
      System.err.println("ProfilException : " + e.getMessage());
View Full Code Here

      File f1 = new File(Constantes.GROUPES);
      f1.delete();
     
     
      //simulation de creation de client
      Client.newProfil(new ProfilSocial("dalleria", "tarek", "antoine", "dalle-rive", Sexe.H));
      Client.newProfil(new ProfilSocial("kev", "kev", "kev", "kev", Sexe.H));
     
      //simulation connexion
      profilClient = (ProfilSocial) Client.connexion("dalleria", "tarek");
     
      //creation tchat
View Full Code Here

TOP

Related Classes of profil.ProfilSocial

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.