directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r164660 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/SpnegoPoolEnum.java
Date Mon, 25 Apr 2005 21:30:49 GMT
Author: elecharny
Date: Mon Apr 25 14:30:48 2005
New Revision: 164660

URL: http://svn.apache.org/viewcvs?rev=164660&view=rev
Log:
Added the Spnego Pool Enum

Added:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/SpnegoPoolEnum.java

Added: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/SpnegoPoolEnum.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/SpnegoPoolEnum.java?rev=164660&view=auto
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/SpnegoPoolEnum.java
(added)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/spnego/codec/SpnegoPoolEnum.java
Mon Apr 25 14:30:48 2005
@@ -0,0 +1,70 @@
+/*
+ *   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.asn1.spnego.codec;
+
+import org.apache.asn1.util.pools.PoolObject;
+
+/**
+ * This is where all the different Spnego pools are named. To add a new pool, we have to
+ * add an entry to the list, and to modify the getType method.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public final class SpnegoPoolEnum {
+
+    //~ Instance fields ----------------------------------------------------------------------------
+
+    /** Pool of Spnego Container objects */
+    public static final int SPNEGO_CONTAINER_POOL = 40;
+    
+    /** Pool of Spnego negociation token init */
+    public static final int SPNEGO_NEG_TOKEN_INIT_POJO_POOL = 41;
+    
+    /** Pool of Spnego negociation token targ */
+    public static final int SPNEGO_NEG_TOKEN_TARG_POJO_POOL = 42;
+
+    /**
+     * Get the name of the object stored in this pool 
+     *
+     * @return The object name
+     */
+    public static String getType(int poolId)
+    {
+        switch (poolId)
+        {
+        	case SPNEGO_CONTAINER_POOL           : return "Spnego Container";
+        	case SPNEGO_NEG_TOKEN_INIT_POJO_POOL : return "SpnegoNegTokenInitPOJO";
+        	case SPNEGO_NEG_TOKEN_TARG_POJO_POOL : return "SpnegoNegTokenTargPOJO";
+        	default                              : return "UNKNOWN POOL";
+        }
+    }
+    
+    /**
+     * Allocate a new object the classic way.
+     * @param poolId The object pool Id
+     * @return An object
+     */
+    public static PoolObject allocate(int poolId)
+    {
+    	switch (poolId)
+		{
+			case SPNEGO_CONTAINER_POOL       : return new SpnegoContainer();
+    		
+    		default : return null;
+		}
+    }
+}



Mime
View raw message