You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/11/19 11:51:48 UTC
svn commit: r1036801 - in
/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError:
./ actions/
Author: kayyagari
Date: Fri Nov 19 10:51:47 2010
New Revision: 1036801
URL: http://svn.apache.org/viewvc?rev=1036801&view=rev
Log:
o implementation of KRB-ERROR codec
Added:
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorGrammar.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorStatesEnum.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/CheckMsgType.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/KrbErrorInit.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEData.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StorePvno.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java
directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorContainer.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError;
+
+import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.kerberos.messages.KrbError;
+
+
+/**
+ * The KrbError container stores the KRB-ERROR decoded by the Asn1Decoder.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class KrbErrorContainer extends AbstractContainer
+{
+ /** An KDC-REQ container */
+ private KrbError krbError;
+
+ /**
+ * Creates a new KrbErrorContainer object.
+ */
+ public KrbErrorContainer()
+ {
+ super();
+ this.stateStack = new int[1];
+ this.grammar = KrbErrorGrammar.getInstance();
+ setTransition( KrbErrorStatesEnum.START_STATE );
+ }
+
+
+ /**
+ * @return Returns the KrbError.
+ */
+ public KrbError getKrbError()
+ {
+ return krbError;
+ }
+
+
+ /**
+ * Set a KrbError Object into the container. It will be completed by the
+ * KerberosDecoder.
+ *
+ * @param krbError The KrbError to set.
+ */
+ public void setKrbError( KrbError krbError )
+ {
+ this.krbError = krbError;
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorGrammar.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorGrammar.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorGrammar.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,375 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError;
+
+
+import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
+import org.apache.directory.shared.asn1.ber.grammar.Grammar;
+import org.apache.directory.shared.asn1.ber.grammar.GrammarTransition;
+import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
+import org.apache.directory.shared.kerberos.KerberosConstants;
+import org.apache.directory.shared.kerberos.codec.actions.CheckNotNullLength;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.CheckMsgType;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.KrbErrorInit;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreCName;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreCRealm;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreCTime;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreEData;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreEText;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreErrorCode;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StorePvno;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreRealm;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreSName;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreSTime;
+import org.apache.directory.shared.kerberos.codec.krbError.actions.StoreSusec;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * This class implements the KrbError structure. All the actions are declared
+ * in this class. As it is a singleton, these declaration are only done once. If
+ * an action is to be added or modified, this is where the work is to be done !
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public final class KrbErrorGrammar extends AbstractGrammar
+{
+ /** The logger */
+ static final Logger LOG = LoggerFactory.getLogger( KrbErrorGrammar.class );
+
+ /** A speedup for logger */
+ static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+ /** The instance of grammar. KrbErrorGrammar is a singleton */
+ private static Grammar instance = new KrbErrorGrammar();
+
+
+ /**
+ * Creates a new KrbErrorGrammar object.
+ */
+ private KrbErrorGrammar()
+ {
+ setName( KrbErrorGrammar.class.getName() );
+
+ // Create the transitions table
+ super.transitions = new GrammarTransition[KrbErrorStatesEnum.LAST_KRB_ERR_STATE.ordinal()][256];
+
+ // ============================================================================================
+ // KrbError
+ // ============================================================================================
+ // --------------------------------------------------------------------------------------------
+ // Transition from KrbError init to KrbError tag
+ // --------------------------------------------------------------------------------------------
+ // KRB-ERROR ::= [APPLICATION 30]
+ super.transitions[KrbErrorStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_ERR_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.START_STATE, KrbErrorStatesEnum.KRB_ERR_TAG, KerberosConstants.KRB_ERR_TAG,
+ new KrbErrorInit() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from KrbError tag to KrbError SEQ
+ // --------------------------------------------------------------------------------------------
+ // KRB-ERROR ::= [APPLICATION 30] SEQUENCE {
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_TAG.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_TAG, KrbErrorStatesEnum.KRB_ERR_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from KrbError SEQ to pvno tag
+ // --------------------------------------------------------------------------------------------
+ // KRB-ERROR ::= SEQUENCE {
+ // pvno [0]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_SEQ_STATE.ordinal()][KerberosConstants.KRB_ERR_PVNO_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_SEQ_STATE, KrbErrorStatesEnum.KRB_ERR_PVNO_TAG_STATE, KerberosConstants.KRB_ERR_PVNO_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from pvno tag to pvno value
+ // --------------------------------------------------------------------------------------------
+ // KRB-ERROR ::= SEQUENCE {
+ // pvno [0] INTEGER (5) ,
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_PVNO_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_PVNO_STATE, UniversalTag.INTEGER.getValue(),
+ new StorePvno() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from pvno to msg-type tag
+ // --------------------------------------------------------------------------------------------
+ // msg-type [1]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_PVNO_STATE.ordinal()][KerberosConstants.KRB_ERR_MSGTYPE_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_PVNO_STATE, KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_TAG_STATE, KerberosConstants.KRB_ERR_MSGTYPE_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from msg-type tag to msg-type value
+ // --------------------------------------------------------------------------------------------
+ // msg-type [1] INTEGER (30)
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_STATE, UniversalTag.INTEGER.getValue(),
+ new CheckMsgType() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from msg-type value to cTime tag
+ // --------------------------------------------------------------------------------------------
+ // ctime [2]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_STATE.ordinal()][KerberosConstants.KRB_ERR_CTIME_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_STATE, KrbErrorStatesEnum.KRB_ERR_CTIME_TAG_STATE, KerberosConstants.KRB_ERR_CTIME_TAG,
+ new CheckNotNullLength());
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from cTime tag to cTime value
+ // --------------------------------------------------------------------------------------------
+ // ctime [2] KerberosTime OPTIONAL
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CTIME_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CTIME_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_CTIME_STATE, UniversalTag.GENERALIZED_TIME.getValue(),
+ new StoreCTime() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from cTime value to cusec tag
+ // --------------------------------------------------------------------------------------------
+ // cusec [3]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CTIME_STATE.ordinal()][KerberosConstants.KRB_ERR_CUSEC_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CTIME_STATE, KrbErrorStatesEnum.KRB_ERR_CUSEC_TAG_STATE, KerberosConstants.KRB_ERR_CUSEC_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from cusec tag to cusec value
+ // --------------------------------------------------------------------------------------------
+ // cusec [3] Microseconds OPTIONAL
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CUSEC_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CUSEC_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_CUSEC_STATE, UniversalTag.INTEGER.getValue(),
+ new StoreSusec() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from cusec value to stime tag
+ // --------------------------------------------------------------------------------------------
+ // stime [4]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CUSEC_STATE.ordinal()][KerberosConstants.KRB_ERR_STIME_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CUSEC_STATE, KrbErrorStatesEnum.KRB_ERR_STIME_TAG_STATE, KerberosConstants.KRB_ERR_STIME_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from stime tag to stime value
+ // --------------------------------------------------------------------------------------------
+ // stime [4] KerberosTime
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_STIME_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_STIME_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_STIME_STATE, UniversalTag.GENERALIZED_TIME.getValue(),
+ new StoreSTime() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from stime value to susec tag
+ // --------------------------------------------------------------------------------------------
+ // susec [5]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_STIME_STATE.ordinal()][KerberosConstants.KRB_ERR_SUSEC_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_STIME_STATE, KrbErrorStatesEnum.KRB_ERR_SUSEC_TAG_STATE, KerberosConstants.KRB_ERR_SUSEC_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from susec tag to susec value
+ // --------------------------------------------------------------------------------------------
+ // susec [5] Microseconds
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_SUSEC_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_SUSEC_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_SUSEC_STATE, UniversalTag.INTEGER.getValue(),
+ new StoreSusec() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from susec value to error-code tag
+ // --------------------------------------------------------------------------------------------
+ // error-code [6]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_SUSEC_STATE.ordinal()][KerberosConstants.KRB_ERR_ERROR_CODE_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_SUSEC_STATE, KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_TAG_STATE, KerberosConstants.KRB_ERR_ERROR_CODE_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from error-code tag to error-code value
+ // --------------------------------------------------------------------------------------------
+ // error-code [6] Int32
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_STATE, UniversalTag.INTEGER.getValue(),
+ new StoreErrorCode() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from error-code value to crealm tag
+ // --------------------------------------------------------------------------------------------
+ // crealm [7]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_STATE.ordinal()][KerberosConstants.KRB_ERR_CREALM_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_STATE, KrbErrorStatesEnum.KRB_ERR_CREALM_TAG_STATE, KerberosConstants.KRB_ERR_CREALM_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from crealm tag to crealm value
+ // --------------------------------------------------------------------------------------------
+ // crealm [7] Realm
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CREALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CREALM_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_CREALM_STATE, UniversalTag.GENERAL_STRING.getValue(),
+ new StoreCRealm() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from crealm value to cname tag
+ // --------------------------------------------------------------------------------------------
+ // cname [8]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CREALM_STATE.ordinal()][KerberosConstants.KRB_ERR_CNAME_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CREALM_STATE, KrbErrorStatesEnum.KRB_ERR_CNAME_TAG_STATE, KerberosConstants.KRB_ERR_CNAME_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from cname tag to cname value
+ // --------------------------------------------------------------------------------------------
+ // cname [8] PrincipalName OPTIONAL
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CNAME_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CNAME_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_CNAME_STATE, UniversalTag.SEQUENCE.getValue(),
+ new StoreCName() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from cname value to realm tag
+ // --------------------------------------------------------------------------------------------
+ // realm [9]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CNAME_STATE.ordinal()][KerberosConstants.KRB_ERR_REALM_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CNAME_STATE, KrbErrorStatesEnum.KRB_ERR_REALM_TAG_STATE, KerberosConstants.KRB_ERR_REALM_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from realm tag to realm value
+ // --------------------------------------------------------------------------------------------
+ // realm [9] Realm
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_REALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_REALM_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_REALM_STATE, UniversalTag.GENERAL_STRING.getValue(),
+ new StoreRealm() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from realm value sname tag
+ // --------------------------------------------------------------------------------------------
+ // sname [10]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_REALM_STATE.ordinal()][KerberosConstants.KRB_ERR_SNAME_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_REALM_STATE, KrbErrorStatesEnum.KRB_ERR_SNAME_TAG_STATE, KerberosConstants.KRB_ERR_SNAME_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from sname tag to sname value
+ // --------------------------------------------------------------------------------------------
+ // sname [10] PrincipalName
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_SNAME_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_SNAME_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_SNAME_STATE, UniversalTag.SEQUENCE.getValue(),
+ new StoreSName() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from sname value to etext tag
+ // --------------------------------------------------------------------------------------------
+ // e-text [11]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_SNAME_STATE.ordinal()][KerberosConstants.KRB_ERR_ETEXT_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_SNAME_STATE, KrbErrorStatesEnum.KRB_ERR_ETEXT_TAG_STATE, KerberosConstants.KRB_ERR_ETEXT_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from etext tag to etext value
+ // --------------------------------------------------------------------------------------------
+ // e-text [11] KerberosString OPTIONAL
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_ETEXT_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_ETEXT_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_ETEXT_STATE, UniversalTag.GENERAL_STRING.getValue(),
+ new StoreEText() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from etext value to edata tag
+ // --------------------------------------------------------------------------------------------
+ // e-data [12]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_ETEXT_STATE.ordinal()][KerberosConstants.KRB_ERR_EDATA_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_ETEXT_STATE, KrbErrorStatesEnum.KRB_ERR_EDATA_TAG_STATE, KerberosConstants.KRB_ERR_EDATA_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from edata tag to edata value
+ // --------------------------------------------------------------------------------------------
+ // e-data [12] OCTET STRING OPTIONAL
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_EDATA_TAG_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_EDATA_TAG_STATE, KrbErrorStatesEnum.KRB_ERR_EDATA_STATE, UniversalTag.OCTET_STRING.getValue(),
+ new StoreEData() );
+
+
+ // ----------------------------------------- OPTIONAL transitions -----------------------------------------
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from msg-type value to cusec tag
+ // --------------------------------------------------------------------------------------------
+ // cusec [3]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_STATE.ordinal()][KerberosConstants.KRB_ERR_CUSEC_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_STATE, KrbErrorStatesEnum.KRB_ERR_CUSEC_TAG_STATE, KerberosConstants.KRB_ERR_CUSEC_TAG,
+ new CheckNotNullLength());
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from msg-type value to stime tag
+ // --------------------------------------------------------------------------------------------
+ // stime [4]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_STATE.ordinal()][KerberosConstants.KRB_ERR_STIME_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_MSG_TYPE_STATE, KrbErrorStatesEnum.KRB_ERR_STIME_TAG_STATE, KerberosConstants.KRB_ERR_STIME_TAG,
+ new CheckNotNullLength());
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from cTime value to stime tag
+ // --------------------------------------------------------------------------------------------
+ // stime [4]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CTIME_STATE.ordinal()][KerberosConstants.KRB_ERR_STIME_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CTIME_STATE, KrbErrorStatesEnum.KRB_ERR_STIME_TAG_STATE, KerberosConstants.KRB_ERR_STIME_TAG,
+ new CheckNotNullLength() );
+
+ // from erro-code to realm
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from error-code value to realm tag
+ // --------------------------------------------------------------------------------------------
+ // realm [9]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_STATE.ordinal()][KerberosConstants.KRB_ERR_REALM_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_STATE, KrbErrorStatesEnum.KRB_ERR_REALM_TAG_STATE, KerberosConstants.KRB_ERR_REALM_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from error-code value to cname tag
+ // --------------------------------------------------------------------------------------------
+ // cname [8]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_STATE.ordinal()][KerberosConstants.KRB_ERR_CNAME_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_ERROR_CODE_STATE, KrbErrorStatesEnum.KRB_ERR_CNAME_TAG_STATE, KerberosConstants.KRB_ERR_CNAME_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from crealm value to realm tag
+ // --------------------------------------------------------------------------------------------
+ // realm [9]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_CREALM_STATE.ordinal()][KerberosConstants.KRB_ERR_REALM_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_CREALM_STATE, KrbErrorStatesEnum.KRB_ERR_REALM_TAG_STATE, KerberosConstants.KRB_ERR_REALM_TAG,
+ new CheckNotNullLength() );
+
+ // --------------------------------------------------------------------------------------------
+ // Transition from sname value to edata tag
+ // --------------------------------------------------------------------------------------------
+ // e-data [12]
+ super.transitions[KrbErrorStatesEnum.KRB_ERR_SNAME_STATE.ordinal()][KerberosConstants.KRB_ERR_EDATA_TAG] = new GrammarTransition(
+ KrbErrorStatesEnum.KRB_ERR_SNAME_STATE, KrbErrorStatesEnum.KRB_ERR_EDATA_TAG_STATE, KerberosConstants.KRB_ERR_EDATA_TAG,
+ new CheckNotNullLength() );
+ }
+
+ /**
+ * Get the instance of this grammar
+ *
+ * @return An instance on the KRB-ERROR Grammar
+ */
+ public static Grammar getInstance()
+ {
+ return instance;
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorStatesEnum.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorStatesEnum.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/KrbErrorStatesEnum.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError;
+
+
+import org.apache.directory.shared.asn1.ber.grammar.Grammar;
+import org.apache.directory.shared.asn1.ber.grammar.States;
+import org.apache.directory.shared.kerberos.codec.KerberosMessageGrammar;
+
+
+/**
+ * This class store the KRB-ERROR grammar's constants. It is also used for debugging
+ * purpose
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public enum KrbErrorStatesEnum implements States
+{
+ // Start
+ START_STATE, // 0
+
+ // ----- KRB-ERROR component --------------------------------------
+ KRB_ERR_TAG, // 1
+
+ KRB_ERR_SEQ_STATE, // 2
+
+ KRB_ERR_PVNO_TAG_STATE, // 3
+ KRB_ERR_PVNO_STATE, // 4
+
+ KRB_ERR_MSG_TYPE_TAG_STATE, // 5
+ KRB_ERR_MSG_TYPE_STATE, // 6
+
+ KRB_ERR_CTIME_TAG_STATE, // 7
+ KRB_ERR_CTIME_STATE, // 8
+
+ KRB_ERR_CUSEC_TAG_STATE, // 9
+ KRB_ERR_CUSEC_STATE, // 10
+
+ KRB_ERR_STIME_TAG_STATE, // 11
+ KRB_ERR_STIME_STATE, // 12
+
+ KRB_ERR_SUSEC_TAG_STATE, // 13
+ KRB_ERR_SUSEC_STATE, // 14
+
+ KRB_ERR_ERROR_CODE_TAG_STATE, // 15
+ KRB_ERR_ERROR_CODE_STATE, // 16
+
+ KRB_ERR_CREALM_TAG_STATE, // 17
+ KRB_ERR_CREALM_STATE, // 18
+
+ KRB_ERR_CNAME_TAG_STATE, // 19
+ KRB_ERR_CNAME_STATE, // 20
+
+ KRB_ERR_REALM_TAG_STATE, // 21
+ KRB_ERR_REALM_STATE, // 22
+
+ KRB_ERR_SNAME_TAG_STATE, // 23
+ KRB_ERR_SNAME_STATE, // 24
+
+ KRB_ERR_ETEXT_TAG_STATE, // 25
+ KRB_ERR_ETEXT_STATE, // 26
+
+ KRB_ERR_EDATA_TAG_STATE, // 27
+ KRB_ERR_EDATA_STATE, // 28
+
+ // End
+ LAST_KRB_ERR_STATE; // 29
+
+
+ /**
+ * Get the grammar name
+ *
+ * @param grammar The grammar code
+ * @return The grammar name
+ */
+ public String getGrammarName( int grammar )
+ {
+ return "KRB_ERR_GRAMMAR";
+ }
+
+
+ /**
+ * Get the grammar name
+ *
+ * @param grammar The grammar class
+ * @return The grammar name
+ */
+ public String getGrammarName( Grammar grammar )
+ {
+ if ( grammar instanceof KerberosMessageGrammar )
+ {
+ return "KRB_ERR_GRAMMAR";
+ }
+ else
+ {
+ return "UNKNOWN GRAMMAR";
+ }
+ }
+
+
+ /**
+ * Get the string representing the state
+ *
+ * @param state The state number
+ * @return The String representing the state
+ */
+ public String getState( int state )
+ {
+ return ( ( state == LAST_KRB_ERR_STATE.ordinal() ) ? "LAST_KRB_ERR_STATE" : name() );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEndState()
+ {
+ return this == LAST_KRB_ERR_STATE;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public KrbErrorStatesEnum getStartState()
+ {
+ return START_STATE;
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/CheckMsgType.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/CheckMsgType.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/CheckMsgType.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.asn1.codec.DecoderException;
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.kerberos.KerberosMessageType;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadMsgType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to store the msg-type
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class CheckMsgType extends AbstractReadMsgType
+{
+ /** The logger */
+ private static final Logger LOG = LoggerFactory.getLogger( CheckMsgType.class );
+
+
+ /**
+ * Instantiates a new StoreMsgType action.
+ */
+ public CheckMsgType()
+ {
+ super( "KRB-ERROR msg-type" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void verifyMsgType( KerberosMessageType krbMsgType, Asn1Container container ) throws DecoderException
+ {
+ // The message type must be the expected one
+ if ( krbMsgType != KerberosMessageType.KRB_ERROR )
+ {
+ String msg = "The msg-type should be KRB-ERROR";
+ LOG.error( I18n.err( I18n.ERR_04070, krbMsgType, msg ) );
+
+ // This will generate a PROTOCOL_ERROR
+ throw new DecoderException( msg );
+ }
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/KrbErrorInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/KrbErrorInit.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/KrbErrorInit.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/KrbErrorInit.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+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.krbError.KrbErrorContainer;
+import org.apache.directory.shared.kerberos.messages.KrbError;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to initialize the KrbError object
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class KrbErrorInit extends GrammarAction
+{
+ /** The logger */
+ private static final Logger LOG = LoggerFactory.getLogger( KrbErrorInit.class );
+
+ /** Speedup for logs */
+ private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+
+ /**
+ * Instantiates a new KrbErrorInit action.
+ */
+ public KrbErrorInit()
+ {
+ super( "Creates a KrbError instance" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void action( Asn1Container container ) throws DecoderException
+ {
+ KrbErrorContainer krbErrorContainer = ( KrbErrorContainer ) container;
+
+ TLV tlv = krbErrorContainer.getCurrentTLV();
+
+ // The Length should not be null
+ if ( tlv.getLength() == 0 )
+ {
+ LOG.error( I18n.err( I18n.ERR_04066 ) );
+
+ // This will generate a PROTOCOL_ERROR
+ throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
+ }
+
+ KrbError krbError = new KrbError();
+ krbErrorContainer.setKrbError( krbError );
+
+ if ( IS_DEBUG )
+ {
+ LOG.debug( "KrbError created" );
+ }
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCName.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadPrincipalName;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
+
+
+/**
+ * The action used to set the KrbError cName
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCName extends AbstractReadPrincipalName
+{
+
+ /**
+ * Instantiates a new StoreCName action.
+ */
+ public StoreCName()
+ {
+ super( "KRB-ERROR cname" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setPrincipalName( PrincipalName principalName, Asn1Container container )
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+ krbErrContainer.getKrbError().setcName( principalName );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCRealm.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadRealm;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+
+
+/**
+ * The action used to set the cRealm
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCRealm extends AbstractReadRealm
+{
+
+ /**
+ * Instantiates a new StoreCRealm action.
+ */
+ public StoreCRealm()
+ {
+ super( "KRB-ERROR crealm value" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setRealm( String realm, Asn1Container container )
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+ krbErrContainer.getKrbError().setcRealm( realm );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCTime.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.KerberosTime;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadKerberosTime;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+
+
+/**
+ * The action used to store the ctime KerberosTime
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCTime extends AbstractReadKerberosTime
+{
+
+ /**
+ * Instantiates a new StoreCTime action.
+ */
+ public StoreCTime()
+ {
+ super( "Stores the CTime" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setKerberosTime( KerberosTime krbtime, Asn1Container container )
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+ krbErrContainer.getKrbError().setcTime( krbtime );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreCusec.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadInteger;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+
+
+/**
+ * The action used to store the cusec
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCusec extends AbstractReadInteger
+{
+
+ /**
+ * Instantiates a new StorePvno action.
+ */
+ public StoreCusec()
+ {
+ super( "KRB-ERROR cusec" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setIntegerValue( int value, Asn1Container container )
+ {
+ KrbErrorContainer krbErrorContainer = ( KrbErrorContainer ) container;
+ krbErrorContainer.getKrbError().setCusec( value );
+ }
+
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEData.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEData.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEData.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+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.ber.tlv.Value;
+import org.apache.directory.shared.asn1.codec.DecoderException;
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+import org.apache.directory.shared.kerberos.messages.KrbError;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to read the KrbError edata
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreEData extends GrammarAction
+{
+ /** The logger */
+ private static final Logger LOG = LoggerFactory.getLogger( StoreEData.class );
+
+ /** Speedup for logs */
+ private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+
+ /**
+ * Instantiates a new AbstractReadRealm action.
+ */
+ public StoreEData()
+ {
+ super( "KRB-ERROR edata" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public final void action( Asn1Container container ) throws DecoderException
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+
+ TLV tlv = krbErrContainer.getCurrentTLV();
+
+ // The Length should not be null
+ if ( tlv.getLength() == 0 )
+ {
+ LOG.error( I18n.err( I18n.ERR_04066 ) );
+
+ // This will generate a PROTOCOL_ERROR
+ throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
+ }
+
+ // The value is the realm
+ Value value = tlv.getValue();
+
+ KrbError krbError = krbErrContainer.getKrbError();
+ krbError.seteData( value.getData() );
+
+ if ( IS_DEBUG )
+ {
+ LOG.debug( "eData: " + StringTools.dumpBytes( value.getData() ) );
+ }
+
+ container.setGrammarEndAllowed( true );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+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.ber.tlv.Value;
+import org.apache.directory.shared.asn1.codec.DecoderException;
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+import org.apache.directory.shared.kerberos.messages.KrbError;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to read the KrbError etext
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreEText extends GrammarAction
+{
+ /** The logger */
+ private static final Logger LOG = LoggerFactory.getLogger( StoreEText.class );
+
+ /** Speedup for logs */
+ private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+
+ /**
+ * Instantiates a new AbstractReadRealm action.
+ */
+ public StoreEText()
+ {
+ super( "KRB-ERROR etext" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public final void action( Asn1Container container ) throws DecoderException
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+
+ TLV tlv = krbErrContainer.getCurrentTLV();
+
+ // The Length should not be null
+ if ( tlv.getLength() == 0 )
+ {
+ LOG.error( I18n.err( I18n.ERR_04066 ) );
+
+ // This will generate a PROTOCOL_ERROR
+ throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
+ }
+
+ // The value is the realm
+ Value value = tlv.getValue();
+ String eText = StringTools.utf8ToString( value.getData() );
+
+ KrbError krbError = krbErrContainer.getKrbError();
+ krbError.seteText( eText );
+
+ if ( IS_DEBUG )
+ {
+ LOG.debug( "eText: " + eText );
+ }
+
+ container.setGrammarEndAllowed( true );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadInteger;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+import org.apache.directory.shared.kerberos.exceptions.ErrorType;
+
+
+/**
+ * The action used to store the error-code
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreErrorCode extends AbstractReadInteger
+{
+
+ /**
+ * Instantiates a new StoreErrorCode action.
+ */
+ public StoreErrorCode()
+ {
+ super( "KRB-ERROR errorCode" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setIntegerValue( int value, Asn1Container container )
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+
+ ErrorType errorCode = ErrorType.getTypeByOrdinal( value );
+
+ krbErrContainer.getKrbError().setErrorCode( errorCode );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StorePvno.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StorePvno.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StorePvno.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadPvno;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+
+
+/**
+ * The action used to store the PVNO
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StorePvno extends AbstractReadPvno
+{
+
+ /**
+ * Instantiates a new StorePvno action.
+ */
+ public StorePvno()
+ {
+ super( "KRB-ERROR pvno" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setPvno( int pvno, Asn1Container container )
+ {
+ KrbErrorContainer krbErrorContainer = ( KrbErrorContainer ) container;
+ krbErrorContainer.getKrbError().setProtocolVersionNumber( pvno );
+ }
+
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadRealm;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+
+
+/**
+ * The action used to set the KrbError realm
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreRealm extends AbstractReadRealm
+{
+
+ /**
+ * Instantiates a new StoreRealm action.
+ */
+ public StoreRealm()
+ {
+ super( "KRB-ERROR realm value" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setRealm( String realm, Asn1Container container )
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+ krbErrContainer.getKrbError().setRealm( realm );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadPrincipalName;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+import org.apache.directory.shared.kerberos.components.PrincipalName;
+
+
+/**
+ * The action used to set the KrbError sName
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreSName extends AbstractReadPrincipalName
+{
+
+ /**
+ * Instantiates a new StoreSName action.
+ */
+ public StoreSName()
+ {
+ super( "KRB-ERROR sname" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setPrincipalName( PrincipalName principalName, Asn1Container container )
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+ krbErrContainer.getKrbError().setsName( principalName );
+ container.setGrammarEndAllowed( true );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.KerberosTime;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadKerberosTime;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+
+
+/**
+ * The action used to store the stime KerberosTime
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreSTime extends AbstractReadKerberosTime
+{
+
+ /**
+ * Instantiates a new StoreSTime action.
+ */
+ public StoreSTime()
+ {
+ super( "Stores the STime" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setKerberosTime( KerberosTime krbtime, Asn1Container container )
+ {
+ KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
+ krbErrContainer.getKrbError().setsTime( krbtime );
+ }
+}
Added: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java?rev=1036801&view=auto
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java (added)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java Fri Nov 19 10:51:47 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.shared.kerberos.codec.krbError.actions;
+
+
+import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.kerberos.codec.actions.AbstractReadInteger;
+import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
+
+
+/**
+ * The action used to store the susec
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreSusec extends AbstractReadInteger
+{
+
+ /**
+ * Instantiates a new StorePvno action.
+ */
+ public StoreSusec()
+ {
+ super( "KRB-ERROR susec" );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setIntegerValue( int value, Asn1Container container )
+ {
+ KrbErrorContainer krbErrorContainer = ( KrbErrorContainer ) container;
+ krbErrorContainer.getKrbError().setSusec( value );
+ }
+
+}