You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/01/22 16:53:36 UTC

svn commit: r371331 - /directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/extended/operations/GracefulShutdownGrammar.java

Author: elecharny
Date: Sun Jan 22 07:53:33 2006
New Revision: 371331

URL: http://svn.apache.org/viewcvs?rev=371331&view=rev
Log:
- Change the Copyright date to 2006 in the header
- Added Javadoc

Modified:
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/extended/operations/GracefulShutdownGrammar.java

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/extended/operations/GracefulShutdownGrammar.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/extended/operations/GracefulShutdownGrammar.java?rev=371331&r1=371330&r2=371331&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/extended/operations/GracefulShutdownGrammar.java (original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/extended/operations/GracefulShutdownGrammar.java Sun Jan 22 07:53:33 2006
@@ -1,5 +1,5 @@
 /*
- *   Copyright 2005 The Apache Software Foundation
+ *   Copyright 2006 The Apache Software Foundation
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -36,6 +36,13 @@
  * This class implements the Graceful shutdown. All the actions are declared in this
  * class. As it is a singleton, these declaration are only done once.
  * 
+ * The grammar is : 
+ * <pre>
+ * GracefulShutdwon ::= SEQUENCE {
+ *                        timeOffline INTEGER (0..720) DEFAULT 0,
+ *                        delay [0] INTEGER (0..86400) DEFAULT 0
+ *             }
+ * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class GracefulShutdownGrammar extends AbstractGrammar implements IGrammar
@@ -57,10 +64,22 @@
         // Create the transitions table
         super.transitions = new GrammarTransition[GracefulShutdownStatesEnum.LAST_GRACEFUL_SHUTDOWN_STATE][256];
 
+        /**
+         * GracefulShutdown ::= SEQUENCE { (Tag)
+         *    ...
+         *    
+         * Nothing to do...
+         */
         super.transitions[GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_TAG][UniversalTag.SEQUENCE_TAG] =
             new GrammarTransition( GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_TAG,
                     GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_VALUE, null );
 
+        /**
+         * GracefulShutdown ::= SEQUENCE { (Tag)
+         *    ...
+         *    
+         * Creates the GracefulShutdown object
+         */
         super.transitions[GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_VALUE][UniversalTag.SEQUENCE_TAG] =
             new GrammarTransition( GracefulShutdownStatesEnum.GRACEFUL_SHUTDOWN_SEQUENCE_VALUE,
                     GracefulShutdownStatesEnum.TIME_OFFLINE_OR_DELAY_OR_END_TAG, 
@@ -76,14 +95,36 @@
                 }
             );
 
+        /**
+         * GracefulShutdown ::= SEQUENCE {
+         *    timeOffline INTEGER (0..720) DEFAULT 0, (Tag)
+         *    ...
+         *    
+         * Nothing to do
+         */
         super.transitions[GracefulShutdownStatesEnum.TIME_OFFLINE_OR_DELAY_OR_END_TAG][UniversalTag.INTEGER_TAG] =
             new GrammarTransition( GracefulShutdownStatesEnum.TIME_OFFLINE_OR_DELAY_OR_END_TAG,
                 GracefulShutdownStatesEnum.TIME_OFFLINE_VALUE, null );
 
-        super.transitions[GracefulShutdownStatesEnum.TIME_OFFLINE_OR_DELAY_OR_END_TAG][GracefulShutdownConstants.GRACEFUL_SHUTDOWN_DELAY_TAG] =
+        /**
+         * GracefulShutdown ::= SEQUENCE {
+         *    ...
+         *    delay [0] INTEGER (0..86400) DEFAULT 0, (Tag)
+         *    ...
+         *    
+         * We have no TimeOffline. Nothing to do.
+         */
+        super.transitions[GracefulShutdownStatesEnum.TIME_OFFLINE_OR_DELAY_OR_END_TAG][GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG] =
             new GrammarTransition( GracefulShutdownStatesEnum.TIME_OFFLINE_OR_DELAY_OR_END_TAG,
                 GracefulShutdownStatesEnum.DELAY_VALUE, null );
 
+        /**
+         * GracefulShutdown ::= SEQUENCE {
+         *    timeOffline INTEGER (0..720) DEFAULT 0, (Value)
+         *    ...
+         *    
+         * Set the time offline value into the GracefulShutdown object.
+         */
         super.transitions[GracefulShutdownStatesEnum.TIME_OFFLINE_VALUE][UniversalTag.INTEGER_TAG] =
             new GrammarTransition( GracefulShutdownStatesEnum.TIME_OFFLINE_VALUE, 
                 GracefulShutdownStatesEnum.DELAY_OR_END_TAG, 
@@ -117,11 +158,27 @@
                 }
             );
 
-        super.transitions[GracefulShutdownStatesEnum.DELAY_OR_END_TAG][GracefulShutdownConstants.GRACEFUL_SHUTDOWN_DELAY_TAG] =
+        /**
+         * GracefulShutdown ::= SEQUENCE {
+         *    ...
+         *    delay [0] INTEGER (0..86400) DEFAULT 0, (Tag)
+         *    ...
+         *    
+         * We have had a TimeOffline, and now we are reading the delay. Nothing to do.
+         */
+        super.transitions[GracefulShutdownStatesEnum.DELAY_OR_END_TAG][GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG] =
             new GrammarTransition( GracefulShutdownStatesEnum.DELAY_OR_END_TAG,
                 GracefulShutdownStatesEnum.DELAY_VALUE, null );
 
-        super.transitions[GracefulShutdownStatesEnum.DELAY_VALUE][GracefulShutdownConstants.GRACEFUL_SHUTDOWN_DELAY_TAG] =
+        /**
+         * GracefulShutdown ::= SEQUENCE {
+         *    ...
+         *    delay [0] INTEGER (0..86400) DEFAULT 0, (Value)
+         *    ...
+         *    
+         * Set the delay value into the GracefulShutdown object.
+         */
+        super.transitions[GracefulShutdownStatesEnum.DELAY_VALUE][GracefulActionConstants.GRACEFUL_ACTION_DELAY_TAG] =
             new GrammarTransition( GracefulShutdownStatesEnum.DELAY_VALUE, 
                 GracefulShutdownStatesEnum.GRAMMAR_END, 
                 new GrammarAction( "Set Graceful Shutdown Delay" )