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

cn.leancloud.im.Signature Maven / Gradle / Ivy

There is a newer version: 8.2.28
Show newest version
package cn.leancloud.im;

import com.alibaba.fastjson.annotation.JSONType;

import java.util.Collections;
import java.util.List;

@JSONType(ignores = {"expired"})
public class Signature {

  private String signature;

  private long timestamp;

  private String nonce;

  private List signedPeerIds;

  @Deprecated
  public List getSignedPeerIds() {
    if (signedPeerIds == null) {
      signedPeerIds = Collections.emptyList();
    }
    return signedPeerIds;
  }

  @Deprecated
  public void setSignedPeerIds(List signedPeerIds) {
    this.signedPeerIds = signedPeerIds;
  }

  public String getSignature() {
    return signature;
  }

  public void setSignature(String signature) {
    this.signature = signature;
  }

  public long getTimestamp() {
    return timestamp;
  }

  public void setTimestamp(long timestamp) {
    this.timestamp = timestamp;
  }

  public String getNonce() {
    return nonce;
  }

  public void setNonce(String nonce) {
    this.nonce = nonce;
  }

  protected boolean isExpired() {
    return timestamp + 14400 < (System.currentTimeMillis() / 1000);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy