directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r232908 - in /directory/asn1/branches/ber-decoder/modules/runtime/src/test: com/acme/spnego/ com/acme/spnego/ber/ com/acme/spnego/cer/ com/acme/spnego/der/ com/acme/spnego/per/ com/acme/spnego/type/ org/apache/asn1/encoding/ org/apache/asn1...
Date Mon, 15 Aug 2005 23:50:17 GMT
Author: adc
Date: Mon Aug 15 16:50:05 2005
New Revision: 232908

URL: http://svn.apache.org/viewcvs?rev=232908&view=rev
Log:
Reorg

Added:
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsDecoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeDecoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListDecoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitDecoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargDecoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/ContextFlagsType.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeListType.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeType.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenInitType.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenTargType.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegotiationTokenType.java
Removed:
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ber/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/cer/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/der/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/per/
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/type/
Modified:
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java
    directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java?rev=232908&r1=232907&r2=232908&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java (original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/ContextFlags.java Mon Aug 15 16:50:05 2005
@@ -16,7 +16,7 @@
  */
 package com.acme.spnego;
 
-import com.acme.spnego.type.ContextFlagsType;
+import org.apache.asn1.types.com.acme.spnego.ContextFlagsType;
 
 
 /**

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java?rev=232908&r1=232907&r2=232908&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java (original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechType.java Mon Aug 15 16:50:05 2005
@@ -16,7 +16,7 @@
  */
 package com.acme.spnego;
 
-import com.acme.spnego.type.MechTypeType;
+import org.apache.asn1.types.com.acme.spnego.MechTypeType;
 
 
 /**

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java?rev=232908&r1=232907&r2=232908&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java (original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/MechTypeList.java Mon Aug 15 16:50:05 2005
@@ -16,7 +16,7 @@
  */
 package com.acme.spnego;
 
-import com.acme.spnego.type.MechTypeListType;
+import org.apache.asn1.types.com.acme.spnego.MechTypeListType;
 
 
 /**

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java?rev=232908&r1=232907&r2=232908&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java (original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenInit.java Mon Aug 15 16:50:05 2005
@@ -16,7 +16,7 @@
  */
 package com.acme.spnego;
 
-import com.acme.spnego.type.NegTokenInitType;
+import org.apache.asn1.types.com.acme.spnego.NegTokenInitType;
 
 
 /**

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java?rev=232908&r1=232907&r2=232908&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java (original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegTokenTarg.java Mon Aug 15 16:50:05 2005
@@ -16,7 +16,7 @@
  */
 package com.acme.spnego;
 
-import com.acme.spnego.type.NegTokenTargType;
+import org.apache.asn1.types.com.acme.spnego.NegTokenTargType;
 
 
 /**

Modified: directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java?rev=232908&r1=232907&r2=232908&view=diff
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java (original)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/com/acme/spnego/NegotiationToken.java Mon Aug 15 16:50:05 2005
@@ -16,7 +16,7 @@
  */
 package com.acme.spnego;
 
-import com.acme.spnego.type.NegotiationTokenType;
+import org.apache.asn1.types.com.acme.spnego.NegotiationTokenType;
 
 
 /**

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsDecoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsDecoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsDecoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,59 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import com.acme.spnego.ContextFlags;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class ContextFlagsDecoder extends org.apache.asn1.encoding.ber.ASN1BitStringDecoder
+{
+    public org.apache.asn1.runtime.ASN1Type decode( org.apache.asn1.encoding.ber.BERInputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        ContextFlags negTokenInit = new ContextFlags();
+
+        try
+        {
+            int tag;
+
+            stream.loadImplicitIdentificaiton();
+            if ( stream.getTypeClass() != org.apache.asn1.encoding.ber.TypeClass.UNIVERSAL ) throw new org.apache.asn1.encoding.DecoderException( "Invalid type class" );
+            if ( stream.isConstructed() ) throw new org.apache.asn1.encoding.DecoderException( "Flags should not be constructed" );
+            if ( stream.getTag() != 3 ) throw new org.apache.asn1.encoding.DecoderException( "Wrong tag.  Found " + stream.getTag() + " needed 3" );
+
+            stream.readBitString(negTokenInit);
+
+//            tag = stream.getTag();
+//            if (tag == 0) {
+//                negTokenInit.setMechTypes( (com.acme.spnego.MechTypeList) mechTypesDecoder.decode( stream ) );
+//            }
+        }
+        catch ( java.io.IOException ioe )
+        {
+            throw new org.apache.asn1.encoding.DecoderException( ioe );
+        }
+
+        return negTokenInit;
+    }
+
+    public org.apache.asn1.runtime.ASN1Type decode( java.io.InputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        return decode( new org.apache.asn1.encoding.ber.BERInputStream( stream ) );
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsEncoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsEncoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/ContextFlagsEncoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,44 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import com.acme.spnego.ContextFlags;
+import org.apache.asn1.types.com.acme.spnego.ContextFlagsType;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class ContextFlagsEncoder extends org.apache.asn1.encoding.ber.ASN1BitStringEncoder
+{
+    public void encode( java.io.OutputStream stream, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        if ( !( object instanceof ContextFlagsType ) )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "Object not instance of ContextFlagsType" );
+        }
+
+        ContextFlags contextFlags = (ContextFlags) object;
+
+        if ( !contextFlags.isConsistent() )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "ContextFlagsType is not consistent." );
+        }
+
+        super.encode( new org.apache.asn1.encoding.ber.BEROutputStream( stream ), object );
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeDecoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeDecoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeDecoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,41 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import java.io.InputStream;
+
+import org.apache.asn1.encoding.DecoderException;
+import org.apache.asn1.encoding.ber.BERDecoder;
+import org.apache.asn1.encoding.ber.BERInputStream;
+import org.apache.asn1.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class MechTypeDecoder implements BERDecoder
+{
+    public ASN1Type decode( BERInputStream stream ) throws DecoderException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public ASN1Type decode( InputStream stream ) throws DecoderException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeEncoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeEncoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeEncoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class MechTypeEncoder extends org.apache.asn1.encoding.ber.ASN1ObjectIdentifierEncoder
+{
+    public void encode( java.io.OutputStream stream, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        if ( !( object instanceof org.apache.asn1.runtime.ASN1ObjectIdentifier ) )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "Object not instance of org.apache.asn1.runtime.ASN1ObjectIdentifier" );
+        }
+
+        super.encode( stream, object );
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListDecoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListDecoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListDecoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,41 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import java.io.InputStream;
+
+import org.apache.asn1.encoding.DecoderException;
+import org.apache.asn1.encoding.ber.BERDecoder;
+import org.apache.asn1.encoding.ber.BERInputStream;
+import org.apache.asn1.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class MechTypeListDecoder implements BERDecoder
+{
+    public ASN1Type decode( BERInputStream stream ) throws DecoderException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public ASN1Type decode( InputStream stream ) throws DecoderException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/MechTypeListEncoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,99 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import com.acme.spnego.MechTypeList;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class MechTypeListEncoder implements org.apache.asn1.encoding.ber.BEREncoder
+{
+    protected org.apache.asn1.encoding.ber.BEREncoder mechTypeEncoder;
+
+    public MechTypeListEncoder()
+    {
+        mechTypeEncoder = new MechTypeEncoder();
+    }
+
+    public void encode( java.io.OutputStream stream, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        if ( !( object instanceof MechTypeList ) )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "Object not instance of MechTypeList" );
+        }
+
+        MechTypeList mechTypeList = (MechTypeList) object;
+
+        if ( !mechTypeList.isConsistent() )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "MechTypeList is not consistent." );
+        }
+
+        encode( new org.apache.asn1.encoding.ber.BEROutputStream( stream ), object );
+    }
+
+    public int length( int tagNumber, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        MechTypeList mechTypeList = (MechTypeList) object;
+
+        int length = 0;
+
+        length = org.apache.asn1.encoding.ber.Util.calculateLength( tagNumber, contentLength( -1, mechTypeList ) );
+
+        return length;
+    }
+
+    public void encode( org.apache.asn1.encoding.ber.BEROutputStream out, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        MechTypeList mechTypeList = (MechTypeList) object;
+
+        try
+        {
+            out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.UNIVERSAL, false, 16 );
+            out.encodeLengthBegin( contentLength( 16, mechTypeList ) );
+
+            java.util.Iterator iter = mechTypeList.iterator();
+            while ( iter.hasNext() )
+            {
+                mechTypeEncoder.encode( out, (org.apache.asn1.runtime.ASN1Type) iter.next() );
+
+            }
+
+            out.encodeLengthEnd();
+        }
+        catch ( java.io.IOException ioe )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( ioe );
+        }
+    }
+
+    protected int contentLength( int tagNumber, MechTypeList mechTypeList ) throws org.apache.asn1.encoding.EncoderException
+    {
+        int length = 0;
+
+        java.util.Iterator iter = mechTypeList.iterator();
+        while ( iter.hasNext() )
+        {
+            length = org.apache.asn1.encoding.ber.Util.incrementLength( length, mechTypeEncoder.length( -1, (org.apache.asn1.runtime.ASN1Type) iter.next() ) );
+        }
+
+        return length;
+    }
+}
+

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitDecoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitDecoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitDecoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,67 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class NegTokenInitDecoder implements org.apache.asn1.encoding.ber.BERDecoder
+{
+    protected org.apache.asn1.encoding.ber.BERDecoder mechTypesDecoder;
+    protected org.apache.asn1.encoding.ber.BERDecoder reqFlagsDecoder;
+    protected org.apache.asn1.encoding.ber.BERDecoder mechTokenDecoder;
+    protected org.apache.asn1.encoding.ber.BERDecoder mechListMICDecoder;
+
+    public NegTokenInitDecoder()
+    {
+        mechTypesDecoder = new MechTypeListDecoder();
+        reqFlagsDecoder = new ContextFlagsDecoder();
+        mechTokenDecoder = new org.apache.asn1.encoding.ber.ASN1OctetStringDecoder();
+        mechListMICDecoder = new org.apache.asn1.encoding.ber.ASN1OctetStringDecoder();
+    }
+
+    public org.apache.asn1.runtime.ASN1Type decode( java.io.InputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        return decode( new org.apache.asn1.encoding.ber.BERInputStream( stream ) );
+    }
+
+    public org.apache.asn1.runtime.ASN1Type decode( org.apache.asn1.encoding.ber.BERInputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        com.acme.spnego.NegTokenInit negTokenInit = new com.acme.spnego.NegTokenInit();
+
+        try
+        {
+            int tag;
+
+            stream.loadImplicitIdentificaiton();
+            if ( stream.getTypeClass() != org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC ) throw new org.apache.asn1.encoding.DecoderException( "Invalid type class" );
+            if ( !stream.isConstructed() ) throw new org.apache.asn1.encoding.DecoderException( "Identifier not constructed" );
+
+            tag = stream.getTag();
+            if (tag == 0) {
+                negTokenInit.setMechTypes( (com.acme.spnego.MechTypeList) mechTypesDecoder.decode( stream ) );
+            }
+        }
+        catch ( java.io.IOException ioe )
+        {
+            throw new org.apache.asn1.encoding.DecoderException( ioe );
+        }
+
+        return negTokenInit;
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenInitEncoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,138 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import com.acme.spnego.NegTokenInit;
+import org.apache.asn1.types.com.acme.spnego.NegTokenInitType;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class NegTokenInitEncoder implements org.apache.asn1.encoding.ber.BEREncoder
+{
+    protected org.apache.asn1.encoding.ber.BEREncoder mechTypesEncoder;
+    protected org.apache.asn1.encoding.ber.BEREncoder reqFlagsEncoder;
+    protected org.apache.asn1.encoding.ber.BEREncoder mechTokenEncoder;
+    protected org.apache.asn1.encoding.ber.BEREncoder mechListMICEncoder;
+
+    public NegTokenInitEncoder()
+    {
+        mechTypesEncoder = new MechTypeListEncoder();
+        reqFlagsEncoder = new ContextFlagsEncoder();
+        mechTokenEncoder = new org.apache.asn1.encoding.ber.ASN1OctetStringEncoder();
+        mechListMICEncoder = new org.apache.asn1.encoding.ber.ASN1OctetStringEncoder();
+    }
+
+    public void encode( java.io.OutputStream stream, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        if ( !( object instanceof NegTokenInitType ) )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "Object not instance of NegTokenInitType" );
+        }
+
+        NegTokenInit negTokenInit = (NegTokenInit) object;
+
+        if ( !negTokenInit.isConsistent() )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "NegTokenInitType is not consistent." );
+        }
+
+        encode( new org.apache.asn1.encoding.ber.BEROutputStream( stream ), object );
+    }
+
+    public int length( int tagNumber, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        NegTokenInit negTokenInit = (NegTokenInit) object;
+
+        int length = 0;
+
+        length = org.apache.asn1.encoding.ber.Util.calculateLength( tagNumber, contentLength( tagNumber, negTokenInit ) );
+
+        return length;
+    }
+
+    public void encode( org.apache.asn1.encoding.ber.BEROutputStream out, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        NegTokenInit negTokenInit = (NegTokenInit) object;
+
+        try
+        {
+            out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.UNIVERSAL, false, 16 );
+            out.encodeLengthBegin( contentLength( 16, negTokenInit ) );
+
+            if ( negTokenInit.getMechTypes() != null )
+            {
+                out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 0 );
+                out.encodeLengthBegin( mechTypesEncoder.length( 0, negTokenInit.getMechTypes() ) );
+                mechTypesEncoder.encode( out, negTokenInit.getMechTypes() );
+                out.encodeLengthEnd();
+            }
+            if ( negTokenInit.getReqFlags() != null )
+            {
+                out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 1 );
+                out.encodeLengthBegin( reqFlagsEncoder.length( 1, negTokenInit.getReqFlags() ) );
+                reqFlagsEncoder.encode( out, negTokenInit.getReqFlags() );
+                out.encodeLengthEnd();
+            }
+            if ( negTokenInit.getMechToken() != null )
+            {
+                out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 2 );
+                out.encodeLengthBegin( mechTokenEncoder.length( -1, negTokenInit.getMechToken() ) );
+                mechTokenEncoder.encode( out, negTokenInit.getMechToken() );
+                out.encodeLengthEnd();
+            }
+            if ( negTokenInit.getMechListMIC() != null )
+            {
+                out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 3 );
+                out.encodeLengthBegin( mechListMICEncoder.length( -1, negTokenInit.getMechListMIC() ) );
+                mechListMICEncoder.encode( out, negTokenInit.getMechListMIC() );
+                out.encodeLengthEnd();
+            }
+
+            out.encodeLengthEnd();
+        }
+        catch ( java.io.IOException ioe )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( ioe );
+        }
+    }
+
+    protected int contentLength( int tagNumber, NegTokenInit negTokenInit ) throws org.apache.asn1.encoding.EncoderException
+    {
+        int length = 0;
+        if ( negTokenInit.getMechTypes() != null )
+        {
+            length = org.apache.asn1.encoding.ber.Util.incrementLength( length, org.apache.asn1.encoding.ber.Util.calculateLength( 0, mechTypesEncoder.length( -1, negTokenInit.getMechTypes() ) ) );
+        }
+        if ( negTokenInit.getReqFlags() != null )
+        {
+            length = org.apache.asn1.encoding.ber.Util.incrementLength( length, org.apache.asn1.encoding.ber.Util.calculateLength( 1, reqFlagsEncoder.length( -1, negTokenInit.getReqFlags() ) ) );
+        }
+        if ( negTokenInit.getMechToken() != null )
+        {
+            length = org.apache.asn1.encoding.ber.Util.incrementLength( length, org.apache.asn1.encoding.ber.Util.calculateLength( 2, mechTokenEncoder.length( -1, negTokenInit.getMechToken() ) ) );
+        }
+        if ( negTokenInit.getMechListMIC() != null )
+        {
+            length = org.apache.asn1.encoding.ber.Util.incrementLength( length, org.apache.asn1.encoding.ber.Util.calculateLength( 3, mechListMICEncoder.length( -1, negTokenInit.getMechListMIC() ) ) );
+        }
+
+        return length;
+    }
+}
+

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargDecoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargDecoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargDecoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,34 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class NegTokenTargDecoder implements org.apache.asn1.encoding.ber.BERDecoder
+{
+    public org.apache.asn1.runtime.ASN1Type decode( java.io.InputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        return null;  //todo: consider this autogenerated code
+    }
+
+    public org.apache.asn1.runtime.ASN1Type decode( org.apache.asn1.encoding.ber.BERInputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        return null;  //todo: consider this autogenerated code
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargEncoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargEncoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegTokenTargEncoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,46 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import java.io.OutputStream;
+
+import org.apache.asn1.encoding.EncoderException;
+import org.apache.asn1.encoding.ber.BEREncoder;
+import org.apache.asn1.encoding.ber.BEROutputStream;
+import org.apache.asn1.runtime.ASN1Type;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class NegTokenTargEncoder implements BEREncoder
+{
+    public void encode( OutputStream stream, ASN1Type object ) throws EncoderException
+    {
+        //todo: consider this autogenerated code
+    }
+
+    public int length( int tagNumber, ASN1Type object ) throws EncoderException
+    {
+        return 0;  //todo: consider this autogenerated code
+    }
+
+    public void encode( BEROutputStream stream, ASN1Type object ) throws EncoderException
+    {
+        //todo: consider this autogenerated code
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenDecoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,80 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+import com.acme.spnego.NegTokenInit;
+import com.acme.spnego.NegTokenTarg;
+import com.acme.spnego.NegotiationToken;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class NegotiationTokenDecoder implements org.apache.asn1.encoding.ber.BERDecoder
+{
+    protected org.apache.asn1.encoding.ber.BERDecoder negTokenInitDecoder;
+    protected org.apache.asn1.encoding.ber.BERDecoder negTokenTargDecoder;
+
+    public NegotiationTokenDecoder()
+    {
+        negTokenInitDecoder = new NegTokenInitDecoder();
+        negTokenTargDecoder = new NegTokenTargDecoder();
+    }
+
+    public org.apache.asn1.runtime.ASN1Type decode( java.io.InputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        return decode( new org.apache.asn1.encoding.ber.BERInputStream( stream ) );
+    }
+
+    public org.apache.asn1.runtime.ASN1Type decode( org.apache.asn1.encoding.ber.BERInputStream stream ) throws org.apache.asn1.encoding.DecoderException
+    {
+        NegotiationToken negotiationToken = new NegotiationToken();
+        org.apache.asn1.runtime.ASN1Type result = negotiationToken;
+
+        try
+        {
+            stream.loadImplicitIdentificaiton();
+            if ( stream.getTypeClass() != org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC ) throw new org.apache.asn1.encoding.DecoderException( "Invalid type class" );
+            if ( !stream.isConstructed() ) throw new org.apache.asn1.encoding.DecoderException( "Identifier not constructed" );
+
+            int tag = stream.getTag();
+            switch ( stream.getTag() )
+            {
+                case 0:
+                    {
+                        negotiationToken.setNegTokenInit( (NegTokenInit) negTokenInitDecoder.decode( stream ) );
+                        break;
+                    }
+                case 1:
+                    {
+                        negotiationToken.setNegTokenTarg( (NegTokenTarg) negTokenTargDecoder.decode( stream ) );
+                        break;
+                    }
+                default:
+                    {
+                        throw new org.apache.asn1.encoding.DecoderException( "Invalid TAG read: " + tag );
+                    }
+            }
+        }
+        catch ( java.io.IOException ioe )
+        {
+            throw new org.apache.asn1.encoding.DecoderException( ioe );
+        }
+
+        return result;
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/encoding/com/acme/spnego/ber/NegotiationTokenEncoder.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,105 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.encoding.com.acme.spnego.ber;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public class NegotiationTokenEncoder implements org.apache.asn1.encoding.ber.BEREncoder
+{
+    protected org.apache.asn1.encoding.ber.BEREncoder negTokenInitEncoder;
+    protected org.apache.asn1.encoding.ber.BEREncoder negTokenTargEncoder;
+
+    public NegotiationTokenEncoder()
+    {
+        negTokenInitEncoder = new NegTokenInitEncoder();
+        negTokenTargEncoder = new NegTokenTargEncoder();
+    }
+
+    public void encode( java.io.OutputStream stream, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        if ( !( object instanceof com.acme.spnego.NegotiationToken ) )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "Object not instance of NegotiationTokenType" );
+        }
+
+        com.acme.spnego.NegotiationToken negotiationToken = (com.acme.spnego.NegotiationToken) object;
+
+        if ( !negotiationToken.isConsistent() )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( "NegotiationToken is not consistent." );
+        }
+
+        encode( new org.apache.asn1.encoding.ber.BEROutputStream( stream ), object );
+    }
+
+    public int length( int tagNumber, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        com.acme.spnego.NegotiationToken negotiationToken = (com.acme.spnego.NegotiationToken) object;
+
+        int length = 0;
+
+        length = contentLength( tagNumber, negotiationToken );
+
+        return length;
+    }
+
+    public void encode( org.apache.asn1.encoding.ber.BEROutputStream out, org.apache.asn1.runtime.ASN1Type object ) throws org.apache.asn1.encoding.EncoderException
+    {
+        com.acme.spnego.NegotiationToken negotiationToken = (com.acme.spnego.NegotiationToken) object;
+
+        try
+        {
+            if ( negotiationToken.getNegTokenInit() != null )
+            {
+                out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 0 );
+                out.encodeLengthBegin( negTokenInitEncoder.length( 0, negotiationToken.getNegTokenInit() ) );
+                negTokenInitEncoder.encode( out, negotiationToken.getNegTokenInit() );
+                out.encodeLengthEnd();
+            }
+            if ( negotiationToken.getNegTokenTarg() != null )
+            {
+                out.encodeExplicit( org.apache.asn1.encoding.ber.TypeClass.CONTEXT_SPECIFIC, false, 1 );
+                out.encodeLengthBegin( negTokenTargEncoder.length( 1, negotiationToken.getNegTokenTarg() ) );
+                negTokenTargEncoder.encode( out, negotiationToken.getNegTokenTarg() );
+                out.encodeLengthEnd();
+            }
+        }
+        catch ( java.io.IOException ioe )
+        {
+            throw new org.apache.asn1.encoding.EncoderException( ioe );
+        }
+    }
+
+
+    protected int contentLength( int tagNumber, com.acme.spnego.NegotiationToken negotiationToken ) throws org.apache.asn1.encoding.EncoderException
+    {
+        int length = 0;
+
+        if ( negotiationToken.getNegTokenInit() != null )
+        {
+            length = org.apache.asn1.encoding.ber.Util.incrementLength( length, org.apache.asn1.encoding.ber.Util.calculateLength( tagNumber, negTokenInitEncoder.length( 0, negotiationToken.getNegTokenInit() ) ) );
+        }
+        if ( negotiationToken.getNegTokenTarg() != null )
+        {
+            length = org.apache.asn1.encoding.ber.Util.incrementLength( length, org.apache.asn1.encoding.ber.Util.calculateLength( tagNumber, negTokenTargEncoder.length( 1, negotiationToken.getNegTokenTarg() ) ) );
+        }
+
+        return length;
+    }
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/ContextFlagsType.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/ContextFlagsType.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/ContextFlagsType.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/ContextFlagsType.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.types.com.acme.spnego;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public interface ContextFlagsType extends org.apache.asn1.runtime.ASN1TypeFlag
+{
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeListType.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeListType.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeListType.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeListType.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.types.com.acme.spnego;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public interface MechTypeListType extends org.apache.asn1.runtime.ASN1TypeFlag
+{
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeType.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeType.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeType.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/MechTypeType.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.types.com.acme.spnego;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public interface MechTypeType extends org.apache.asn1.runtime.ASN1TypeFlag
+{
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenInitType.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenInitType.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenInitType.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenInitType.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.types.com.acme.spnego;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public interface NegTokenInitType extends org.apache.asn1.runtime.ASN1TypeFlag
+{
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenTargType.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenTargType.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenTargType.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegTokenTargType.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.types.com.acme.spnego;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public interface NegTokenTargType extends org.apache.asn1.runtime.ASN1TypeFlag
+{
+}

Added: directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegotiationTokenType.java
URL: http://svn.apache.org/viewcvs/directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegotiationTokenType.java?rev=232908&view=auto
==============================================================================
--- directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegotiationTokenType.java (added)
+++ directory/asn1/branches/ber-decoder/modules/runtime/src/test/org/apache/asn1/types/com/acme/spnego/NegotiationTokenType.java Mon Aug 15 16:50:05 2005
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2004 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.
+ *  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.asn1.types.com.acme.spnego;
+
+
+/**
+ * @version $Revision: 208868 $ $Date: $
+ */
+public interface NegotiationTokenType extends org.apache.asn1.runtime.ASN1TypeFlag
+{
+}



Mime
View raw message