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/05/05 14:53:15 UTC

svn commit: r168329 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/pojo/SpnegoNegTokenTargPOJO.java

Author: elecharny
Date: Thu May  5 05:53:15 2005
New Revision: 168329

URL: http://svn.apache.org/viewcvs?rev=168329&view=rev
Log:
Implemented the constructor and the free method
Added expectedLength members
Fixed some Javadoc issues

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/pojo/SpnegoNegTokenTargPOJO.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/pojo/SpnegoNegTokenTargPOJO.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/pojo/SpnegoNegTokenTargPOJO.java?rev=168329&r1=168328&r2=168329&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/pojo/SpnegoNegTokenTargPOJO.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/pojo/SpnegoNegTokenTargPOJO.java Thu May  5 05:53:15 2005
@@ -21,8 +21,7 @@
 
 
 /**
- * The main POJO : every Ldap Message are encapsulated in it. It has a
- * messageId and Controls.
+ * The SpnegoNegTokenTarg POJO contains the server's response to NegTokenInit
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -30,18 +29,33 @@
 {
     //~ Instance fields ----------------------------------------------------------------------------
 
-    /** The controls */
+    /** The expected length of the NegTokenTargSequence element */
+    private int negTokenTargSequenceExpectedLength;
+    
+    /** The result */
     private int         negResult;
 
+    /** The negResult expected length */
+    private int negResultExpectedLength;
+
     /** Supported mechanism */
     private OID         supportedMech;
 
+    /** The supported mechanism expected length */
+    private int supportedMechExpectedLength;
+
     /** The Response */
     private OctetString responseToken;
 
-    /** The mechanism List */
+    /** The response token expected length */
+    private int responseTokenExpectedLength;
+
+    /** The mechanism List MIC */
     private OctetString mechListMIC;
 
+    /** The mechanism list MIC expected length */
+    private int mechanismListMICExpectedLength;
+
     //~ Constructors -------------------------------------------------------------------------------
 
     /**
@@ -50,17 +64,45 @@
     public SpnegoNegTokenTargPOJO()
     {
         // We should not create this kind of object directly
+        negTokenTargSequenceExpectedLength = 0;
+        negResultExpectedLength = 0;
+        supportedMechExpectedLength = 0;
+        responseTokenExpectedLength = 0;
+        mechanismListMICExpectedLength = 0;
+        
     }
 
     //~ Methods ------------------------------------------------------------------------------------
 
     /**
-     * Free the SpnegoPOJO. we have to free the Authentication,
-     * the ProtocolOp, the Controls and to reset members to their 
-     * initial values.
+     * Free the SpnegoPOJO. We have to free the supportedMech,
+     * the responseToken, the mecListMIC and to reset the result.
      */
     public void free()
     {
+        negResult = 0;
+
+        if (supportedMech != null)
+        {
+            supportedMech.free();
+        }
+        
+        if (responseToken != null)
+        {
+            responseToken.free();
+        }
+        
+        if (mechListMIC != null)
+        {
+            mechListMIC.free();
+        }
+        
+        // Reset the expected lengths
+        negTokenTargSequenceExpectedLength = 0;
+        negResultExpectedLength = 0;
+        supportedMechExpectedLength = 0;
+        responseTokenExpectedLength = 0;
+        mechanismListMICExpectedLength = 0;
 
         // put back the object in the pool
         super.free();
@@ -144,5 +186,87 @@
     public void setSupportedMech( OID supportedMech )
     {
         this.supportedMech = supportedMech;
+    }
+    
+    /**
+     * @return Returns the mechanismListMICExpectedLength.
+     */
+    public int getMechanismListMICExpectedLength() 
+    {
+        return mechanismListMICExpectedLength;
+    }
+    
+    /**
+     * @param mechanismListMICExpectedLength The mechanismListMICExpectedLength to set.
+     */
+    public void setMechanismListMICExpectedLength(
+            int mechanismListMICExpectedLength) 
+    {
+        this.mechanismListMICExpectedLength = mechanismListMICExpectedLength;
+    }
+    
+    /**
+     * @return Returns the negResultExpectedLength.
+     */
+    public int getNegResultExpectedLength() 
+    {
+        return negResultExpectedLength;
+    }
+    
+    /**
+     * @param negResultExpectedLength The negResultExpectedLength to set.
+     */
+    public void setNegResultExpectedLength(int negResultExpectedLength) 
+    {
+        this.negResultExpectedLength = negResultExpectedLength;
+    }
+    
+    /**
+     * @return Returns the negTokenTargSequenceExpectedLength.
+     */
+    public int getNegTokenTargSequenceExpectedLength() 
+    {
+        return negTokenTargSequenceExpectedLength;
+    }
+    
+    /**
+     * @param negTokenTargSequenceExpectedLength The negTokenTargSequenceExpectedLength to set.
+     */
+    public void setNegTokenTargSequenceExpectedLength(
+            int negTokenTargSequenceExpectedLength) 
+    {
+        this.negTokenTargSequenceExpectedLength = negTokenTargSequenceExpectedLength;
+    }
+    
+    /**
+     * @return Returns the responseTokenExpectedLength.
+     */
+    public int getResponseTokenExpectedLength() 
+    {
+        return responseTokenExpectedLength;
+    }
+    
+    /**
+     * @param responseTokenExpectedLength The responseTokenExpectedLength to set.
+     */
+    public void setResponseTokenExpectedLength(int responseTokenExpectedLength) 
+    {
+        this.responseTokenExpectedLength = responseTokenExpectedLength;
+    }
+    
+    /**
+     * @return Returns the supportedMechExpectedLength.
+     */
+    public int getSupportedMechExpectedLength() 
+    {
+        return supportedMechExpectedLength;
+    }
+    
+    /**
+     * @param supportedMechExpectedLength The supportedMechExpectedLength to set.
+     */
+    public void setSupportedMechExpectedLength(int supportedMechExpectedLength) 
+    {
+        this.supportedMechExpectedLength = supportedMechExpectedLength;
     }
 }