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 2005/09/03 16:46:41 UTC

svn commit: r267468 - /directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java

Author: elecharny
Date: Sat Sep  3 07:46:37 2005
New Revision: 267468

URL: http://svn.apache.org/viewcvs?rev=267468&view=rev
Log:
Added a method that returns the LdapMessage type name.

Modified:
    directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java

Modified: directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java?rev=267468&r1=267467&r2=267468&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java (original)
+++ directory/shared/ldap/branches/new-codec-integration/apache2-provider/src/java/main/org/apache/asn1new/ldap/pojo/LdapMessage.java Sat Sep  3 07:46:37 2005
@@ -144,13 +144,46 @@
     }
 
     /**
-     * Get the message ID
+     * Get the message type
      *
-     * @return The message ID
+     * @return The message type
      */
     public int getMessageType()
     {
     	return ( (LdapMessage)protocolOp) .getMessageType();
+    }
+
+    /**
+     * Get the message type Name
+     *
+     * @return The message type name
+     */
+    public String getMessageTypeName()
+    {
+    	switch ( ( (LdapMessage)protocolOp) .getMessageType() )
+    	{
+    	    case LdapConstants.ABANDON_REQUEST         : return "ABANDON_REQUEST";
+    	    case LdapConstants.ADD_REQUEST             : return "ADD_REQUEST";
+    	    case LdapConstants.ADD_RESPONSE            : return "ADD_RESPONSE";
+    	    case LdapConstants.BIND_REQUEST            : return "BIND_REQUEST";
+    	    case LdapConstants.BIND_RESPONSE           : return "BIND_RESPONSE";
+    	    case LdapConstants.COMPARE_REQUEST         : return "COMPARE_REQUEST";
+    	    case LdapConstants.COMPARE_RESPONSE        : return "COMPARE_REQUEST";
+    	    case LdapConstants.DEL_REQUEST             : return "DEL_REQUEST";
+    	    case LdapConstants.DEL_RESPONSE            : return "DEL_RESPONSE";
+    	    case LdapConstants.EXTENDED_REQUEST        : return "EXTENDED_REQUEST";
+    	    case LdapConstants.EXTENDED_RESPONSE       : return "EXTENDED_RESPONSE";
+    	    case LdapConstants.MODIFYDN_REQUEST        : return "MODIFYDN_REQUEST";
+    	    case LdapConstants.MODIFYDN_RESPONSE       : return "MODIFYDN_RESPONSE";
+    	    case LdapConstants.MODIFY_REQUEST          : return "MODIFY_REQUEST";
+    	    case LdapConstants.MODIFY_RESPONSE         : return "MODIFY_RESPONSE";
+    	    case LdapConstants.SEARCH_REQUEST          : return "SEARCH_REQUEST";
+    	    case LdapConstants.SEARCH_RESULT_DONE      : return "SEARCH_RESULT_DONE";
+    	    case LdapConstants.SEARCH_RESULT_ENTRY     : return "SEARCH_RESULT_ENTRY";
+    	    case LdapConstants.SEARCH_RESULT_REFERENCE : return "SEARCH_RESULT_REFERENCE";
+    	    case LdapConstants.UNBIND_REQUEST          : return "UNBIND_REQUEST";
+    	    default                      			   : return "UNKNOWN";
+    	}
     }
 
     /**