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.encKrbPrivPart.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.encKrbPrivPart.EncKrbPrivPartContainer;
28 import org.apache.directory.shared.kerberos.components.EncKrbPrivPart;
29 import org.slf4j.Logger;
30 import org.slf4j.LoggerFactory;
31
32
33
34
35
36
37
38 public class EncKrbPrivPartInit extends GrammarAction<EncKrbPrivPartContainer>
39 {
40
41 private static final Logger LOG = LoggerFactory.getLogger( EncKrbPrivPartInit.class );
42
43
44 private static final boolean IS_DEBUG = LOG.isDebugEnabled();
45
46
47
48
49
50 public EncKrbPrivPartInit()
51 {
52 super( "Creates a EncKrbPrivPart instance" );
53 }
54
55
56
57
58
59 public void action( EncKrbPrivPartContainer encKrbPrivPartContainer ) throws DecoderException
60 {
61 TLV tlv = encKrbPrivPartContainer.getCurrentTLV();
62
63
64 if ( tlv.getLength() == 0 )
65 {
66 LOG.error( I18n.err( I18n.ERR_01308_ZERO_LENGTH_TLV ) );
67
68
69 throw new DecoderException( I18n.err( I18n.ERR_01309_EMPTY_TLV ) );
70 }
71
72 EncKrbPrivParteros/components/EncKrbPrivPart.html#EncKrbPrivPart">EncKrbPrivPart encKrbPrivPart = new EncKrbPrivPart();
73 encKrbPrivPartContainer.setEncKrbPrivPart( encKrbPrivPart );
74
75 if ( IS_DEBUG )
76 {
77 LOG.debug( "EncKrbPrivPart created" );
78 }
79 }
80 }