Package org.waveprotocol.box.server.persistence.protos.ProtoAccountStoreData

Examples of org.waveprotocol.box.server.persistence.protos.ProtoAccountStoreData.ProtoAccountData


    return true;
  }

  public final void testHumanAccount() {
    ProtoAccountData data = ProtoAccountDataSerializer.serialize(humanAccount);
    AccountData account = ProtoAccountDataSerializer.deserialize(data);
    assertEquals(humanAccount, account);
  }
View Full Code Here


    AccountData account = ProtoAccountDataSerializer.deserialize(data);
    assertEquals(humanAccount, account);
  }

  public final void testHumanAccountWithDigest() {
    ProtoAccountData data = ProtoAccountDataSerializer.serialize(humanAccountWithDigest);
    AccountData account = ProtoAccountDataSerializer.deserialize(data);
    assertEquals(humanAccountWithDigest, account);
  }
View Full Code Here

    AccountData account = ProtoAccountDataSerializer.deserialize(data);
    assertEquals(humanAccountWithDigest, account);
  }

  public final void testRobotAccount() {
    ProtoAccountData data = ProtoAccountDataSerializer.serialize(robotAccount);
    AccountData account = ProtoAccountDataSerializer.deserialize(data);
    assertEquals(robotAccount, account);
  }
View Full Code Here

    AccountData account = ProtoAccountDataSerializer.deserialize(data);
    assertEquals(robotAccount, account);
  }

  public final void testRobotAccountWithCapabilities() {
    ProtoAccountData data = ProtoAccountDataSerializer.serialize(robotAccountWithCapabilities);
    AccountData account = ProtoAccountDataSerializer.deserialize(data);
    assertEquals(robotAccountWithCapabilities, account);
  }
View Full Code Here

    try {
      if (!accountFile.exists()) {
        return null;
      }
      file = new FileInputStream(accountFile);
      ProtoAccountData data = ProtoAccountData.newBuilder().mergeFrom(file).build();
      return ProtoAccountDataSerializer.deserialize(data);
    } catch (IOException e) {
      LOG.severe("Failed to read account data from file: " + accountFile.getAbsolutePath(), e);
      throw new PersistenceException(e);
    } finally {
View Full Code Here

  private void writeAccount(AccountData account) throws PersistenceException {
    File accountFile = new File(participantIdToFileName(account.getId()));
    OutputStream file = null;
    try {
      file = new FileOutputStream(accountFile);
      ProtoAccountData data = ProtoAccountDataSerializer.serialize(account);
      file.write(data.toByteArray());
      file.flush();
    } catch (IOException e) {
      LOG.severe("Failed to write account data to file: " + accountFile.getAbsolutePath(), e);
      throw new PersistenceException(e);
    } finally {
View Full Code Here

    try {
      if (!accountFile.exists()) {
        return null;
      }
      file = new FileInputStream(accountFile);
      ProtoAccountData data = ProtoAccountData.newBuilder().mergeFrom(file).build();
      return ProtoAccountDataSerializer.deserialize(data);
    } catch (IOException e) {
      LOG.severe("Failed to read account data from file: " + accountFile.getAbsolutePath(), e);
      throw new PersistenceException(e);
    } finally {
View Full Code Here

  private void writeAccount(AccountData account) throws PersistenceException {
    File accountFile = new File(participantIdToFileName(account.getId()));
    OutputStream file = null;
    try {
      file = new FileOutputStream(accountFile);
      ProtoAccountData data = ProtoAccountDataSerializer.serialize(account);
      file.write(data.toByteArray());
      file.flush();
    } catch (IOException e) {
      LOG.severe("Failed to write account data to file: " + accountFile.getAbsolutePath(), e);
      throw new PersistenceException(e);
    } finally {
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.server.persistence.protos.ProtoAccountStoreData.ProtoAccountData

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.