Examples of OChannelBinaryClient


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

   * @throws IOException
   */
  public boolean 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

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

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

        OLogManager.instance().error(this, "Can't create unnamed remote storage check your syntax", OStorageException.class);
      } else {
        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

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

   */
  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

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

  public OServerAdmin dropDatabase() 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

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

      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

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

    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

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

  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);

      try {
        return network.readString();
      } finally {
        storage.endResponse(network);
      }

    } catch (Exception e) {
View Full Code Here

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(true);
View Full Code Here

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

    checkConnection();

    do {
      try {

        OChannelBinaryClient network = null;
        try {
          network = beginRequest(OChannelBinaryProtocol.REQUEST_DB_RELOAD);
        } finally {
          endRequest(network);
        }
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.