WebPreferencesRequestKey.java
1.79 KB
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
package com.mumfrey.webprefs.framework;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.util.Session;
import com.mumfrey.webprefs.interfaces.IWebPreferencesRequest;
import com.mumfrey.webprefs.interfaces.IWebPreferencesResponse;
import com.mumfrey.webprefs.interfaces.IWebPreferencesServiceDelegate;
public class WebPreferencesRequestKey extends WebPreferencesRequestAbstract
{
private static final long serialVersionUID = 1L;
protected final transient WebPreferencesService server;
public WebPreferencesRequestKey(final WebPreferencesService server, final Session session, final String hostName)
{
super(new IWebPreferencesServiceDelegate()
{
@Override
public void onRequestFailed(IWebPreferencesRequest request, Throwable th, RequestFailureReason reason)
{
server.handleKeyRequestFailed(th);
}
@Override
public void onReceivedResponse(IWebPreferencesRequest request, IWebPreferencesResponse response)
{
server.handleKeyRequestCompleted(response);
}
@Override
public Session getSession()
{
return session;
}
@Override
public String getHostName()
{
return hostName;
}
}, session.getPlayerID());
this.server = server;
}
@Override
public boolean isValidationRequired()
{
return true;
}
@Override
protected String getPath()
{
return "/key";
}
@Override
protected void validateResponse(IWebPreferencesResponse response)
{
}
@Override
public Set<String> getKeys()
{
return new HashSet<String>();
}
}