geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1032500 [1/2] - in /geronimo/server/branches/2.1: framework/configs/server-security-config/src/main/resources/security/ plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/jsr88/ plugins/conn...
Date Mon, 08 Nov 2010 09:11:38 GMT
Author: xiaming
Date: Mon Nov  8 09:11:36 2010
New Revision: 1032500

URL: http://svn.apache.org/viewvc?rev=1032500&view=rev
Log:
GERONIMO-4296 verify the patch for G 2.1 branch and commit it, patch was provided by Han Hong Fang

Added:
    geronimo/server/branches/2.1/plugins/derby/derby/
    geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt   (with props)
    geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt   (with props)
    geronimo/server/branches/2.1/plugins/derby/derby/pom.xml   (with props)
    geronimo/server/branches/2.1/plugins/derby/derby/src/
    geronimo/server/branches/2.1/plugins/derby/derby/src/main/
    geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/
    geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java   (with props)
    geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/MockKernel.java   (with props)
Removed:
    geronimo/server/branches/2.1/plugins/derby/LICENSE.txt
    geronimo/server/branches/2.1/plugins/derby/NOTICE.txt
    geronimo/server/branches/2.1/plugins/derby/src/
    geronimo/server/branches/2.1/plugins/system-database/geronimo-derby/
Modified:
    geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_groups.properties
    geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_users.properties
    geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/groups.properties
    geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/users.properties
    geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
    geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/resources/plan-with-nulls.xml
    geronimo/server/branches/2.1/plugins/derby/pom.xml
    geronimo/server/branches/2.1/plugins/monitoring/agent-ds/src/main/plan/plan.xml
    geronimo/server/branches/2.1/plugins/monitoring/mconsole-ds/src/main/plan/plan.xml
    geronimo/server/branches/2.1/plugins/system-database/pom.xml
    geronimo/server/branches/2.1/plugins/system-database/sysdb-console-jetty/pom.xml
    geronimo/server/branches/2.1/plugins/system-database/sysdb-console-tomcat/pom.xml
    geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java
    geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
    geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java
    geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listTables.jsp
    geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/runSQLNormal.jsp
    geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/viewTableContents.jsp
    geronimo/server/branches/2.1/plugins/system-database/system-database/pom.xml
    geronimo/server/branches/2.1/plugins/system-database/system-database/src/main/plan/plan.xml
    geronimo/server/branches/2.1/plugins/uddi/geronimo-uddi-db/pom.xml
    geronimo/server/branches/2.1/plugins/uddi/uddi-server/uddi-jetty6/src/main/plan/plan.xml
    geronimo/server/branches/2.1/plugins/uddi/uddi-server/uddi-tomcat/src/main/plan/plan.xml
    geronimo/server/branches/2.1/testsuite/deployment-testsuite/jca-cms-tests/jca-cms-ear/src/main/resources/META-INF/geronimo-application.xml
    geronimo/server/branches/2.1/testsuite/deployment-testsuite/jca-cms-tests/jca-cms-ear/src/test/java/org/apache/geronimo/testsuite/jcacms/CmsTest.java
    geronimo/server/branches/2.1/testsuite/deployment-testsuite/jca-cms-tests/jca-cms-war/src/main/java/org/apache/geronimo/itest/TestServlet.java
    geronimo/server/branches/2.1/testsuite/security-testsuite/test-security/src/test/java/org/apache/geronimo/testsuite/security/TestSecurity.java
    geronimo/server/branches/2.1/testsupport/test-deployment-j2ee_1.3/test-rar-j2ee_1.3/src/main/rar/META-INF/geronimo-ra.xml
    geronimo/server/branches/2.1/testsupport/test-deployment-j2ee_1.4/test-rar-j2ee_1.4/src/main/rar/META-INF/geronimo-ra.xml
    geronimo/server/branches/2.1/testsupport/test-deployment-javaee_5/test-rar-javaee_5/src/main/rar/META-INF/geronimo-ra.xml

Modified: geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_groups.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_groups.properties?rev=1032500&r1=1032499&r2=1032500&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_groups.properties (original)
+++ geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_groups.properties Mon Nov  8 09:11:36 2010
@@ -18,6 +18,6 @@
 
 manager=izumi
 it=alan
