Examples of toStream()


Examples of com.orientechnologies.orient.core.id.ORID.toStream()

      log("New Document: {}", doc);

      ORID rid = doc.getIdentity();
      log("RID: {}", rid);

      String encoded = Hex.encode(rid.toStream());
      log("Hex Encoded: {}", encoded);

      ORID decoded = new ORecordId().fromStream(Hex.decode(encoded));
      log("Decoded RID: {}", decoded);
View Full Code Here

Examples of com.orientechnologies.orient.core.index.OCompositeKey.toStream()

      buffer.set(!compositeKeyParams.isEmpty());
      if (!compositeKeyParams.isEmpty()) {
        final ODocument compositeKey = new ODocument();
        compositeKey.field("compositeKeyParams", compositeKeyParams);
        buffer.set(compositeKey.toStream());
      }
    }

    return buffer.toByteArray();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.ORecord.toStream()

  @Override
  public <RET extends ORecord> RET reload(final ORecord iRecord, final String iFetchPlan, final boolean iIgnoreCache) {
    ORecord record = currentTx.loadRecord(iRecord.getIdentity(), iRecord, iFetchPlan, iIgnoreCache, false,
        OStorage.LOCKING_STRATEGY.DEFAULT);
    if (record != null && iRecord != record) {
      iRecord.fromStream(record.toStream());
      iRecord.getRecordVersion().copyFrom(record.getRecordVersion());
    }
    return (RET) record;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.ORecordAbstract.toStream()

      final ODatabaseRecordInternal currentDb = ODatabaseRecordThreadLocal.INSTANCE.get();
      hasSameContent = ODocumentHelper.hasSameContentOf(storedRecord, currentDb, newRecord, currentDb, null, false);
    } else {
      // CHECK BYTE PER BYTE
      final ORecordAbstract storedRecord = rid.getRecord();
      hasSameContent = Arrays.equals(storedRecord.toStream(), iRecordContent);
    }

    if (hasSameContent)
      // OK
      iDatabaseVersion.setCounter(Math.max(iDatabaseVersion.getCounter(), iRecordVersion.getCounter()));
View Full Code Here

Examples of com.orientechnologies.orient.core.record.ORecordStringable.toStream()

        json.writeAttribute(indentLevel + 1, true, "value", record.value());

      } else if (iRecord instanceof ORecordBytes) {
        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");
View Full Code Here

Examples of com.orientechnologies.orient.core.record.ORecordStringable.toStream()

        json.writeAttribute(indentLevel + 1, true, "value", record.value());

      } else if (iRecord instanceof ORecordBytes) {
        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");
View Full Code Here

Examples of com.orientechnologies.orient.core.record.ORecordStringable.toStream()

        json.writeAttribute(indentLevel + 1, true, "value", record.value());

      } else if (iRecord instanceof ORecordBytes) {
        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");
View Full Code Here

Examples of com.orientechnologies.orient.core.record.ORecordStringable.toStream()

        json.writeAttribute(indentLevel + 1, true, "value", record.value());

      } else if (iRecord instanceof ORecordBytes) {
        // BYTES
        final ORecordBytes record = (ORecordBytes) iRecord;
        json.writeAttribute(indentLevel + 1, true, "value", OBase64Utils.encodeBytes(record.toStream()));
      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument.toStream()

  @Override
  public void onAfterClientRequest(final OClientConnection iConnection, final byte iRequestType) {
    if (iRequestType == OChannelBinaryProtocol.REQUEST_DB_OPEN)
      try {
        final ODocument clusterConfig = getClusterConfiguration(iConnection.database.getName());
        byte[] serializedDocument = clusterConfig != null ? clusterConfig.toStream() : null;
        ((OChannelBinary) iConnection.protocol.getChannel()).writeBytes(serializedDocument);
      } catch (IOException e) {
        throw new OIOException("Error on marshalling of cluster configuration", e);
      }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument.toStream()

      if (parameters == null || parameters.size() == 0)
        buffer.add(new byte[0]);
      else {
        final ODocument param = new ODocument(database);
        param.field("params", parameters);
        buffer.add(param.toStream());
      }

    } catch (IOException e) {
      throw new OSerializationException("Error while marshalling OCommandRequestTextAbstract impl", e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.