1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.dexterim.oscar.entity;
20
21
22 /***
23 * @author christoph
24 * TODO Document
25 */
26 public class TLVFactory {
27 private static TLVFactory instance;
28
29 private TLVFactory() {
30
31 }
32
33 public TLV createScreenName() {
34 return new TLV(0x0001);
35 }
36
37 public TLV createCapabilityID() {
38 return new TLV(0x0005);
39 }
40
41 public TLV createRoastedPassword() {
42 return new TLV(0x0002);
43 }
44
45 public TLV createClientIdString() {
46 return new TLV(0x0003);
47 }
48
49 public TLV createBOSServerAddress() {
50 return new TLV(0x0005);
51 }
52
53 public TLV createAuthorizationCookie() {
54 return new TLV(0x0006);
55 }
56 public TLV createClientCountry() {
57 return new TLV(0x000E);
58 }
59
60 public TLV createClientLanguage() {
61 return new TLV(0x000F);
62 }
63
64
65 public TLV createClientDistributionNumber() {
66 return new TLV(new Word(new byte[] { 0x00, 0x14 }));
67 }
68
69 public TLV createClientId() {
70 return new TLV(new Word(new byte[] { 0x00, 0x016 }));
71 }
72
73 public TLV createClientMajorVersion() {
74 return new TLV(new Word(new byte[] { 0x00, 0x17 }));
75 }
76
77 public TLV createClientMinorVersion() {
78 return new TLV(new Word(new byte[] { 0x00, 0x18 }));
79 }
80
81 public TLV createClientLesserVersion() {
82 return new TLV(new Word(new byte[] { 0x00, 0x19 }));
83 }
84
85 public TLV createClientBuildNumber() {
86 return new TLV(new Word(new byte[] { 0x00, 0x1A }));
87 }
88
89 public TLV createMOTDString() {
90 return new TLV(new Word(new byte[] { 0x00, 0x0B }));
91 }
92
93
94 public static synchronized TLVFactory getInstance() {
95 if (instance == null) {
96 instance = new TLVFactory();
97 }
98
99 return instance;
100 }
101
102 /***
103 * @return
104 */
105 public TLV createCookie() {
106 return new TLV(new Word(new byte[] { 0x00, 0x06 }));
107 }
108 }