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 2006/09/03 15:59:15 UTC

svn commit: r439777 - /directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/bind/AbstractAuthentication.java

Author: elecharny
Date: Sun Sep  3 06:59:15 2006
New Revision: 439777

URL: http://svn.apache.org/viewvc?rev=439777&view=rev
Log:
Added an abstract class to handle instanceof checks for Authentication
classes

Added:
    directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/bind/AbstractAuthentication.java

Added: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/bind/AbstractAuthentication.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/bind/AbstractAuthentication.java?rev=439777&view=auto
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/bind/AbstractAuthentication.java (added)
+++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/bind/AbstractAuthentication.java Sun Sep  3 06:59:15 2006
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.shared.ldap.messages.bind;
+
+/**
+ * This abstract class implements the two methods defined in
+ * the interface :
+ *  - isSimple()
+ *  - isSasl()
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class AbstractAuthentication implements Authentication
+{
+    /**
+     * @return Returns <code>true</code> if the authentication scheme is Simple 
+     */
+    public boolean isSimple() 
+    {
+        return (Authentication)this instanceof SimpleAuthentication;
+    }
+    
+    /**
+     * @return Returns <code>true</code> if the authentication scheme is SASL 
+     */
+    public boolean isSasl()
+    {
+        return (Authentication)this instanceof SaslCredentials;
+    }
+}