directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r280934 - in /directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder: AuthenticatorDecoder.java AuthorizationDataDecoder.java Decoder.java DecoderFactory.java EncTicketPartDecoder.java EncryptedTimestampDecoder.java
Date Wed, 14 Sep 2005 20:38:29 GMT
Author: erodriguez
Date: Wed Sep 14 13:38:24 2005
New Revision: 280934

URL: http://svn.apache.org/viewcvs?rev=280934&view=rev
Log:
Commit to address DIRKERBEROS-4:
o  Added Decoder and DecoderFactory interfaces
o  Added interfaces to decoders that needed them

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

Added:
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/Decoder.java
  (with props)
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/DecoderFactory.java
  (with props)
Modified:
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthenticatorDecoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthorizationDataDecoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncryptedTimestampDecoder.java

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthenticatorDecoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthenticatorDecoder.java?rev=280934&r1=280933&r2=280934&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthenticatorDecoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthenticatorDecoder.java
Wed Sep 14 13:38:24 2005
@@ -27,12 +27,18 @@
 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.components.Authenticator;
 import org.apache.kerberos.messages.components.AuthenticatorModifier;
 
-public class AuthenticatorDecoder
+public class AuthenticatorDecoder implements Decoder, DecoderFactory
 {
-    public Authenticator decode( byte[] encodedAuthenticator ) throws IOException
+    public Decoder getDecoder()
+    {
+        return new AuthenticatorDecoder();
+    }
+
+    public Encodable decode( byte[] encodedAuthenticator ) throws IOException
     {
         ASN1InputStream ais = new ASN1InputStream( encodedAuthenticator );
 

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthorizationDataDecoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthorizationDataDecoder.java?rev=280934&r1=280933&r2=280934&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthorizationDataDecoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/AuthorizationDataDecoder.java
Wed Sep 14 13:38:24 2005
@@ -25,13 +25,19 @@
 import org.apache.asn1.der.DEROctetString;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.value.AuthorizationData;
 import org.apache.kerberos.messages.value.AuthorizationDataEntry;
 import org.apache.kerberos.messages.value.AuthorizationType;
 
-public class AuthorizationDataDecoder
+public class AuthorizationDataDecoder implements Decoder, DecoderFactory
 {
-    public AuthorizationData decode( byte[] encodedAuthData ) throws IOException
+    public Decoder getDecoder()
+    {
+        return new AuthorizationDataDecoder();
+    }
+
+    public Encodable decode( byte[] encodedAuthData ) throws IOException
     {
         ASN1InputStream ais = new ASN1InputStream( encodedAuthData );
 

Added: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/Decoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/Decoder.java?rev=280934&view=auto
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/Decoder.java
(added)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/Decoder.java
Wed Sep 14 13:38:24 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.decoder;
+
+import java.io.IOException;
+
+import org.apache.kerberos.messages.Encodable;
+
+public interface Decoder
+{
+    public Encodable decode( byte[] object ) throws IOException;
+}

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

Added: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/DecoderFactory.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/DecoderFactory.java?rev=280934&view=auto
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/DecoderFactory.java
(added)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/DecoderFactory.java
Wed Sep 14 13:38:24 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.decoder;
+
+public interface DecoderFactory
+{
+    public Decoder getDecoder();
+}

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

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java?rev=280934&r1=280933&r2=280934&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncTicketPartDecoder.java
Wed Sep 14 13:38:24 2005
@@ -29,15 +29,21 @@
 import org.apache.asn1.der.DEROctetString;
 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;
 import org.apache.kerberos.messages.components.EncTicketPartModifier;
 import org.apache.kerberos.messages.value.TicketFlags;
 import org.apache.kerberos.messages.value.TransitedEncoding;
 import org.apache.kerberos.messages.value.TransitedEncodingType;
 
-public class EncTicketPartDecoder
+public class EncTicketPartDecoder implements Decoder, DecoderFactory
 {
-    public EncTicketPart decode( byte[] encodedTicket ) throws IOException
+    public Decoder getDecoder()
+    {
+        return new EncTicketPartDecoder();
+    }
+
+    public Encodable decode( byte[] encodedTicket ) throws IOException
     {
         ASN1InputStream ais = new ASN1InputStream( encodedTicket );
 
@@ -117,8 +123,7 @@
                     break;
                 case 10:
                     DERSequence tag10 = (DERSequence) derObject;
-                    modifier
-                            .setAuthorizationData( AuthorizationDataDecoder.decodeSequence(
tag10 ) );
+                    modifier.setAuthorizationData( AuthorizationDataDecoder.decodeSequence(
tag10 ) );
                     break;
             }
         }

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncryptedTimestampDecoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncryptedTimestampDecoder.java?rev=280934&r1=280933&r2=280934&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncryptedTimestampDecoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncryptedTimestampDecoder.java
Wed Sep 14 13:38:24 2005
@@ -25,6 +25,7 @@
 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.value.EncryptedTimeStamp;
 import org.apache.kerberos.messages.value.EncryptedTimeStampModifier;
 
@@ -37,9 +38,14 @@
  *         pausec[1]                    INTEGER OPTIONAL
  * }
  */
-public class EncryptedTimestampDecoder
+public class EncryptedTimestampDecoder implements Decoder, DecoderFactory
 {
-    public EncryptedTimeStamp decode( byte[] encodedEncryptedTimestamp ) throws IOException
+    public Decoder getDecoder()
+    {
+        return new EncryptedTimestampDecoder();
+    }
+
+    public Encodable decode( byte[] encodedEncryptedTimestamp ) throws IOException
     {
         ASN1InputStream ais = new ASN1InputStream( encodedEncryptedTimestamp );
 



Mime
View raw message