1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.shared.kerberos.codec.hostAddress.actions;
21
22
23 import org.apache.directory.api.asn1.actions.AbstractReadInteger;
24 import org.apache.directory.shared.kerberos.codec.hostAddress.HostAddressContainer;
25 import org.apache.directory.shared.kerberos.codec.types.HostAddrType;
26 import org.apache.directory.shared.kerberos.components.HostAddress;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30
31
32
33
34
35
36 public class StoreAddrType extends AbstractReadInteger<HostAddressContainer>
37 {
38
39 private static final Logger LOG = LoggerFactory.getLogger( StoreAddrType.class );
40
41
42 private static final boolean IS_DEBUG = LOG.isDebugEnabled();
43
44
45
46
47
48 public StoreAddrType()
49 {
50 super( "Creates a HostAddress instance", 0, Integer.MAX_VALUE );
51 }
52
53
54
55
56
57 @Override
58 protected void setIntegerValue( int value, HostAddressContainer hostAddressContainer )
59 {
60 HostAddress hostAddressData = hostAddressContainer.getHostAddress();
61
62 HostAddrType hostAddrType = HostAddrType.getTypeByOrdinal( value );
63 hostAddressData.setAddrType( hostAddrType );
64
65 if ( IS_DEBUG )
66 {
67 LOG.debug( "addr-type : {}", hostAddrType );
68 }
69 }
70 }