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

net.gdface.facedb.thrift.FaceDbThriftClientAsync Maven / Gradle / Ivy

The newest version!
// ______________________________________________________
// Generated by codegen - https://gitee.com/l0km/codegen 
// template: thrift/client/perservice/client.async.decorator.class.vm
// ______________________________________________________
package net.gdface.facedb.thrift;
import com.gitee.l0km.ximage.MatType;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.List;
import java.util.Map;
import net.gdface.facedb.FaceDb;
import net.gdface.facedb.SearchResult;
import net.gdface.facedb.db.FaceBean;
import net.gdface.facedb.db.FeatureBean;
import net.gdface.facedb.db.ImageBean;
import net.gdface.sdk.CodeInfo;
import net.gdface.sdk.CompareResult;

import com.google.common.net.HostAndPort;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.ListenableFuture;
import com.gitee.l0km.xthrift.thrift.ClientFactory;
import com.gitee.l0km.xthrift.thrift.TypeTransformer;
import static com.google.common.base.Preconditions.*;

/**
 * 基于thrift/swift框架生成的client端代码提供{@link FaceDb}接口的异步RPC实现(线程安全)
* 转发所有{@link FaceDb}接口方法到{@link #delegate()}指定的实例
* 所有服务端抛出的{@link RuntimeException}异常被封装到{@link ServiceRuntimeException}中抛出
* Example:
*
 *        FaceDbThriftClientAsync thriftInstance = ClientFactory
 *            .builder()
 *            .setHostAndPort("127.0.0.1",26413)
 *            .build(FaceDb.class, FaceDbThriftClientAsync.class);
 * 
* 计算机生成代码(generated by automated tools ThriftServiceDecoratorGenerator @author guyadong)
* @author guyadong * */ public class FaceDbThriftClientAsync { private final ClientFactory factory; public ClientFactory getFactory() { return factory; } public FaceDbThriftClientAsync(ClientFactory factory) { super(); this.factory = checkNotNull(factory,"factory is null"); } /** * @param host RPC service host * @param port RPC service port */ public FaceDbThriftClientAsync(String host,int port) { this(ClientFactory.builder().setHostAndPort(host,port)); } /** * @param hostAndPort RPC service host and port */ public FaceDbThriftClientAsync(HostAndPort hostAndPort) { this(ClientFactory.builder().setHostAndPort(hostAndPort)); } /** * test if connectable for RPC service * @return return {@code true} if connectable ,otherwise {@code false} */ public boolean testConnect(){ return factory.testConnect(); } /** * @return 返回{@link net.gdface.facedb.thrift.client.FaceDb.Async}实例 */ protected net.gdface.facedb.thrift.client.FaceDb.Async delegate() { return factory.applyInstance(net.gdface.facedb.thrift.client.FaceDb.Async.class); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("FaceDbThriftClientAsync [factory="); builder.append(factory); builder.append(",interface="); builder.append(FaceDb.class.getName()); builder.append("]"); return builder.toString(); } /** * 默认的{@link FutureCallback}实现 * @author guyadong * * @param */ public static class DefaultCallback implements FutureCallback{ @Override public void onSuccess(V result) { // DO NOTHING } @Override public void onFailure(Throwable t) { try{ throw t; } catch(net.gdface.facedb.thrift.client.NotFoundBeanException e){ onNotFoundBeanException(e); } catch(net.gdface.facedb.thrift.client.ImageErrorException e){ onImageErrorException(e); } catch(net.gdface.facedb.thrift.client.DuplicateRecordException e){ onDuplicateRecordException(e); } catch(net.gdface.facedb.thrift.client.NotFaceDetectedException e){ onNotFaceDetectedException(e); } catch(net.gdface.facedb.thrift.client.ServiceRuntimeException e){ onServiceRuntimeException(e); } catch(Throwable e){ onThrowable(e); } } protected void onNotFoundBeanException(net.gdface.facedb.thrift.client.NotFoundBeanException e){ System.out.println(e.getServiceStackTraceMessage()); } protected void onImageErrorException(net.gdface.facedb.thrift.client.ImageErrorException e){ System.out.println(e.getServiceStackTraceMessage()); } protected void onDuplicateRecordException(net.gdface.facedb.thrift.client.DuplicateRecordException e){ System.out.println(e.getServiceStackTraceMessage()); } protected void onNotFaceDetectedException(net.gdface.facedb.thrift.client.NotFaceDetectedException e){ System.out.println(e.getServiceStackTraceMessage()); } protected void onServiceRuntimeException(net.gdface.facedb.thrift.client.ServiceRuntimeException e){ System.out.println(e.getServiceStackTraceMessage()); } protected void onThrowable(Throwable e){ e.printStackTrace(); } } /** * see also {@link net.gdface.facedb.FaceDb#addFeature(byte[],java.util.Map)} */ public ListenableFuture addFeature(byte[] feature, Map faces){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.addFeature(feature, TypeTransformer.getInstance().to( faces, ByteBuffer.class, CodeInfo.class, byte[].class, net.gdface.facedb.thrift.client.CodeInfo.class)), new com.google.common.base.Function(){ @Override public FeatureBean apply(net.gdface.facedb.thrift.client.FeatureBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FeatureBean.class, FeatureBean.class); } }); return factory.wrap(async,future); } public void addFeature(byte[] feature, Map faces, FutureCallbackcallback){ factory.addCallback(addFeature(feature,faces), callback); } /** * see also {@link net.gdface.facedb.FaceDb#addImage(byte[],java.util.List)} */ public ListenableFuture addImage(byte[] imgData, List features){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.addImage(imgData, TypeTransformer.getInstance().to( features, CodeInfo.class, net.gdface.facedb.thrift.client.CodeInfo.class)), new com.google.common.base.Function(){ @Override public ImageBean apply(net.gdface.facedb.thrift.client.ImageBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void addImage(byte[] imgData, List features, FutureCallbackcallback){ factory.addCallback(addImage(imgData,features), callback); } /** * see also {@link net.gdface.facedb.FaceDb#addImageIfAbsent(byte[],net.gdface.sdk.CodeInfo,double)} */ public ListenableFuture addImageIfAbsent(byte[] imgData, CodeInfo code, double similarty){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.addImageIfAbsent(imgData, TypeTransformer.getInstance().to( code, CodeInfo.class, net.gdface.facedb.thrift.client.CodeInfo.class), similarty), new com.google.common.base.Function(){ @Override public ImageBean apply(net.gdface.facedb.thrift.client.ImageBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void addImageIfAbsent(byte[] imgData, CodeInfo code, double similarty, FutureCallbackcallback){ factory.addCallback(addImageIfAbsent(imgData,code,similarty), callback); } /** * see also {@link net.gdface.facedb.FaceDb#compareFaces(java.lang.String,byte[],net.gdface.sdk.CodeInfo[])} */ public ListenableFuture compareFaces(String featureId, byte[] imgData, CodeInfo[] facePos){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.compareFaces(featureId, imgData, TypeTransformer.getInstance().to( facePos, CodeInfo.class, net.gdface.facedb.thrift.client.CodeInfo.class)), new com.google.common.base.Function,double[]>(){ @Override public double[] apply(java.util.List input) { return TypeTransformer.getInstance().todoubleArray( input, double.class, double.class); } }); return factory.wrap(async,future); } public void compareFaces(String featureId, byte[] imgData, CodeInfo[] facePos, FutureCallbackcallback){ factory.addCallback(compareFaces(featureId,imgData,facePos), callback); } /** * see also {@link net.gdface.facedb.FaceDb#compareFeature(java.lang.String,byte[])} */ public ListenableFuture compareFeature(String featureId, byte[] feature){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.compareFeature(featureId, feature); return factory.wrap(async,future); } public void compareFeature(String featureId, byte[] feature, FutureCallbackcallback){ factory.addCallback(compareFeature(featureId,feature), callback); } /** * see also {@link net.gdface.facedb.FaceDb#compareFeatureId(java.lang.String,java.lang.String)} */ public ListenableFuture compareFeatureId(String featureId1, String featureId2){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.compareFeatureId(featureId1, featureId2); return factory.wrap(async,future); } public void compareFeatureId(String featureId1, String featureId2, FutureCallbackcallback){ factory.addCallback(compareFeatureId(featureId1,featureId2), callback); } /** * see also {@link net.gdface.facedb.FaceDb#compareFeatures(java.lang.String,net.gdface.sdk.CodeInfo[])} */ public ListenableFuture compareFeatures(String featureId, CodeInfo[] features){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.compareFeatures(featureId, TypeTransformer.getInstance().to( features, CodeInfo.class, net.gdface.facedb.thrift.client.CodeInfo.class)), new com.google.common.base.Function,double[]>(){ @Override public double[] apply(java.util.List input) { return TypeTransformer.getInstance().todoubleArray( input, double.class, double.class); } }); return factory.wrap(async,future); } public void compareFeatures(String featureId, CodeInfo[] features, FutureCallbackcallback){ factory.addCallback(compareFeatures(featureId,features), callback); } /** * see also {@link net.gdface.facedb.FaceDb#dbCapacity()} */ public ListenableFuture> dbCapacity(){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = async.dbCapacity(); return factory.wrap(async,future); } public void dbCapacity(FutureCallback>callback){ factory.addCallback(dbCapacity(), callback); } /** * see also {@link net.gdface.facedb.FaceDb#deleteFeature(java.lang.String,boolean)} */ public ListenableFuture deleteFeature(String featureId, boolean cascade){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.deleteFeature(featureId, cascade); return factory.wrap(async,future); } public void deleteFeature(String featureId, boolean cascade, FutureCallbackcallback){ factory.addCallback(deleteFeature(featureId,cascade), callback); } /** * see also {@link net.gdface.facedb.FaceDb#deleteFeatures(java.util.List,boolean)} */ public ListenableFuture deleteFeatures(List featureIdList, boolean cascade){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.deleteFeatures(featureIdList, cascade); return factory.wrap(async,future); } public void deleteFeatures(List featureIdList, boolean cascade, FutureCallbackcallback){ factory.addCallback(deleteFeatures(featureIdList,cascade), callback); } /** * see also {@link net.gdface.facedb.FaceDb#deleteImage(java.lang.String,boolean)} */ public ListenableFuture deleteImage(String imgMd5, boolean cascade){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.deleteImage(imgMd5, cascade); return factory.wrap(async,future); } public void deleteImage(String imgMd5, boolean cascade, FutureCallbackcallback){ factory.addCallback(deleteImage(imgMd5,cascade), callback); } /** * see also {@link net.gdface.facedb.FaceDb#deleteImages(java.util.List,boolean)} */ public ListenableFuture deleteImages(List imgMd5List, boolean cascade){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.deleteImages(imgMd5List, cascade); return factory.wrap(async,future); } public void deleteImages(List imgMd5List, boolean cascade, FutureCallbackcallback){ factory.addCallback(deleteImages(imgMd5List,cascade), callback); } /** * see also {@link net.gdface.facedb.FaceDb#detectAndAddFeatures(byte[],int)} */ public ListenableFuture detectAndAddFeatures(byte[] imgData, int faceNum){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.detectAndAddFeatures(imgData, faceNum), new com.google.common.base.Function(){ @Override public ImageBean apply(net.gdface.facedb.thrift.client.ImageBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void detectAndAddFeatures(byte[] imgData, int faceNum, FutureCallbackcallback){ factory.addCallback(detectAndAddFeatures(imgData,faceNum), callback); } /** * see also {@link net.gdface.facedb.FaceDb#detectAndCompareFaces(java.lang.String,byte[],int)} */ public ListenableFuture detectAndCompareFaces(String featureId, byte[] imgData, int faceNum){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.detectAndCompareFaces(featureId, imgData, faceNum), new com.google.common.base.Function(){ @Override public CompareResult apply(net.gdface.facedb.thrift.client.CompareResult input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.CompareResult.class, CompareResult.class); } }); return factory.wrap(async,future); } public void detectAndCompareFaces(String featureId, byte[] imgData, int faceNum, FutureCallbackcallback){ factory.addCallback(detectAndCompareFaces(featureId,imgData,faceNum), callback); } /** * see also {@link net.gdface.facedb.FaceDb#detectAndGetCodeInfo(byte[])} */ public ListenableFuture detectAndGetCodeInfo(byte[] imgData){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.detectAndGetCodeInfo(imgData), new com.google.common.base.Function,CodeInfo[]>(){ @Override public CodeInfo[] apply(java.util.List input) { return TypeTransformer.getInstance().toArray( input, net.gdface.facedb.thrift.client.CodeInfo.class, CodeInfo.class); } }); return factory.wrap(async,future); } public void detectAndGetCodeInfo(byte[] imgData, FutureCallbackcallback){ factory.addCallback(detectAndGetCodeInfo(imgData), callback); } /** * see also {@link net.gdface.facedb.FaceDb#detectAndGetCodeInfo(com.gitee.l0km.ximage.MatType,byte[],int,int)} */ public ListenableFuture detectAndGetCodeInfo(MatType matType, byte[] matData, int width, int height){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.detectAndGetCodeInfoMat(TypeTransformer.getInstance().to( matType, MatType.class, net.gdface.facedb.thrift.client.MatType.class), matData, width, height), new com.google.common.base.Function,CodeInfo[]>(){ @Override public CodeInfo[] apply(java.util.List input) { return TypeTransformer.getInstance().toArray( input, net.gdface.facedb.thrift.client.CodeInfo.class, CodeInfo.class); } }); return factory.wrap(async,future); } public void detectAndGetCodeInfo(MatType matType, byte[] matData, int width, int height, FutureCallbackcallback){ factory.addCallback(detectAndGetCodeInfo(matType,matData,width,height), callback); } /** * see also {@link net.gdface.facedb.FaceDb#detectAndSearchFaces(byte[],double,int,java.lang.String)} */ public ListenableFuture detectAndSearchFaces(byte[] imgData, double similarty, int rows, String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.detectAndSearchFaces(imgData, similarty, rows, where), new com.google.common.base.Function,SearchResult[]>(){ @Override public SearchResult[] apply(java.util.List input) { return TypeTransformer.getInstance().toArray( input, net.gdface.facedb.thrift.client.SearchResult.class, SearchResult.class); } }); return factory.wrap(async,future); } public void detectAndSearchFaces(byte[] imgData, double similarty, int rows, String where, FutureCallbackcallback){ factory.addCallback(detectAndSearchFaces(imgData,similarty,rows,where), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getCodeInfo(int)} */ public ListenableFuture getCodeInfo(int faceId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getCodeInfo(faceId), new com.google.common.base.Function(){ @Override public CodeInfo apply(net.gdface.facedb.thrift.client.CodeInfo input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.CodeInfo.class, CodeInfo.class); } }); return factory.wrap(async,future); } public void getCodeInfo(int faceId, FutureCallbackcallback){ factory.addCallback(getCodeInfo(faceId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getCodeInfoByFeatureId(java.lang.String)} */ public ListenableFuture getCodeInfoByFeatureId(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getCodeInfoByFeatureId(featureId), new com.google.common.base.Function(){ @Override public CodeInfo apply(net.gdface.facedb.thrift.client.CodeInfo input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.CodeInfo.class, CodeInfo.class); } }); return factory.wrap(async,future); } public void getCodeInfoByFeatureId(String featureId, FutureCallbackcallback){ factory.addCallback(getCodeInfoByFeatureId(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getCodeInfoByImageMd5(java.lang.String)} */ public ListenableFuture getCodeInfoByImageMd5(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getCodeInfoByImageMd5(imageMd5), new com.google.common.base.Function(){ @Override public CodeInfo apply(net.gdface.facedb.thrift.client.CodeInfo input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.CodeInfo.class, CodeInfo.class); } }); return factory.wrap(async,future); } public void getCodeInfoByImageMd5(String imageMd5, FutureCallbackcallback){ factory.addCallback(getCodeInfoByImageMd5(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getCodeInfosByFeatureId(java.lang.String)} */ public ListenableFuture> getCodeInfosByFeatureId(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = com.google.common.util.concurrent.Futures.transform( async.getCodeInfosByFeatureId(featureId), new com.google.common.base.Function,List>(){ @Override public List apply(List input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.CodeInfo.class, CodeInfo.class); } }); return factory.wrap(async,future); } public void getCodeInfosByFeatureId(String featureId, FutureCallback>callback){ factory.addCallback(getCodeInfosByFeatureId(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getCodeInfosByImageMd5(java.lang.String)} */ public ListenableFuture> getCodeInfosByImageMd5(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = com.google.common.util.concurrent.Futures.transform( async.getCodeInfosByImageMd5(imageMd5), new com.google.common.base.Function,List>(){ @Override public List apply(List input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.CodeInfo.class, CodeInfo.class); } }); return factory.wrap(async,future); } public void getCodeInfosByImageMd5(String imageMd5, FutureCallback>callback){ factory.addCallback(getCodeInfosByImageMd5(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFace(int)} */ public ListenableFuture getFace(int faceId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getFace(faceId), new com.google.common.base.Function(){ @Override public FaceBean apply(net.gdface.facedb.thrift.client.FaceBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FaceBean.class, FaceBean.class); } }); return factory.wrap(async,future); } public void getFace(int faceId, FutureCallbackcallback){ factory.addCallback(getFace(faceId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFaceByFeatureId(java.lang.String)} */ public ListenableFuture getFaceByFeatureId(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getFaceByFeatureId(featureId), new com.google.common.base.Function(){ @Override public FaceBean apply(net.gdface.facedb.thrift.client.FaceBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FaceBean.class, FaceBean.class); } }); return factory.wrap(async,future); } public void getFaceByFeatureId(String featureId, FutureCallbackcallback){ factory.addCallback(getFaceByFeatureId(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFaceByImageMd5(java.lang.String)} */ public ListenableFuture getFaceByImageMd5(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getFaceByImageMd5(imageMd5), new com.google.common.base.Function(){ @Override public FaceBean apply(net.gdface.facedb.thrift.client.FaceBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FaceBean.class, FaceBean.class); } }); return factory.wrap(async,future); } public void getFaceByImageMd5(String imageMd5, FutureCallbackcallback){ factory.addCallback(getFaceByImageMd5(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFaceCount(java.lang.String)} */ public ListenableFuture getFaceCount(String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.getFaceCount(where); return factory.wrap(async,future); } public void getFaceCount(String where, FutureCallbackcallback){ factory.addCallback(getFaceCount(where), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFacesByFeatureId(java.lang.String)} */ public ListenableFuture> getFacesByFeatureId(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = com.google.common.util.concurrent.Futures.transform( async.getFacesByFeatureId(featureId), new com.google.common.base.Function,List>(){ @Override public List apply(List input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FaceBean.class, FaceBean.class); } }); return factory.wrap(async,future); } public void getFacesByFeatureId(String featureId, FutureCallback>callback){ factory.addCallback(getFacesByFeatureId(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFacesByImageMd5(java.lang.String)} */ public ListenableFuture> getFacesByImageMd5(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = com.google.common.util.concurrent.Futures.transform( async.getFacesByImageMd5(imageMd5), new com.google.common.base.Function,List>(){ @Override public List apply(List input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FaceBean.class, FaceBean.class); } }); return factory.wrap(async,future); } public void getFacesByImageMd5(String imageMd5, FutureCallback>callback){ factory.addCallback(getFacesByImageMd5(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFeature(java.lang.String)} */ public ListenableFuture getFeature(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getFeature(featureId), new com.google.common.base.Function(){ @Override public FeatureBean apply(net.gdface.facedb.thrift.client.FeatureBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FeatureBean.class, FeatureBean.class); } }); return factory.wrap(async,future); } public void getFeature(String featureId, FutureCallbackcallback){ factory.addCallback(getFeature(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFeatureByFaceId(int)} */ public ListenableFuture getFeatureByFaceId(int faceId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getFeatureByFaceId(faceId), new com.google.common.base.Function(){ @Override public FeatureBean apply(net.gdface.facedb.thrift.client.FeatureBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FeatureBean.class, FeatureBean.class); } }); return factory.wrap(async,future); } public void getFeatureByFaceId(int faceId, FutureCallbackcallback){ factory.addCallback(getFeatureByFaceId(faceId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFeatureByImageMd5(java.lang.String)} */ public ListenableFuture getFeatureByImageMd5(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getFeatureByImageMd5(imageMd5), new com.google.common.base.Function(){ @Override public FeatureBean apply(net.gdface.facedb.thrift.client.FeatureBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FeatureBean.class, FeatureBean.class); } }); return factory.wrap(async,future); } public void getFeatureByImageMd5(String imageMd5, FutureCallbackcallback){ factory.addCallback(getFeatureByImageMd5(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFeatureCount()} */ public ListenableFuture getFeatureCount(){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.getFeatureCount(); return factory.wrap(async,future); } public void getFeatureCount(FutureCallbackcallback){ factory.addCallback(getFeatureCount(), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getFeaturesByImageMd5(java.lang.String)} */ public ListenableFuture> getFeaturesByImageMd5(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = com.google.common.util.concurrent.Futures.transform( async.getFeaturesByImageMd5(imageMd5), new com.google.common.base.Function,List>(){ @Override public List apply(List input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.FeatureBean.class, FeatureBean.class); } }); return factory.wrap(async,future); } public void getFeaturesByImageMd5(String imageMd5, FutureCallback>callback){ factory.addCallback(getFeaturesByImageMd5(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImage(java.lang.String)} */ public ListenableFuture getImage(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getImage(imageMd5), new com.google.common.base.Function(){ @Override public ImageBean apply(net.gdface.facedb.thrift.client.ImageBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void getImage(String imageMd5, FutureCallbackcallback){ factory.addCallback(getImage(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImage(java.lang.String,java.lang.String)} */ public ListenableFuture getImage(String primaryKey, String refType){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getImageRef(primaryKey, refType), new com.google.common.base.Function(){ @Override public ImageBean apply(net.gdface.facedb.thrift.client.ImageBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void getImage(String primaryKey, String refType, FutureCallbackcallback){ factory.addCallback(getImage(primaryKey,refType), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImageByFaceId(int)} */ public ListenableFuture getImageByFaceId(int faceId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getImageByFaceId(faceId), new com.google.common.base.Function(){ @Override public ImageBean apply(net.gdface.facedb.thrift.client.ImageBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void getImageByFaceId(int faceId, FutureCallbackcallback){ factory.addCallback(getImageByFaceId(faceId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImageByFeatureId(java.lang.String)} */ public ListenableFuture getImageByFeatureId(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.getImageByFeatureId(featureId), new com.google.common.base.Function(){ @Override public ImageBean apply(net.gdface.facedb.thrift.client.ImageBean input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void getImageByFeatureId(String featureId, FutureCallbackcallback){ factory.addCallback(getImageByFeatureId(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImageBytes(java.lang.String)} */ public ListenableFuture getImageBytes(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.getImageBytes(imageMd5); return factory.wrap(async,future); } public void getImageBytes(String imageMd5, FutureCallbackcallback){ factory.addCallback(getImageBytes(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImageBytes(java.lang.String,java.lang.String)} */ public ListenableFuture getImageBytes(String primaryKey, String refType){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.getImageBytesRef(primaryKey, refType); return factory.wrap(async,future); } public void getImageBytes(String primaryKey, String refType, FutureCallbackcallback){ factory.addCallback(getImageBytes(primaryKey,refType), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImageCount(java.lang.String)} */ public ListenableFuture getImageCount(String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.getImageCount(where); return factory.wrap(async,future); } public void getImageCount(String where, FutureCallbackcallback){ factory.addCallback(getImageCount(where), callback); } /** * see also {@link net.gdface.facedb.FaceDb#getImagesByFeatureId(java.lang.String)} */ public ListenableFuture> getImagesByFeatureId(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = com.google.common.util.concurrent.Futures.transform( async.getImagesByFeatureId(featureId), new com.google.common.base.Function,List>(){ @Override public List apply(List input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void getImagesByFeatureId(String featureId, FutureCallback>callback){ factory.addCallback(getImagesByFeatureId(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#hasFeature(byte[])} */ public ListenableFuture hasFeature(byte[] feature){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.hasFeature(feature); return factory.wrap(async,future); } public void hasFeature(byte[] feature, FutureCallbackcallback){ factory.addCallback(hasFeature(feature), callback); } /** * see also {@link net.gdface.facedb.FaceDb#hasFeatureByMD5(java.lang.String)} */ public ListenableFuture hasFeatureByMD5(String featureId){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.hasFeatureByMD5(featureId); return factory.wrap(async,future); } public void hasFeatureByMD5(String featureId, FutureCallbackcallback){ factory.addCallback(hasFeatureByMD5(featureId), callback); } /** * see also {@link net.gdface.facedb.FaceDb#hasImage(java.lang.String)} */ public ListenableFuture hasImage(String imageMd5){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = async.hasImage(imageMd5); return factory.wrap(async,future); } public void hasImage(String imageMd5, FutureCallbackcallback){ factory.addCallback(hasImage(imageMd5), callback); } /** * see also {@link net.gdface.facedb.FaceDb#isLocal()} */ public boolean isLocal(){ return false; } /** * see also {@link net.gdface.facedb.FaceDb#loadFeaturesMd5ByCreateTime(java.lang.String)} */ public ListenableFuture> loadFeaturesMd5ByCreateTime(String timestamp){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = async.loadFeaturesMd5ByCreateTimeTimeStr(timestamp); return factory.wrap(async,future); } public void loadFeaturesMd5ByCreateTime(String timestamp, FutureCallback>callback){ factory.addCallback(loadFeaturesMd5ByCreateTime(timestamp), callback); } /** * see also {@link net.gdface.facedb.FaceDb#loadFeaturesMd5ByCreateTime(java.util.Date)} */ public ListenableFuture> loadFeaturesMd5ByCreateTime(Date timestamp){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = async.loadFeaturesMd5ByCreateTime(TypeTransformer.getInstance().to( timestamp, Date.class, Long.class)); return factory.wrap(async,future); } public void loadFeaturesMd5ByCreateTime(Date timestamp, FutureCallback>callback){ factory.addCallback(loadFeaturesMd5ByCreateTime(timestamp), callback); } /** * see also {@link net.gdface.facedb.FaceDb#loadFeaturesMd5ByWhere(java.lang.String)} */ public ListenableFuture> loadFeaturesMd5ByWhere(String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = async.loadFeaturesMd5ByWhere(where); return factory.wrap(async,future); } public void loadFeaturesMd5ByWhere(String where, FutureCallback>callback){ factory.addCallback(loadFeaturesMd5ByWhere(where), callback); } /** * see also {@link net.gdface.facedb.FaceDb#loadImagesByWhere(java.lang.String,int,int)} */ public ListenableFuture> loadImagesByWhere(String where, int startRow, int numRows){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = com.google.common.util.concurrent.Futures.transform( async.loadImagesByWhere(where, startRow, numRows), new com.google.common.base.Function,List>(){ @Override public List apply(List input) { return TypeTransformer.getInstance().to( input, net.gdface.facedb.thrift.client.ImageBean.class, ImageBean.class); } }); return factory.wrap(async,future); } public void loadImagesByWhere(String where, int startRow, int numRows, FutureCallback>callback){ factory.addCallback(loadImagesByWhere(where,startRow,numRows), callback); } /** * see also {@link net.gdface.facedb.FaceDb#loadImagesMd5ByCreateTime(java.lang.String)} */ public ListenableFuture> loadImagesMd5ByCreateTime(String timestamp){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = async.loadImagesMd5ByCreateTimeTimeStr(timestamp); return factory.wrap(async,future); } public void loadImagesMd5ByCreateTime(String timestamp, FutureCallback>callback){ factory.addCallback(loadImagesMd5ByCreateTime(timestamp), callback); } /** * see also {@link net.gdface.facedb.FaceDb#loadImagesMd5ByCreateTime(java.util.Date)} */ public ListenableFuture> loadImagesMd5ByCreateTime(Date timestamp){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = async.loadImagesMd5ByCreateTime(TypeTransformer.getInstance().to( timestamp, Date.class, Long.class)); return factory.wrap(async,future); } public void loadImagesMd5ByCreateTime(Date timestamp, FutureCallback>callback){ factory.addCallback(loadImagesMd5ByCreateTime(timestamp), callback); } /** * see also {@link net.gdface.facedb.FaceDb#loadImagesMd5ByWhere(java.lang.String)} */ public ListenableFuture> loadImagesMd5ByWhere(String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture> future = async.loadImagesMd5ByWhere(where); return factory.wrap(async,future); } public void loadImagesMd5ByWhere(String where, FutureCallback>callback){ factory.addCallback(loadImagesMd5ByWhere(where), callback); } /** * see also {@link net.gdface.facedb.FaceDb#searchFaces(byte[],net.gdface.sdk.CodeInfo,double,int,java.lang.String)} */ public ListenableFuture searchFaces(byte[] imgData, CodeInfo facePos, double similarty, int rows, String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.searchFaces(imgData, TypeTransformer.getInstance().to( facePos, CodeInfo.class, net.gdface.facedb.thrift.client.CodeInfo.class), similarty, rows, where), new com.google.common.base.Function,SearchResult[]>(){ @Override public SearchResult[] apply(java.util.List input) { return TypeTransformer.getInstance().toArray( input, net.gdface.facedb.thrift.client.SearchResult.class, SearchResult.class); } }); return factory.wrap(async,future); } public void searchFaces(byte[] imgData, CodeInfo facePos, double similarty, int rows, String where, FutureCallbackcallback){ factory.addCallback(searchFaces(imgData,facePos,similarty,rows,where), callback); } /** * see also {@link net.gdface.facedb.FaceDb#searchFaces(com.gitee.l0km.ximage.MatType,byte[],int,int,net.gdface.sdk.CodeInfo,double,int,java.lang.String)} */ public ListenableFuture searchFaces(MatType matType, byte[] matData, int width, int height, CodeInfo facePos, double similarty, int rows, String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.searchFacesMat(TypeTransformer.getInstance().to( matType, MatType.class, net.gdface.facedb.thrift.client.MatType.class), matData, width, height, TypeTransformer.getInstance().to( facePos, CodeInfo.class, net.gdface.facedb.thrift.client.CodeInfo.class), similarty, rows, where), new com.google.common.base.Function,SearchResult[]>(){ @Override public SearchResult[] apply(java.util.List input) { return TypeTransformer.getInstance().toArray( input, net.gdface.facedb.thrift.client.SearchResult.class, SearchResult.class); } }); return factory.wrap(async,future); } public void searchFaces(MatType matType, byte[] matData, int width, int height, CodeInfo facePos, double similarty, int rows, String where, FutureCallbackcallback){ factory.addCallback(searchFaces(matType,matData,width,height,facePos,similarty,rows,where), callback); } /** * see also {@link net.gdface.facedb.FaceDb#searchFeatures(byte[],double,int,java.lang.String)} */ public ListenableFuture searchFeatures(byte[] feature, double similarty, int rows, String where){ net.gdface.facedb.thrift.client.FaceDb.Async async = delegate(); ListenableFuture future = com.google.common.util.concurrent.Futures.transform( async.searchFeatures(feature, similarty, rows, where), new com.google.common.base.Function,SearchResult[]>(){ @Override public SearchResult[] apply(java.util.List input) { return TypeTransformer.getInstance().toArray( input, net.gdface.facedb.thrift.client.SearchResult.class, SearchResult.class); } }); return factory.wrap(async,future); } public void searchFeatures(byte[] feature, double similarty, int rows, String where, FutureCallbackcallback){ factory.addCallback(searchFeatures(feature,similarty,rows,where), callback); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy