juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject svn commit: r1550334 - in /juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth: JUDDIAuthenticator.java LdapExpandedAuthenticator.java LdapSimpleAuthenticator.java
Date Thu, 12 Dec 2013 03:02:52 GMT
Author: alexoree
Date: Thu Dec 12 03:02:52 2013
New Revision: 1550334

URL: http://svn.apache.org/r1550334
Log:
JUDDI-745 fixed on branch 33

Modified:
    juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/JUDDIAuthenticator.java
    juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapExpandedAuthenticator.java
    juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapSimpleAuthenticator.java

Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/JUDDIAuthenticator.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/JUDDIAuthenticator.java?rev=1550334&r1=1550333&r2=1550334&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/JUDDIAuthenticator.java
(original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/JUDDIAuthenticator.java
Thu Dec 12 03:02:52 2013
@@ -22,7 +22,9 @@ import javax.persistence.EntityTransacti
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.config.AppConfig;
 import org.apache.juddi.config.PersistenceManager;
+import org.apache.juddi.config.Property;
 import org.apache.juddi.model.Publisher;
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.apache.juddi.v3.error.AuthenticationException;
@@ -49,6 +51,22 @@ public class JUDDIAuthenticator implemen
 		if (authorizedName==null || "".equals(authorizedName)) {
 			throw new UnknownUserException(new ErrorMessage("errors.auth.NoPublisher", authorizedName));
 		}
+                int MaxBindingsPerService = -1;
+                int MaxServicesPerBusiness = -1;
+                int MaxTmodels = -1;
+                int MaxBusinesses = -1;
+                try {
+                        MaxBindingsPerService = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_BINDINGS_PER_SERVICE,
-1);
+                        MaxServicesPerBusiness = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_SERVICES_PER_BUSINESS,
-1);
+                        MaxTmodels = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_TMODELS_PER_PUBLISHER,
-1);
+                        MaxBusinesses = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_BUSINESSES_PER_PUBLISHER,
-1);
+                } catch (Exception ex) {
+                        MaxBindingsPerService = -1;
+                        MaxServicesPerBusiness = -1;
+                        MaxTmodels = -1;
+                        MaxBusinesses = -1;
+                        log.error("config exception! " + authorizedName, ex);
+                }
 		EntityManager em = PersistenceManager.getEntityManager();
 		EntityTransaction tx = em.getTransaction();
 		try {
@@ -60,10 +78,10 @@ public class JUDDIAuthenticator implemen
 				publisher.setAuthorizedName(authorizedName);
 				publisher.setIsAdmin("false");
 				publisher.setIsEnabled("true");
-				publisher.setMaxBindingsPerService(199);
-				publisher.setMaxBusinesses(100);
-				publisher.setMaxServicesPerBusiness(100);
-				publisher.setMaxTmodels(100);
+				publisher.setMaxBindingsPerService(MaxBindingsPerService);
+                                publisher.setMaxBusinesses(MaxBusinesses);
+                                publisher.setMaxServicesPerBusiness(MaxServicesPerBusiness);
+                                publisher.setMaxTmodels(MaxTmodels);
 				publisher.setPublisherName("Unknown");
 				em.persist(publisher);
 				tx.commit();

Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapExpandedAuthenticator.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapExpandedAuthenticator.java?rev=1550334&r1=1550333&r2=1550334&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapExpandedAuthenticator.java
(original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapExpandedAuthenticator.java
Thu Dec 12 03:02:52 2013
@@ -114,6 +114,24 @@ public class LdapExpandedAuthenticator i
         }
 
         boolean isLdapUser = false;
+        
+        int MaxBindingsPerService = -1;
+        int MaxServicesPerBusiness = -1;
+        int MaxTmodels = -1;
+        int MaxBusinesses = -1;
+        try {
+                MaxBindingsPerService = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_BINDINGS_PER_SERVICE,
-1);
+                MaxServicesPerBusiness = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_SERVICES_PER_BUSINESS,
-1);
+                MaxTmodels = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_TMODELS_PER_PUBLISHER,
-1);
+                MaxBusinesses = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_BUSINESSES_PER_PUBLISHER,
-1);
+        } catch (Exception ex) {
+                MaxBindingsPerService = -1;
+                MaxServicesPerBusiness = -1;
+                MaxTmodels = -1;
+                MaxBusinesses = -1;
+                logger.error("config exception! " + authorizedName, ex);
+        }
+
         try {
             env = new Hashtable<String, String>();
             env.put(Context.INITIAL_CONTEXT_FACTORY, AppConfig.getConfiguration().getString(Property.JUDDI_AUTHENTICATOR_INITIAL_CONTEXT,
"com.sun.jndi.ldap.LdapCtxFactory"));
@@ -155,10 +173,10 @@ public class LdapExpandedAuthenticator i
                     publisher.setAuthorizedName(authorizedName);
                     publisher.setIsAdmin("false");
                     publisher.setIsEnabled("true");
-                    publisher.setMaxBindingsPerService(199);
-                    publisher.setMaxBusinesses(100);
-                    publisher.setMaxServicesPerBusiness(100);
-                    publisher.setMaxTmodels(100);
+                    publisher.setMaxBindingsPerService(MaxBindingsPerService);
+                    publisher.setMaxBusinesses(MaxBusinesses);
+                    publisher.setMaxServicesPerBusiness(MaxServicesPerBusiness);
+                    publisher.setMaxTmodels(MaxTmodels);
                     publisher.setPublisherName("Unknown");
                     em.persist(publisher);
                     tx.commit();

Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapSimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapSimpleAuthenticator.java?rev=1550334&r1=1550333&r2=1550334&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapSimpleAuthenticator.java
(original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/v3/auth/LdapSimpleAuthenticator.java
Thu Dec 12 03:02:52 2013
@@ -116,6 +116,22 @@ public class LdapSimpleAuthenticator imp
             throw new UnknownUserException(new ErrorMessage("errors.auth.NoPublisher", authorizedName));
         }
 
+        int MaxBindingsPerService = -1;
+        int MaxServicesPerBusiness = -1;
+        int MaxTmodels = -1;
+        int MaxBusinesses = -1;
+        try {
+                MaxBindingsPerService = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_BINDINGS_PER_SERVICE,
-1);
+                MaxServicesPerBusiness = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_SERVICES_PER_BUSINESS,
-1);
+                MaxTmodels = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_TMODELS_PER_PUBLISHER,
-1);
+                MaxBusinesses = AppConfig.getConfiguration().getInt(Property.JUDDI_MAX_BUSINESSES_PER_PUBLISHER,
-1);
+        } catch (Exception ex) {
+                MaxBindingsPerService = -1;
+                MaxServicesPerBusiness = -1;
+                MaxTmodels = -1;
+                MaxBusinesses = -1;
+                logger.error("config exception! " + authorizedName, ex);
+        }
         boolean isLdapUser = false;
         try {
             env = new Hashtable<String, String>();
@@ -155,10 +171,10 @@ public class LdapSimpleAuthenticator imp
                     publisher.setAuthorizedName(authorizedName);
                     publisher.setIsAdmin("false");
                     publisher.setIsEnabled("true");
-                    publisher.setMaxBindingsPerService(199);
-                    publisher.setMaxBusinesses(100);
-                    publisher.setMaxServicesPerBusiness(100);
-                    publisher.setMaxTmodels(100);
+                    publisher.setMaxBindingsPerService(MaxBindingsPerService);
+                    publisher.setMaxBusinesses(MaxBusinesses);
+                    publisher.setMaxServicesPerBusiness(MaxServicesPerBusiness);
+                    publisher.setMaxTmodels(MaxTmodels);
                     publisher.setPublisherName("Unknown");
                     em.persist(publisher);
                     tx.commit();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message