summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/imagemaster/thrift/server/ImageServerHandler.java
blob: fbe6d6b0db89ff88fa3f5e820c0381abdf57cda0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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<Integer> 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<OrganizationData> getOrganizations()
	{
		return ApiServer.getOrganizations();
	}

	@Override
	public List<UserInfo> 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<ImageData> 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 );
	}
}