Package com.orientechnologies.orient.enterprise.channel.binary

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


  public OServerAdmin connect(final String iUserName, final String iUserPassword) throws IOException {
    storage.createConnectionPool();

    try {
      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_CONNECT);
      try {
        network.writeString(iUserName);
        network.writeString(iUserPassword);
      } finally {
        storage.endRequest(network);
      }

      try {
        storage.beginResponse(network);
        sessionId = network.readInt();
        storage.setSessionId(sessionId);
      } finally {
        storage.endResponse(network);
      }
View Full Code Here


    try {
      if (iStorageMode == null)
        iStorageMode = "csv";

      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_CREATE);
      try {
        network.writeString(storage.getName());
        network.writeString(iStorageMode);
      } finally {
        storage.endRequest(network);
      }

      storage.getResponse(network);
View Full Code Here

  public boolean existsDatabase() throws IOException {
    storage.checkConnection();

    try {
      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_EXIST);
      try {
        network.writeString(storage.getName());
      } finally {
        storage.endRequest(network);
      }

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

    } catch (Exception e) {
View Full Code Here

  public OServerAdmin deleteDatabase() throws IOException {
    storage.checkConnection();

    try {

      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_DB_DELETE);
      try {
        network.writeString(storage.getName());
      } finally {
        storage.endRequest(network);
      }

      storage.getResponse(network);
View Full Code Here

      final String iRemoteName, final boolean iSynchronousMode) throws IOException {
    storage.checkConnection();

    try {

      final OChannelBinaryClient network = storage.beginRequest(OChannelDistributedProtocol.REQUEST_DISTRIBUTED_DB_SHARE_SENDER);
      try {
        network.writeString(iDatabaseName);
        network.writeString(iDatabaseUserName);
        network.writeString(iDatabaseUserPassword);
        network.writeString(iRemoteName);
        network.writeByte((byte) (iSynchronousMode ? 1 : 0));
      } finally {
        storage.endRequest(network);
      }

      storage.getResponse(network);
View Full Code Here

    storage.checkConnection();

    final Map<String, String> config = new HashMap<String, String>();

    try {
      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_CONFIG_LIST);
      storage.endRequest(network);

      try {
        storage.beginResponse(network);
        final int num = network.readShort();
        for (int i = 0; i < num; ++i)
          config.put(network.readString(), network.readString());
      } finally {
        storage.endResponse(network);
      }

    } catch (Exception e) {
View Full Code Here

  public String getGlobalConfiguration(final OGlobalConfiguration iConfig) throws IOException {
    storage.checkConnection();

    try {
      final OChannelBinaryClient network = storage.beginRequest(OChannelBinaryProtocol.REQUEST_CONFIG_GET);
      network.writeString(iConfig.getKey());
      storage.beginResponse(network);

      return network.readString();

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

  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.beginResponse(network);

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

    asynchExecutor = Executors.newSingleThreadExecutor();
  }

  public void connect(final int iTimeout, final String iClusterName, final SecretKey iSecurityKey) throws IOException {
    configuration.setValue(OGlobalConfiguration.NETWORK_SOCKET_TIMEOUT, iTimeout);
    channel = new OChannelBinaryClient(networkAddress, networkPort, configuration);

    OChannelBinaryProtocol.checkProtocolVersion(channel);

    OLogManager.instance().warn(this, "Joining the server node %s:%d to the cluster...", networkAddress, networkPort);
View Full Code Here

    asynchExecutor = Executors.newSingleThreadExecutor();
  }

  public void connect(final int iTimeout) throws IOException {
    configuration.setValue(OGlobalConfiguration.NETWORK_SOCKET_TIMEOUT, iTimeout);
    channel = new OChannelBinaryClient(networkAddress, networkPort, configuration);

    OChannelBinaryProtocol.checkProtocolVersion(channel);

    OLogManager.instance().warn(this, "Joining the server node %s:%d to the cluster...", networkAddress, networkPort);
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryClient

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.