Package br.com.visualmidia.core.server

Examples of br.com.visualmidia.core.server.Communicate


            if(!GDSystem.isStandAloneMode()) {
              SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
              SSLSocket sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(GDSystem.getServerIp(), 9998);
             
              Communicate communicate = new Communicate(sslComunicationSocket);
              communicate.receiveAndSend("200, Thank you bastard");
              communicate.receiveAndSend("209, troca de imagens");
              communicate.send("702, vou te enviar uma imagem");
              communicate.send(logoName);
   
              communicate.sendFile(communicate.getFileTransferConectionConnectMode(GDSystem.getServerIp()), file);
              copyFileToPhotoFolder(file, logoName);
            } else {
              copyFileToPhotoFolder(file, logoName);
            }
          }
View Full Code Here


        try {
          if(!GDSystem.isStandAloneMode()) {
            SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
            SSLSocket sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(GDSystem.getServerIp(), 9998);
 
            Communicate communicate = new Communicate(sslComunicationSocket);
           
            communicate.receiveAndSend("200, Thank you bastard");
            if (communicate.receive().equals("201")) {
              communicate.send("209, Troca de imagens");
              if (communicate.receive().equals("700")) {
                communicate.send("701, me manda a imagem");
                communicate.send(logoName);
                if (communicate.receive().equals("704")) {// imagem encontrada
                  communicate.send("706, me mande a imagem");
                  communicate.receivePersonPhoto();
                  getDisplay().syncExec(new Runnable() {
                    public void run() {
                      Image image = new Image(getDisplay(), Constants.TEMP_DIR + "personPhoto" + ".jpg");
                      loadImage(image);
                    }
View Full Code Here

    try {
      if(!GDSystem.isStandAloneMode()) {
        SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
        SSLSocket sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(GDSystem.getServerIp(), 9998);
       
        Communicate communicate = new Communicate(sslComunicationSocket);
       
        communicate.receiveAndSend("200, Thank you bastard");
        if (communicate.receive().equals("201")) {
          communicate.send("209, Troca de imagens");
          if (communicate.receive().equals("700")) {
            communicate.send("701, me manda a imagem");
            communicate.send(logoName);
            if (communicate.receive().equals("704")) {// imagem encontrada
              communicate.send("705, nao precisa me mandar imagem");
              sslComunicationSocket.close();
              return true;
            } else {// imagem n�o encontrada
              sslComunicationSocket.close();
              return false;
View Full Code Here

  public void run() {
    try {
       
        ServerSocket serverSocket = new ServerSocket(9994);
        Socket socket = serverSocket.accept();
      Communicate communicate = new Communicate(socket);
       
          while (true) {
            if(communicate.receive().equals("200")){
              communicate.send("200");
              if(communicate.receive().equals("211")){
                File file = new File(Constants.PREVAYLER_SERVER_DATA_DIRETORY);
                for (String fileStr : file.list()) {
                  if(fileStr.contains(".snapshot")){
                    numberSnapshotTemp = Integer.parseInt(fileStr.split(".snapshot")[0]);
                    if(numberSnapshot  < numberSnapshotTemp){
                      numberSnapshot = numberSnapshotTemp;
                    }
                  }
                }
                communicate.send(String.valueOf(numberSnapshot));
                break;
              }
            }
            serverSocket.close();
          }
View Full Code Here

    public void checkLicense() {
        try {
            SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
            SSLSocket sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(ServerAdress.getServerAdress(), 9998);

            Communicate communicate = new Communicate(sslComunicationSocket);

            communicate.receiveAndSend("200, Thank you bastard");
          communicate.receiveAndSend("211, Please Verify my date expiration");
          communicate.sendObject(dateExpiration.getCalendar());
          communicate.send(serial);
          GDDate expirationDateServer = new GDDate((Calendar)communicate.receiveObject());
         
          if(!expirationDateServer.equals(dateExpiration)){
            dateExpiration.setDate(expirationDateServer.getDate());
          }
        } catch (Exception exception) {
View Full Code Here

   
    @SuppressWarnings("unchecked")
  private void checkNumberOfSnapshot() {
        try {
            Socket socket = new Socket(GDSystem.serverIp, 9994);
            Communicate communicate = new Communicate(socket);
           
            if(communicate.sendAndReceive("200").equals("200")){
              communicate.send("211");
             
            int numberSnapshotServer = Integer.parseInt(communicate.receive());
            File directory = new File(Constants.PREVAYLER_DATA_DIRETORY);
            File file = null;
            for (String fileStr : directory.list()) {
              file = new File(Constants.PREVAYLER_DATA_DIRETORY  + Constants.FILE_SEPARATOR + fileStr);
              if(fileStr.contains(".snapshot")){
View Full Code Here

                    });

                    SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
                    SSLSocket sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(Constants.MASTER_SERVER_ADDRESS, 9998);

                    Communicate communicate = new Communicate(sslComunicationSocket);
                    communicate.receiveAndSend("200, Thank you bastard");
                    communicate.receiveAndSend("205");

                    updateComposite.getDisplay().syncExec(new Runnable() {
                        public void run() {
                            primeriMessageLabel.setText("Verificando validade da sua licen�a...");
                        }
                    });

                    String receive = communicate.receive();
                    if (receive.equals("403")) {
                        GDSystem system = GDSystem.getInstance();
                        GD gd = GD.getInstance();
                        communicate.sendObject(new Autentication((String) gd.get("username"), (String) gd.get("password"), (String) gd.get("serialnumber") ));
                        if(communicate.receive().equals("404")) {
                            Vader vader = (Vader) communicate.receiveObject();
                           
                            system.execute(new AddDarkSide(vader));
                            updateComposite.getDisplay().syncExec(new Runnable() {
                                public void run() {
                                    primeriMessageLabel.setText("Licen�a valida, reiniciando...");
View Full Code Here

        try {
         
            SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
            sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(serverIp, 9998);

            communicate = new Communicate(sslComunicationSocket);
            communicate.receiveAndSend("200");
          communicate.receiveAndSend("220");
         
            String receive = communicate.receive();
           
View Full Code Here

    SSLSocket sslComunicationSocket;
    try {
      SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
      sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(serverIp, 9998);

      communicate = new Communicate(sslComunicationSocket);

//      communicate.receiveAndSend("200, Thank you bastard");
//      communicate.receiveAndSend("315, Me mande a lista dos arquivos do server");
//      String receive = communicate.receive();
//      if (receive.equals("316")) {
View Full Code Here

        SSLSocketFactory sslComunicationSocketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
        SSLSocket sslComunicationSocket;
    try {
      sslComunicationSocket = (SSLSocket) sslComunicationSocketFactory.createSocket(ServerAdress.getServerAdress(), 9998);
      Communicate communicate = new Communicate(sslComunicationSocket);
           
      communicate.receiveAndSend("200, Thank you bastard");
      communicate.receiveAndSend("208, Send Me The Updates");
     
      String receive = communicate.receive();
      if (receive.equals("300")) {
        if (communicate.sendAndReceive(Constants.BUILD_ID + ", Versao").equals("302")) {
          new UpdateNotificatorServer(shell).start();
        }
      }
    } catch (UnknownHostException e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of br.com.visualmidia.core.server.Communicate

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.