Examples of OChannelBinaryClient


Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

  public OServerAdmin setGlobalConfiguration(final OGlobalConfiguration iConfig, final Object iValue) throws IOException {
    storage.checkConnection();

    try {
      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_CONFIG_SET);
      network.writeString(iConfig.getKey());
      network.writeString(iValue != null ? iValue.toString() : "");
      storage.getResponse(network);

    } catch (Exception e) {
      OLogManager.instance().exception("Can't set the configuration value: " + iConfig.getKey(), e, OStorageException.class);
      storage.close();
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

  }

  public void close(final boolean iForce) {
    lock.acquireExclusiveLock();

    OChannelBinaryClient network = null;
    try {

      network = beginRequest(OChannelBinaryProtocol.REQUEST_DB_CLOSE);
      endRequest(network);
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

    checkConnection();

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_RECORD_CREATE);
        try {
          network.writeShort((short) iRid.clusterId);
          network.writeBytes(iContent);
          network.writeByte(iRecordType);
        } finally {
          endRequest(network);
        }

        try {
          beginResponse(network);

          iRid.clusterPosition = network.readLong();
          return iRid.clusterPosition;
        } finally {
          endResponse(network);
        }
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

      return null;

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_RECORD_LOAD);
        try {
          network.writeRID(iRid);
          network.writeString(iFetchPlan != null ? iFetchPlan : "");
        } finally {
          endRequest(network);
        }

        try {
          beginResponse(network);

          if (network.readByte() == 0)
            return null;

          final ORawBuffer buffer = new ORawBuffer(network.readBytes(), network.readInt(), network.readByte());

          ORecordInternal<?> record;
          while (network.readByte() == 2) {
            record = (ORecordInternal<?>) readIdentifiable(network, iDatabase);

            // PUT IN THE CLIENT LOCAL CACHE
            iDatabase.getLevel1Cache().updateRecord(record);
          }
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

    checkConnection();

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_RECORD_UPDATE);
        try {
          network.writeRID(iRid);
          network.writeBytes(iContent);
          network.writeInt(iVersion);
          network.writeByte(iRecordType);
        } finally {
          endRequest(network);
        }

        try {
          beginResponse(network);
          return network.readInt();
        } finally {
          endResponse(network);
        }

      } catch (OException e) {
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

    checkConnection();

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_RECORD_DELETE);
        try {
          network.writeRID(iRid);
          network.writeInt(iVersion);
        } finally {
          endRequest(network);
        }

        try {
          beginResponse(network);
          return network.readByte() == 1;
        } finally {
          endResponse(network);
        }

      } catch (OException e) {
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

    checkConnection();

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_DATACLUSTER_DATARANGE);
        try {
          network.writeShort((short) iClusterId);
        } finally {
          endRequest(network);
        }

        try {
          beginResponse(network);
          return new long[] { network.readLong(), network.readLong() };
        } finally {
          endResponse(network);
        }

      } catch (OException e) {
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

    checkConnection();

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_DB_SIZE);
        endRequest(network);

        try {
          beginResponse(network);
          return network.readLong();
        } finally {
          endResponse(network);
        }
      } catch (OException e) {
        // PASS THROUGH
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

    checkConnection();

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_DB_COUNTRECORDS);
        endRequest(network);

        try {
          beginResponse(network);
          return network.readLong();
        } finally {
          endResponse(network);
        }
      } catch (OException e) {
        // PASS THROUGH
View Full Code Here

Examples of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

    checkConnection();

    do {
      try {

        final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_DATACLUSTER_COUNT);
        try {
          network.writeShort((short) iClusterIds.length);
          for (int i = 0; i < iClusterIds.length; ++i)
            network.writeShort((short) iClusterIds[i]);
        } finally {
          endRequest(network);
        }

        try {
          beginResponse(network);
          return network.readLong();
        } finally {
          endResponse(network);
        }
      } catch (OException e) {
        // PASS THROUGH
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.