All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.agora.rtm.RtmStorage Maven / Gradle / Ivy

package io.agora.rtm;

import io.agora.rtm.MetadataOptions;
import io.agora.rtm.ResultCallback;
import io.agora.rtm.RtmConstants.RtmChannelType;
import io.agora.rtm.RtmConstants.RtmErrorCode;

/**
 * The RtmStorage class.
 *
 * This class provides the rtm storage methods that can be invoked by your app.
 */
public abstract class RtmStorage {
  /**
   * Creates the metadata object.
   *
   * @return The instance of {@link Metadata}
   */
  public abstract Metadata createMetadata();

  /**
   * Set the metadata of a specified channel.
   *
   * @param channelName    The name of the channel
   * @param channelType    The type of the channel {@link RtmChannelType}
   * @param data           Metadata data
   * @param options        The options of operate metadata
   * @param lockName       lock for operate channel metadata
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void setChannelMetadata(String channelName, RtmChannelType channelType,
      Metadata data, MetadataOptions options, String lockName, ResultCallback resultCallback);

  /**
   * Update the metadata of a specified channel.
   *
   * @param channelName    The name of the channel
   * @param channelType    The type of the channel {@link RtmChannelType}
   * @param data           Metadata data
   * @param options        The options of operate metadata
   * @param lockName       lock for operate channel metadata
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void updateChannelMetadata(String channelName, RtmChannelType channelType,
      Metadata data, MetadataOptions options, String lockName, ResultCallback resultCallback);

  /**
   * Remove the metadata of a specified channel.
   *
   * @param channelName    The name of the channel
   * @param channelType    The type of the channel {@link RtmChannelType}
   * @param data           Metadata data
   * @param options        The options of operate metadata
   * @param lockName       lock for operate channel metadata
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void removeChannelMetadata(String channelName, RtmChannelType channelType,
      Metadata data, MetadataOptions options, String lockName, ResultCallback resultCallback);

  /**
   * Get the metadata of a specified channel.
   *
   * @param channelName    The name of the channel
   * @param channelType    The type of the channel {@link RtmChannelType}
   * @param resultCallback A {@link ResultCallback} object
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void getChannelMetadata(
      String channelName, RtmChannelType channelType, ResultCallback resultCallback);

  /**
   * Set the metadata of a specified user.
   *
   * @param userId         The user ID of the specified user
   * @param data           Metadata data
   * @param options        The options of operate metadata
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void setUserMetadata(
      String userId, Metadata data, MetadataOptions options, ResultCallback resultCallback);

  /**
   * Update the metadata of a specified user.
   *
   * @param userId         The user ID of the specified user
   * @param data           Metadata data
   * @param options        The options of operate metadata
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void updateUserMetadata(
      String userId, Metadata data, MetadataOptions options, ResultCallback resultCallback);

  /**
   * Remove the metadata of a specified user.
   *
   * @param userId         The user ID of the specified user
   * @param data           Metadata data
   * @param options        The options of operate metadata
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void removeUserMetadata(
      String userId, Metadata data, MetadataOptions options, ResultCallback resultCallback);

  /**
   * Get the metadata of a specified user.
   *
   * @param userId         The user ID of the specified user.
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void getUserMetadata(String userId, ResultCallback resultCallback);

  /**
   * Subscribe the metadata update event of a specified user.
   *
   * @param userId         The user ID of the specified user.
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void subscribeUserMetadata(String userId, ResultCallback resultCallback);

  /**
   * unsubscribe the metadata update event of a specified user.
   *
   * @param userId         The user ID of the specified user.
   * @param resultCallback A {@link ResultCallback} object.
   *                       - Success: will receives the
   *                       {@link ResultCallback.onSuccess()} callback.
   *                       - Failure: will receives the
   *                       {@link ResultCallback.onFailure()} callback.
   */
  public abstract void unsubscribeUserMetadata(String userId, ResultCallback resultCallback);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy