db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1301064 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java engine/org/apache/derby/loc/messages.xml shared/org/apache/derby/shared/common/reference/SQLState.java
Date Thu, 15 Mar 2012 16:06:51 GMT
Author: rhillegas
Date: Thu Mar 15 16:06:50 2012
New Revision: 1301064

URL: http://svn.apache.org/viewvc?rev=1301064&view=rev
Log:
DERBY-5657: Split complex error message into 3 shorter messages.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
    db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java?rev=1301064&r1=1301063&r2=1301064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
Thu Mar 15 16:06:50 2012
@@ -407,12 +407,16 @@ public abstract class AuthenticationServ
                 ( stringValue.startsWith( Property.AUTHENTICATION_PROVIDER_NATIVE ) )&&
                 !settingToNativeLocal
                 )
-            { throw badNativeAuthenticationChange(); }
+            {
+                throw  StandardException.newException( SQLState.PROPERTY_BAD_NATIVE_VALUE
);
+            }
 
             // once set to NATIVE authentication, you can't change it
             String  oldValue = (String) p.get( Property.AUTHENTICATION_PROVIDER_PARAMETER
);
             if ( (oldValue != null) && oldValue.startsWith( Property.AUTHENTICATION_PROVIDER_NATIVE
) )
-            { throw badNativeAuthenticationChange(); }
+            {
+                throw StandardException.newException( SQLState.PROPERTY_CANT_UNDO_NATIVE
);
+            }
 
             // can't turn on NATIVE + LOCAL authentication unless the DBO's credentials are
already stored.
             // this should prevent setting NATIVE + LOCAL authentication in pre-10.9 databases
too
@@ -423,7 +427,10 @@ public abstract class AuthenticationServ
                 String              dbo = dd.getAuthorizationDatabaseOwner();
                 UserDescriptor  userCredentials = dd.getUser( dbo );
 
-                if ( userCredentials == null ) { throw badNativeAuthenticationChange(); }
+                if ( userCredentials == null )
+                {
+                    throw StandardException.newException( SQLState.PROPERTY_DBO_LACKS_CREDENTIALS
);
+                }
             }
         }
 
@@ -447,10 +454,6 @@ public abstract class AuthenticationServ
         
         return false;
 	}
-    private StandardException   badNativeAuthenticationChange()
-    {
-        return StandardException.newException( SQLState.PROPERTY_BAD_NATIVE_CHANGE );
-    }
     /** Parse the value of the password lifetime property. Return null if it is bad. */
     protected   Long    parsePasswordLifetime( String passwordLifetimeString )
     {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml?rev=1301064&r1=1301063&r2=1301064&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages.xml Thu Mar 15 16:06:50
2012
@@ -4246,8 +4246,18 @@ ln=lower-case two-letter ISO-639 languag
             </msg>
 
             <msg>
-                <name>XCY05.S</name>
-                <text>Invalid change of the derby.authentication.provider property.
Once set to NATIVE authentication, this property cannot be changed. NATIVE::LOCAL is the only
NATIVE value accepted by derby.authentication.provider. This property cannot be set to NATIVE::LOCAL
unless credentials for the database owner have been stored in the database using the SYSCS_UTIL.SYSCS_CREATE_USER
procedure.</text>
+                <name>XCY05.S.1</name>
+                <text>Invalid change of the derby.authentication.provider property.
NATIVE::LOCAL is the only NATIVE value accepted by derby.authentication.provider.</text>
+            </msg>
+
+            <msg>
+                <name>XCY05.S.2</name>
+                <text>Invalid change of the derby.authentication.provider property.
Once set to NATIVE authentication, this property cannot be changed.</text>
+            </msg>
+
+            <msg>
+                <name>XCY05.S.3</name>
+                <text>Invalid change of the derby.authentication.provider property.
This property cannot be set to NATIVE::LOCAL unless credentials for the database owner have
been stored in the database using the SYSCS_UTIL.SYSCS_CREATE_USER procedure.</text>
             </msg>
 
         </family>

Modified: db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java?rev=1301064&r1=1301063&r2=1301064&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
(original)
+++ db/derby/code/trunk/java/shared/org/apache/derby/shared/common/reference/SQLState.java
Thu Mar 15 16:06:50 2012
@@ -261,7 +261,9 @@ public interface SQLState {
 	String PROPERTY_UNSUPPORTED_CHANGE  = "XCY02.S";
 	String PROPERTY_MISSING				= "XCY03.S";
 	String PROPERTY_SYNTAX_INVALID		= "XCY04.S";
-	String PROPERTY_BAD_NATIVE_CHANGE  = "XCY05.S";
+	String PROPERTY_BAD_NATIVE_VALUE  = "XCY05.S.1";
+	String PROPERTY_CANT_UNDO_NATIVE  = "XCY05.S.2";
+	String PROPERTY_DBO_LACKS_CREDENTIALS  = "XCY05.S.3";
 
 	/*
 	** LockManager



Mime
View raw message