directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1039405 - /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
Date Fri, 26 Nov 2010 15:10:17 GMT
Author: kayyagari
Date: Fri Nov 26 15:10:17 2010
New Revision: 1039405

URL: http://svn.apache.org/viewvc?rev=1039405&view=rev
Log:
o extends AbstractReadByteArray

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java?rev=1039405&r1=1039404&r2=1039405&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/EncKdcRepPart/actions/StoreFlags.java
Fri Nov 26 15:10:17 2010
@@ -21,15 +21,10 @@ package org.apache.directory.shared.kerb
 
 
 import org.apache.directory.shared.asn1.ber.Asn1Container;
-import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
-import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.EncKdcRepPart.EncKdcRepPartContainer;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadByteArray;
 import org.apache.directory.shared.kerberos.components.EncKdcRepPart;
 import org.apache.directory.shared.kerberos.flags.TicketFlags;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -37,14 +32,8 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreFlags extends GrammarAction
+public class StoreFlags extends AbstractReadByteArray
 {
-    /** The logger */
-    private static final Logger LOG = LoggerFactory.getLogger( StoreFlags.class );
-
-    /** Speedup for logs */
-    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-
 
     /**
      * Instantiates a new StoreFlagss action.
@@ -58,29 +47,14 @@ public class StoreFlags extends GrammarA
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    @Override
+    protected void setByteArry( byte[] data, Asn1Container container )
     {
         EncKdcRepPartContainer encKdcRepPartContainer = ( EncKdcRepPartContainer ) container;
-
-        TLV tlv = encKdcRepPartContainer.getCurrentTLV();
-
-        // The Length should not be null, and should be 5
-        if ( tlv.getLength() != 5 )
-        {
-            LOG.error( I18n.err( I18n.ERR_04066 ) );
-
-            // This will generate a PROTOCOL_ERROR
-            throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
-        }
-        
         EncKdcRepPart encKdcRepPart = encKdcRepPartContainer.getEncKdcRepPart();
-        TicketFlags flags = new TicketFlags( tlv.getValue().getData() );
+        TicketFlags flags = new TicketFlags( data );
         
         encKdcRepPart.setFlags( flags );
-        
-        if ( IS_DEBUG )
-        {
-            LOG.debug( "TicketFlags : {}", flags );
-        }
+
     }
 }



Mime
View raw message