-pet=george,gracie,metro
-dog=george,gracie
+pet=george,gracie,metro,dbadmin
+dog=george,gracie,dbadmin
 cat=metro
\ No newline at end of file

Modified: geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_users.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_users.properties?rev=1032500&r1=1032499&r2=1032500&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_users.properties (original)
+++ geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/demo_users.properties Mon Nov  8 09:11:36 2010
@@ -20,4 +20,5 @@ izumi=violin
 alan=starcraft
 george=bone
 gracie=biscuit
-metro=mouse
\ No newline at end of file
+metro=mouse
+dbadmin=manager
\ No newline at end of file

Modified: geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/groups.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/groups.properties?rev=1032500&r1=1032499&r2=1032500&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/groups.properties (original)
+++ geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/groups.properties Mon Nov  8 09:11:36 2010
@@ -16,3 +16,4 @@
 #=====================================================================
 admin=system
 monitor=monitor
+derbyadmin=dbadmin

Modified: geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/users.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/users.properties?rev=1032500&r1=1032499&r2=1032500&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/users.properties (original)
+++ geronimo/server/branches/2.1/framework/configs/server-security-config/src/main/resources/security/users.properties Mon Nov  8 09:11:36 2010
@@ -16,3 +16,4 @@
 #=====================================================================
 system=manager
 monitor=password
+dbadmin=manager

Modified: geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java?rev=1032500&r1=1032499&r2=1032500&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java (original)
+++ geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/jsr88/Connector15DCBTest.java Mon Nov  8 09:11:36 2010
@@ -247,7 +247,7 @@ public class Connector15DCBTest extends 
             if(setting.getName().equals("Driver")) {
                 assertEquals("org.apache.derby.jdbc.EmbeddedDriver", setting.getStringValue());
             } else if(setting.getName().equals("ConnectionURL")) {
-                assertEquals("jdbc:derby:TestDatabase;create=true", setting.getStringValue());
+                assertEquals("jdbc:derby:TestDatabase;create=true;user=dbadmin;password=manager", setting.getStringValue());
             } else fail("Unknown connection setting '"+setting.getName()+"'");
         }
         // Make sure the original objects didn't lose track of the null config settings

Modified: geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/resources/plan-with-nulls.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/resources/plan-with-nulls.xml?rev=1032500&r1=1032499&r2=1032500&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/resources/plan-with-nulls.xml (original)
+++ geronimo/server/branches/2.1/plugins/connector/geronimo-connector-builder/src/test/resources/plan-with-nulls.xml Mon Nov  8 09:11:36 2010
@@ -48,7 +48,7 @@
 <!--
                     <config-property-setting name="UserName" xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
 -->
-                    <config-property-setting name="ConnectionURL">jdbc:derby:TestDatabase;create=true</config-property-setting>
+                    <config-property-setting name="ConnectionURL">jdbc:derby:TestDatabase;create=true;user=dbadmin;password=manager</config-property-setting>
                     <connectionmanager>
                         <local-transaction/>
                         <single-pool>

