Package org.arch.event.misc

Examples of org.arch.event.misc.EncryptEventV2


  }

  public void write(Event ev)
  {
    int index = ev.getHash() % workers.length;
    EncryptEventV2 encrypt = new EncryptEventV2();
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    String enc = cfg.getProperty("C4", "Encrypter", "RC4");
    if (enc.equalsIgnoreCase("RC4"))
    {
      encrypt.type = EncryptType.RC4;
    }
    else if (enc.equalsIgnoreCase("SE1"))
    {
      encrypt.type = EncryptType.SE1;
    }
    else
    {
      encrypt.type = EncryptType.NONE;
    }
    encrypt.ev = ev;
    encrypt.setHash(ev.getHash());
    Buffer buf = new Buffer(256);
    BufferHelper.writeFixInt32(buf, 1, true);
    encrypt.encode(buf);
    int tmp = buf.getWriteIndex();
    int len = tmp - 4;
    buf.setWriteIndex(0);
    BufferHelper.writeFixInt32(buf, len, true);
    buf.setWriteIndex(tmp);
View Full Code Here


  }
 
  public void write(Event ev)
  {
    int index = ev.getHash() % sendEventQueue.length;
    EncryptEventV2 encrypt = new EncryptEventV2();
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    String enc = cfg.getProperty("C4", "Encrypter", "RC4");
    if (enc.equalsIgnoreCase("RC4"))
    {
      encrypt.type = EncryptType.RC4;
    }
    else if (enc.equalsIgnoreCase("SE1"))
    {
      encrypt.type = EncryptType.SE1;
    }
    else
    {
      encrypt.type = EncryptType.NONE;
    }
   
    encrypt.ev = ev;
    encrypt.setHash(ev.getHash());
    synchronized (sendEventQueue[index])
    {
      sendEventQueue[index].add(encrypt);
    }
    if (pusher[index].isReady)
View Full Code Here

TOP

Related Classes of org.arch.event.misc.EncryptEventV2

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.