package org.openslx.imagemaster.thrift.server; import java.nio.ByteBuffer; import java.util.List; import org.apache.thrift.TException; import org.openslx.imagemaster.server.ApiServer; import org.openslx.imagemaster.thrift.iface.AuthenticationException; import org.openslx.imagemaster.thrift.iface.AuthorizationException; import org.openslx.imagemaster.thrift.iface.DownloadData; import org.openslx.imagemaster.thrift.iface.ImageData; import org.openslx.imagemaster.thrift.iface.ImageDataException; import org.openslx.imagemaster.thrift.iface.ImageServer; import org.openslx.imagemaster.thrift.iface.InvalidTokenException; import org.openslx.imagemaster.thrift.iface.OrganizationData; import org.openslx.imagemaster.thrift.iface.ServerSessionData; import org.openslx.imagemaster.thrift.iface.SessionData; import org.openslx.imagemaster.thrift.iface.UploadData; import org.openslx.imagemaster.thrift.iface.UploadException; import org.openslx.imagemaster.thrift.iface.UserInfo; public class ImageServerHandler implements ImageServer.Iface { @Override public boolean ping() { return true; } @Override public SessionData authenticate( String username, String password ) throws AuthenticationException { return ApiServer.authenticate( username, password ); } @Override public UserInfo getUserFromToken( String token ) throws InvalidTokenException { return ApiServer.getUserFromToken( token ); } @Override public ByteBuffer startServerAuthentication( String organization ) throws AuthenticationException { return ApiServer.startServerAuthentication( organization ); } @Override public ServerSessionData serverAuthenticate( String organization, ByteBuffer challengeResponse ) throws AuthenticationException { return ApiServer.serverAuthenticate( organization, challengeResponse ); } @Override public UploadData submitImage( String serverSessionId, ImageData imageDescription, List crcSums ) throws AuthorizationException, ImageDataException, UploadException { return ApiServer.submitImage( serverSessionId, imageDescription, crcSums ); } @Override public DownloadData getImage( String serverSessionId, String uuid ) throws AuthorizationException, ImageDataException { return ApiServer.getImage( uuid, serverSessionId ); } @Override public boolean isServerAuthenticated( String serverSessionId ) { return ApiServer.isServerAuthenticated( serverSessionId ); } @Override public List getOrganizations() { return ApiServer.getOrganizations(); } @Override public List findUser( String sessionId, String organizationId, String searchTerm ) throws AuthorizationException { return ApiServer.findUser( sessionId, organizationId, searchTerm ); } @Override public boolean publishUser( String serverSessionId, UserInfo user ) throws AuthorizationException { return ApiServer.publishUser( serverSessionId, user ); } @Override public List getPublicImages( String sessionId, int page ) throws AuthorizationException { return ApiServer.getPublicImages( sessionId, page ); } @Override public boolean registerSatellite( String organizationId, String address, String modulus, String exponent ) { return ApiServer.registerSatellite( organizationId, address, modulus, exponent ); } @Override public boolean updateSatelliteAddress( String serverSessionId, String address ) throws TException { return ApiServer.updateSatelliteAddress( serverSessionId, address ); } }