Added: geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt (added)
+++ geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt Mon Nov  8 09:11:36 2010
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/LICENSE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt (added)
+++ geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt Mon Nov  8 09:11:36 2010
@@ -0,0 +1,5 @@
+Apache Geronimo 
+Copyright 2003-2010 The Apache Software Foundation
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/NOTICE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/derby/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/derby/pom.xml?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/derby/pom.xml (added)
+++ geronimo/server/branches/2.1/plugins/derby/derby/pom.xml Mon Nov  8 09:11:36 2010
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>derby</artifactId>
+        <version>2.1.7-SNAPSHOT</version>
+    </parent>
+    
+    <groupId>org.apache.geronimo.configs</groupId>
+    <artifactId>derby</artifactId>
+    <name>Geronimo Plugins, Derby :: Config</name>
+    <packaging>car</packaging>
+
+    <description>
+        Geronimo module that supplies the Derby runtime in a single classloader.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>j2ee-server</artifactId>
+            <type>car</type>
+            <version>${version}</version>
+        </dependency>        
+        
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>j2ee-security</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-gbean-deployer</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-derby</artifactId>
+            <version>${version}</version>            
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbynet</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbytools</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.buildsupport</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <configuration>
+                    <useMavenDependencies>
+                        <value>true</value>
+                        <includeVersion>true</includeVersion>
+                    </useMavenDependencies>
+                    <category>Geronimo Core</category>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml (added)
+++ geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml Mon Nov  8 09:11:36 2010
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
+
+</module>

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/derby/src/main/plan/plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt Mon Nov  8 09:11:36 2010
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/LICENSE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt Mon Nov  8 09:11:36 2010
@@ -0,0 +1,5 @@
+Apache Geronimo 
+Copyright 2003-2010 The Apache Software Foundation
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/NOTICE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml Mon Nov  8 09:11:36 2010
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>derby</artifactId>
+        <version>2.1.7-SNAPSHOT</version>
+    </parent>
+    
+    <groupId>org.apache.geronimo.modules</groupId>
+    <artifactId>geronimo-derby</artifactId>
+    <name>Geronimo Plugins, Derby :: Core</name>
+    
+    <description>Wrapper for using Apache Derby as a bundled database.</description>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derby</artifactId>            
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbynet</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbytools</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-management</artifactId>
+            <version>${version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-security</artifactId>
+            <version>${version}</version>
+        </dependency>
+    </dependencies>
+
+</project>
+

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,61 @@
+/**
+ *  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.geronimo.derby;
+
+import java.util.Arrays;
+import java.io.Serializable;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+/** 
+ * Simple wrapper for a username and password. * 
+ * @version $Rev$ $Date$
+ */
+
+public class Credentials implements CallbackHandler, Serializable {
+    private final String username;
+    private final char[] password;
+
+    public Credentials(String username, String password) {
+        this.username = username;
+        this.password = password == null ? null : password.toCharArray();
+    }
+
+    public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            Callback callback = callbacks[i];
+            if (callback instanceof NameCallback) {
+                NameCallback nc = (NameCallback) callback;
+                nc.setName(username);
+            } else if (callback instanceof PasswordCallback) {
+                PasswordCallback pc = (PasswordCallback) callback;
+                pc.setPassword(password);
+            } else {
+                throw new UnsupportedCallbackException(callback);
+            }
+        }
+    }
+
+    public void clear() {
+        if(password != null) {
+            Arrays.fill(password, '\0');
+        }
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/Credentials.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,28 @@
+/**
+ *  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.geronimo.derby;
+
+import org.apache.geronimo.management.geronimo.Log;
+
+/**
+ * ReplaceMe
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DerbyLog extends Log {
+    public SearchResults searchLog(Integer startLine, Integer endLine, Integer max, String regex);
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLog.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,126 @@
+/**
+ *  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.geronimo.derby;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+/**
+ * ReplaceMe
+ *
+ * @version $Rev$ $Date$
+ */
+public class DerbyLogGBean implements DerbyLog {
+
+    private final DerbySystem derby;
+    private File logFile = null;
+
+    public DerbyLogGBean(DerbySystem derby) {
+        this.derby = derby;
+    }
+
+    public SearchResults searchLog(Integer startLine, Integer endLine, Integer max, String text) {
+        // Get log file
+        if(logFile == null) {
+            logFile = new File(derby.getDerbyHome(), "derby.log");
+            if(!logFile.canRead()) {
+                throw new IllegalStateException("Cannot read Derby log file at '"+logFile.getAbsolutePath()+"'");
+            }
+        }
+        // Check that the text pattern is valid
+        Pattern textPattern;
+        try {
+            textPattern = text == null || text.equals("") ? null : Pattern.compile(text);
+        } catch (PatternSyntaxException e) {
+            throw new IllegalArgumentException("Bad regular expression '"+text+"'");
+        }
+        return searchFile(logFile, textPattern, startLine, endLine,
+                max == null ? MAX_SEARCH_RESULTS : Math.min(MAX_SEARCH_RESULTS, max.intValue()));
+    }
+
+    private static SearchResults searchFile(File file, Pattern textSearch, Integer start, Integer stop, int max) {
+        List list = new LinkedList();
+        boolean capped = false;
+        int lineCount = 0;
+        FileInputStream logInputStream = null;
+        try {
+            logInputStream = new FileInputStream(file);
+            BufferedReader reader = new BufferedReader(new InputStreamReader(logInputStream, "US-ASCII"));
+            Matcher text = textSearch == null ? null : textSearch.matcher("");
+            max = Math.min(max, MAX_SEARCH_RESULTS);
+            String line;
+            while ((line = reader.readLine()) != null) {
+                ++lineCount;
+                if(start != null && start.intValue() > lineCount) {
+                    continue;
+                }
+                if(stop != null && stop.intValue() < lineCount) {
+                    continue;
+                }
+                if(text != null) {
+                    text.reset(line);
+                    if(!text.find()) {
+                        continue;
+                    }
+                }
+                list.add(new LogMessage(lineCount,line.toString()));
+                if(list.size() > max) {
+                    list.remove(0);
+                    capped = true;
+                }
+            }
+
+        } catch (Exception e) {            
+            // TODO: improve exception handling
+        } finally {
+            if (logInputStream != null) {
+                try {
+                    logInputStream.close();
+                } catch (IOException e) {
+                    // ignore
+                }
+            }
+        }
+        return new SearchResults(lineCount, (LogMessage[]) list.toArray(new LogMessage[list.size()]), capped);
+    }
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Derby Log", DerbyLogGBean.class);
+
+        infoFactory.addReference("DerbySystem", DerbySystem.class, "GBean");
+        infoFactory.addInterface(DerbyLog.class);
+        infoFactory.setConstructor(new String[]{"DerbySystem"});
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyLogGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,121 @@
+/**
+ *  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.geronimo.derby;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.derby.drda.NetworkServerControl;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+
+/**
+ * A GBean that manages remote network access to the embedded Derby server.
+ *
+ * todo need to figure out how to configure this without using system properties
+ * @version $Rev$ $Date$
+ */
+public class DerbyNetworkGBean implements GBeanLifecycle {
+    private static final Log log = LogFactory.getLog("DerbyNetwork");
+
+    private NetworkServerControl network;
+    private String host = "localhost";
+    private int port = 1527;
+    private String userName="dbadmin";
+    private String userPassword="manager";
+
+    public DerbyNetworkGBean(DerbySystem system) {
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public int getPort() {
+        return port;
+    }
+    
+     public String getUserName() {
+         return userName;
+     }
+
+     public void setUserName(String userName) {
+         this.userName = userName;
+     }
+
+     public String getUserPassword() {
+         return userPassword;
+     }
+
+     public void setUserPassword(String userPassword) {
+         this.userPassword = userPassword;
+     }
+     
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public InetSocketAddress getAddress() {
+        return new InetSocketAddress(getHost(), getPort());
+    }
+
+    public void doStart() throws Exception {
+        InetAddress address = InetAddress.getByName(host);
+        network = new NetworkServerControl(address, port, userName, userPassword);
+        network.start(null); // todo work out how to add this to our log stream
+        log.debug("Started on host " + host + ':' + port);
+    }
+
+    public void doStop() throws Exception {
+        if (network != null) {
+            try {
+                network.shutdown();
+            } finally {
+                network = null;
+            }
+        }
+        log.debug("Stopped");
+    }
+
+    public void doFail() {
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Derby Connector", DerbyNetworkGBean.class);
+        infoFactory.addAttribute("host", String.class, true, true);
+        infoFactory.addAttribute("port", Integer.TYPE, true, true);
+        infoFactory.addAttribute("userName", String.class, true, true);
+        infoFactory.addAttribute("userPassword", String.class, true, true);
+        infoFactory.addAttribute("address", InetSocketAddress.class, false);
+        infoFactory.addReference("derbySystem", DerbySystem.class, "GBean");
+        infoFactory.setConstructor(new String[]{"derbySystem"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyNetworkGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,27 @@
+/**
+ *  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.geronimo.derby;
+
+/**
+ * Management interface for the Derby system GBean
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DerbySystem {
+    public String getDerbyHome();
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystem.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,137 @@
+/**
+ *  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.geronimo.derby;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+/**
+ * A GBean that represents an instance of an Apache Derby system (a system being
+ * a collection of different databases).
+ *
+ * @version $Rev$ $Date$
+ */
+public class DerbySystemGBean implements DerbySystem, GBeanLifecycle {
+    private static final Log log = LogFactory.getLog("DerbySystem");
+    private static final String SYSTEM_HOME = "derby.system.home";
+    private static final String SHUTDOWN_ALL = "jdbc:derby:;shutdown=true";
+    private static final String DERBYNETWORK_GBEAN_NAME = "DerbyNetwork";    
+    private static final String DERBYNETWORK_GBEAN_ATTRIBUTE_USERNAME = "userName";    
+    private static final String DERBYNETWORK_GBEAN_ATTRIBUTE_USERPASSWORD = "userPassword";
+
+    private final ServerInfo serverInfo;
+    private final String systemHome;
+    private String actualHome;
+    private Kernel kernel;
+
+    public DerbySystemGBean(ServerInfo serverInfo, String derbySystemHome, Kernel kernel) {
+         this.serverInfo = serverInfo;
+         this.systemHome = derbySystemHome;
+         this.kernel = kernel;
+     }
+
+    public String getDerbyHome() {
+        return actualHome;
+    }
+    
+    private String getDerbyUserID() {
+         try {
+             return (String) kernel.getAttribute(DERBYNETWORK_GBEAN_NAME, DERBYNETWORK_GBEAN_ATTRIBUTE_USERNAME);
+         } catch (Exception e) {
+             return null;
+         }
+     }
+ 
+     private String getDerbyUserPassword() {
+         try {
+             return (String) kernel.getAttribute(DERBYNETWORK_GBEAN_NAME, DERBYNETWORK_GBEAN_ATTRIBUTE_USERPASSWORD);
+         } catch (Exception e) {
+             return null;
+         }
+     }
+     
+
+    public void doStart() throws Exception {
+        // set up the system property for the database home
+        actualHome = System.getProperty(SYSTEM_HOME);
+        if (actualHome == null) {
+            actualHome = serverInfo.resolveServerPath(systemHome);
+        }
+        System.setProperty(SYSTEM_HOME, actualHome);
+
+        // set the magic system property that causes derby to use explicity
+        // file sync instead of relying on vm support for file open rws
+        System.setProperty("derby.storage.fileSyncTransactionLog", "true");
+        
+     
+        // set system property to enable Derby user authentication
+        if (System.getProperty("derby.connection.requireAuthentication") == null) {
+            System.setProperty("derby.connection.requireAuthentication", "true");
+            System.setProperty("derby.authentication.provider", "org.apache.geronimo.derby.DerbyUserAuthenticator");
+        }
+
+        // load the Embedded driver to initialize the home
+        new org.apache.derby.jdbc.EmbeddedDriver();
+        log.debug("Started in " + actualHome);
+    }
+
+    public void doStop() throws Exception {
+        try {
+            DriverManager.getConnection(SHUTDOWN_ALL, getDerbyUserID(), getDerbyUserPassword());
+        } catch (SQLException e) {
+            // SQLException gets thrown on successful shutdown so ignore
+        }
+        System.gc();  // Added per recommendation Derby documentation
+        log.debug("Stopped");
+    }
+
+    public void doFail() {
+        try {
+            DriverManager.getConnection(SHUTDOWN_ALL, getDerbyUserID(), getDerbyUserPassword());
+        } catch (SQLException e) {
+            // SQLException gets thrown on successful shutdown so ignore
+        }
+        System.gc();  // Added per recommendation Derby documentation
+        log.warn("Failed");
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(DerbySystemGBean.class);
+        infoFactory.addAttribute("derbySystemHome", String.class, true);
+        infoFactory.addAttribute("derbyHome", String.class, false);
+        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
+        infoFactory.setConstructor(new String[]{"ServerInfo", "derbySystemHome", "kernel"});
+        infoFactory.setPriority(GBeanInfo.PRIORITY_CLASSLOADER);
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbySystemGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,89 @@
+/**
+ *  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.geronimo.derby;
+
+import java.sql.SQLException;
+import java.util.Properties;
+import java.util.Set;
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.derby.authentication.UserAuthenticator;
+import org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal;
+
+/**
+ * 
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DerbyUserAuthenticator implements UserAuthenticator {
+
+    private static final Log log = LogFactory.getLog("DerbyUserAuthenticator");
+    private static final String configName = "geronimo-admin";
+
+    /*
+     * A user-defined UserAuthenticator to authenticate the user id and password, which are used access Geronimo
+     * embedded derby.
+     */
+    public boolean authenticateUser(String userName, String userPassword, String databaseName, Properties info)
+            throws SQLException {
+
+        Thread thread = Thread.currentThread();
+        ClassLoader oldCL = thread.getContextClassLoader();
+        Credentials credentials = new Credentials(userName, userPassword);
+
+        try {
+            thread.setContextClassLoader(DerbyUserAuthenticator.class.getClassLoader());
+            // TODO consider using ContextManager for login and checking a permission against the ACC
+            // to do e.g. deployments.
+            LoginContext context = new LoginContext(configName, credentials);
+            context.login();
+
+            Subject sub = context.getSubject();
+            Set<GeronimoGroupPrincipal> pricipalsGroup = sub.getPrincipals(GeronimoGroupPrincipal.class);
+            boolean databaseLevelFlag = false;
+            for (GeronimoGroupPrincipal principal : pricipalsGroup) {
+                // if user group is "derbyadmin", then authentication passed without checking the databaseName
+                if (principal.getName().equalsIgnoreCase("derbyadmin")) {
+                    return true;
+                } else {
+                    // To define database level user, the the user group should be "derby_${databaseName}"
+                    if (databaseName != null) {
+                        databaseLevelFlag = principal.getName().equalsIgnoreCase("derby_" + databaseName);
+                    }
+                }
+            }
+            if (!databaseLevelFlag) {
+                logAuthenticationFailure(userName, userPassword, databaseName);
+            }
+            return databaseLevelFlag;
+        } catch (LoginException e) {
+            logAuthenticationFailure(userName, userPassword, databaseName);
+            return false;
+        } finally {
+            credentials.clear();
+            thread.setContextClassLoader(oldCL);
+        }
+    }
+
+    private void logAuthenticationFailure(String userName, String userPassword, String databaseName) {
+        log.warn("User authentication failure (userName userPassword databaseName): " + userName + " " + userPassword
+                + " " + databaseName);
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/main/java/org/apache/geronimo/derby/DerbyUserAuthenticator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java?rev=1032500&view=auto
==============================================================================
--- geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java (added)
+++ geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java Mon Nov  8 09:11:36 2010
@@ -0,0 +1,97 @@
+/**
+ *  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.geronimo.derby;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DerbySystemGBeanTest extends TestCase {
+    private File systemDir;
+    private Kernel kernel;
+
+    public void testCreateSystemUsingServerInfo() throws Exception {
+    
+        System.setProperty("derby.connection.requireAuthentication", "false");
+        
+        ServerInfo serverInfo = new BasicServerInfo(systemDir.toString());
+        String derbyDir = "var/dbderby";
+        DerbySystemGBean gbean = new DerbySystemGBean(serverInfo, derbyDir, kernel);
+        try {
+            gbean.doStart();
+            new org.apache.derby.jdbc.EmbeddedDriver();
+            connect();
+            gbean.doStop();
+            assertTrue(new File(systemDir, derbyDir+"/derby.log").exists());
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+    }
+
+    private void connect() throws SQLException {
+        Connection c = DriverManager.getConnection("jdbc:derby:testdb;create=true;user=dbadmin;password=manager");
+        c.close();
+    }
+
+    protected void setUp() throws Exception {
+        try {
+            super.setUp();
+            systemDir = File.createTempFile("derbyTest", ".tmp");
+            systemDir.delete();
+            systemDir.mkdir();
+
+            Properties props = System.getProperties();
+            props.remove("derby.system.home");
+        } catch (Exception e) {
+            delete(systemDir);
+            throw e;
+        }
+        
+        kernel = new MockKernel();
+    }
+
+    protected void tearDown() throws Exception {
+        delete(systemDir);
+        super.tearDown();
+    }
+
+    private void delete(File file) throws IOException {
+        if (file == null) {
+            return;
+        }
+
+        File[] files = file.listFiles();
+        if (files != null) {
+            for (int i = 0; i < files.length; i++) {
+                delete(files[i]);
+            }
+        }
+        file.delete();
+    }
+}

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/plugins/derby/geronimo-derby/src/test/java/org/apache/geronimo/derby/DerbySystemGBeanTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message