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.apReq.actions;
21
22
23 import org.apache.directory.api.asn1.DecoderException;
24 import org.apache.directory.api.asn1.ber.grammar.GrammarAction;
25 import org.apache.directory.api.asn1.ber.tlv.TLV;
26 import org.apache.directory.api.i18n.I18n;
27 import org.apache.directory.shared.kerberos.codec.apReq.ApReqContainer;
28 import org.apache.directory.shared.kerberos.codec.options.ApOptions;
29 import org.apache.directory.shared.kerberos.messages.ApReq;
30 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory;
32
33
34
35
36
37
38
39 public class StoreApOptions extends GrammarAction<ApReqContainer>
40 {
41
42 private static final Logger LOG = LoggerFactory.getLogger( StoreApOptions.class );
43
44
45 private static final boolean IS_DEBUG = LOG.isDebugEnabled();
46
47
48
49
50
51 public StoreApOptions()
52 {
53 super( "Stores the ApOptions" );
54 }
55
56
57
58
59
60 public void action( ApReqContainer apReqContainer ) throws DecoderException
61 {
62 TLV tlv = apReqContainer.getCurrentTLV();
63
64
65 if ( tlv.getLength() != 5 )
66 {
67 LOG.error( I18n.err( I18n.ERR_01308_ZERO_LENGTH_TLV ) );
68
69
70 throw new DecoderException( I18n.err( I18n.ERR_01309_EMPTY_TLV ) );
71 }
72
73 ApReq apReq = apReqContainer.getApReq();
74 ApOptionshared/kerberos/codec/options/ApOptions.html#ApOptions">ApOptions apOptions = new ApOptions( tlv.getValue().getData() );
75
76 apReq.setApOptions( apOptions );
77
78 if ( IS_DEBUG )
79 {
80 LOG.debug( "APOptions : {}", apOptions );
81 }
82 }
83 }