directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r280935 - in /directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder: EncAsRepPartEncoder.java EncKdcRepPartEncoder.java EncTgsRepPartEncoder.java EncTicketPartEncoder.java Encoder.java EncoderFactory.java
Date Wed, 14 Sep 2005 20:40:02 GMT
Author: erodriguez
Date: Wed Sep 14 13:39:59 2005
New Revision: 280935

URL: http://svn.apache.org/viewcvs?rev=280935&view=rev
Log:
Commit to address DIRKERBEROS-4:
o  Added Encoder and EncoderFactory interfaces
o  Added interfaces to encoders that needed them

http://issues.apache.org/jira/browse/DIRKERBEROS-4

Added:
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/Encoder.java
  (with props)
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncoderFactory.java
  (with props)
Modified:
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java?rev=280935&r1=280934&r2=280935&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncAsRepPartEncoder.java
Wed Sep 14 13:39:59 2005
@@ -16,7 +16,7 @@
  */
 package org.apache.kerberos.io.encoder;
 
-public class EncAsRepPartEncoder extends EncKdcRepPartEncoder
+public class EncAsRepPartEncoder extends EncKdcRepPartEncoder implements EncoderFactory
 {
     /*
      * EncASRepPart ::=    [APPLICATION 25[25]] EncKDCRepPart
@@ -26,5 +26,10 @@
     public EncAsRepPartEncoder()
     {
         super( APPLICATION_CODE );
+    }
+
+    public Encoder getEncoder()
+    {
+        return new EncAsRepPartEncoder();
     }
 }

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java?rev=280935&r1=280934&r2=280935&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKdcRepPartEncoder.java
Wed Sep 14 13:39:59 2005
@@ -26,9 +26,10 @@
 import org.apache.asn1.der.DERInteger;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.KdcReply;
 
-public abstract class EncKdcRepPartEncoder
+public abstract class EncKdcRepPartEncoder implements Encoder
 {
 	private int applicationCode;
 	
@@ -37,12 +38,12 @@
 		this.applicationCode = applicationCode;
 	}
 	
-	public byte[] encode( KdcReply app ) throws IOException
+	public byte[] encode( Encodable app ) throws IOException
 	{
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 		ASN1OutputStream aos = new ASN1OutputStream( baos );
 		
-		DERSequence initialSequence = encodeInitialSequence( app );
+		DERSequence initialSequence = encodeInitialSequence( (KdcReply) app );
 		aos.writeObject( DERApplicationSpecific.valueOf( applicationCode, initialSequence ) );
 		
 		return baos.toByteArray();

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java?rev=280935&r1=280934&r2=280935&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTgsRepPartEncoder.java
Wed Sep 14 13:39:59 2005
@@ -16,7 +16,7 @@
  */
 package org.apache.kerberos.io.encoder;
 
-public class EncTgsRepPartEncoder extends EncKdcRepPartEncoder
+public class EncTgsRepPartEncoder extends EncKdcRepPartEncoder implements EncoderFactory
 {
     /**
      * EncTGSRepPart ::=   [APPLICATION 26] EncKDCRepPart
@@ -26,5 +26,10 @@
     public EncTgsRepPartEncoder()
     {
         super( APPLICATION_CODE );
+    }
+
+    public Encoder getEncoder()
+    {
+        return new EncTgsRepPartEncoder();
     }
 }

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java?rev=280935&r1=280934&r2=280935&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncTicketPartEncoder.java
Wed Sep 14 13:39:59 2005
@@ -25,24 +25,30 @@
 import org.apache.asn1.der.DERGeneralString;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.components.EncTicketPart;
 
-public class EncTicketPartEncoder
+public class EncTicketPartEncoder implements Encoder, EncoderFactory
 {
 	private static final int APPLICATION_CODE = 3;
-	
-	public byte[] encode( EncTicketPart ticketPart ) throws IOException
+
+	public byte[] encode( Encodable ticketPart ) throws IOException
 	{
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 		ASN1OutputStream aos = new ASN1OutputStream( baos );
 		
-		DERSequence ticketSequence = encodeInitialSequence( ticketPart );
+		DERSequence ticketSequence = encodeInitialSequence( (EncTicketPart) ticketPart );
 		aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, ticketSequence ) );
 		aos.close();
 		
 		return baos.toByteArray();
 	}
-	
+
+    public Encoder getEncoder()
+    {
+        return new EncTicketPartEncoder();
+    }
+
 	/**
 	 * -- Encrypted part of ticket
 	 * EncTicketPart ::=     [APPLICATION 3] SEQUENCE {

Added: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/Encoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/Encoder.java?rev=280935&view=auto
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/Encoder.java
(added)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/Encoder.java
Wed Sep 14 13:39:59 2005
@@ -0,0 +1,27 @@
+/*
+ *   Copyright 2005 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.kerberos.io.encoder;
+
+import java.io.IOException;
+
+import org.apache.kerberos.messages.Encodable;
+
+public interface Encoder
+{
+    public byte[] encode( Encodable object ) throws IOException;
+}

Propchange: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/Encoder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncoderFactory.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncoderFactory.java?rev=280935&view=auto
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncoderFactory.java
(added)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncoderFactory.java
Wed Sep 14 13:39:59 2005
@@ -0,0 +1,23 @@
+/*
+ *   Copyright 2005 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.kerberos.io.encoder;
+
+public interface EncoderFactory
+{
+    public Encoder getEncoder();
+}

Propchange: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncoderFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message