正在查看: 新暖心缘 v8.1.1 应用的 NameSpaceManager.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 新暖心缘 v8.1.1 应用的 NameSpaceManager.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.qiniu.qvs;
import com.qiniu.common.QiniuException;
import com.qiniu.http.Client;
import com.qiniu.http.Response;
import com.qiniu.qvs.model.NameSpace;
import com.qiniu.qvs.model.PatchOperation;
import com.qiniu.util.Auth;
import com.qiniu.util.StringMap;
import com.qiniu.util.UrlUtils;
import com.tencent.open.SocialConstants;
public class NameSpaceManager {
private final String apiServer;
private final Auth auth;
private final Client client;
public NameSpaceManager(Auth auth) {
this(auth, "http://qvs.qiniuapi.com");
}
public Response createNameSpace(NameSpace nameSpace) throws QiniuException {
StringMap stringMap = new StringMap();
stringMap.putNotNull("name", nameSpace.getName());
stringMap.putNotNull(SocialConstants.PARAM_APP_DESC, nameSpace.getDesc());
stringMap.putNotNull("accessType", nameSpace.getAccessType());
stringMap.putNotNull("rtmpUrlType", Integer.valueOf(nameSpace.getRtmpUrlType()));
stringMap.putNotNull("domains", nameSpace.getDomains());
stringMap.putNotNull("callBack", nameSpace.getCallback());
stringMap.putNotNull("recordTemplateId", nameSpace.getRecordTemplateId());
stringMap.putNotNull("snapshotTemplateId", nameSpace.getSnapShotTemplateId());
stringMap.putNotNull("recordTemplateApplyAll", Boolean.valueOf(nameSpace.isRecordTemplateApplyAll()));
stringMap.putNotNull("snapshotTemplateApplyAll", Boolean.valueOf(nameSpace.isSnapTemplateApplyAll()));
return QvsResponse.post(String.format("%s/v1/namespaces", this.apiServer), stringMap, this.client, this.auth);
}
public Response deleteNameSpace(String str) throws QiniuException {
return QvsResponse.delete(String.format("%s/v1/namespaces/%s", this.apiServer, str), this.client, this.auth);
}
public Response disableNameSpace(String str) throws QiniuException {
return QvsResponse.post(String.format("%s/v1/namespaces/%s/disabled", this.apiServer, str), null, this.client, this.auth);
}
public Response enableNameSpace(String str) throws QiniuException {
return QvsResponse.post(String.format("%s/v1/namespaces/%s/enabled", this.apiServer, str), null, this.client, this.auth);
}
public Response listNameSpace(int i8, int i9, String str) throws QiniuException {
return QvsResponse.get(UrlUtils.composeUrlWithQueries(String.format("%s/v1/namespaces", this.apiServer), new StringMap().putNotNull("offset", Integer.valueOf(i8)).putNotNull("line", Integer.valueOf(i9)).putNotEmpty("sortBy", str)), this.client, this.auth);
}
public Response queryNameSpace(String str) throws QiniuException {
return QvsResponse.get(String.format("%s/v1/namespaces/%s", this.apiServer, str), this.client, this.auth);
}
public Response updateNameSpace(String str, PatchOperation[] patchOperationArr) throws QiniuException {
return QvsResponse.patch(String.format("%s/v1/namespaces/%s", this.apiServer, str), new StringMap().put("operations", patchOperationArr), this.client, this.auth);
}
public NameSpaceManager(Auth auth, String str) {
this(auth, str, new Client());
}
public NameSpaceManager(Auth auth, String str, Client client) {
this.auth = auth;
this.apiServer = str;
this.client = client;
}
}