Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-12-10 00:32:42 +0000
committerAngel Avila2014-12-10 00:32:42 +0000
commit1ce02938338640370b6b017350c710258280307c (patch)
tree487031df3bcac0f77330adeee3075d71fa1722a1
parent7a118fee8d1ac1edbe32650fbfcdbafa2ebdf424 (diff)
downloadorg.eclipse.osee-1ce02938338640370b6b017350c710258280307c.tar.gz
org.eclipse.osee-1ce02938338640370b6b017350c710258280307c.tar.xz
org.eclipse.osee-1ce02938338640370b6b017350c710258280307c.zip
feature[ats_ATS144309]: Remove unused framework database bundle
-rw-r--r--plugins/org.eclipse.osee.framework.database/.classpath7
-rw-r--r--plugins/org.eclipse.osee.framework.database/.pmd925
-rw-r--r--plugins/org.eclipse.osee.framework.database/.project33
-rw-r--r--plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF30
-rw-r--r--plugins/org.eclipse.osee.framework.database/OSGI-INF/database.info.registry.xml8
-rw-r--r--plugins/org.eclipse.osee.framework.database/OSGI-INF/database.service.xml10
-rw-r--r--plugins/org.eclipse.osee.framework.database/OSGI-INF/uri.connection.contributor.xml9
-rw-r--r--plugins/org.eclipse.osee.framework.database/build.properties6
-rw-r--r--plugins/org.eclipse.osee.framework.database/pom.xml34
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/AbstractDatabaseInfoContributor.java40
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseInfoRegistry.java26
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseService.java55
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java23
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IQueryProcessor.java22
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseConnectionInfo.java88
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseInfoManager.java48
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java96
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IConnectionFactory.java24
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDatabaseInfoProvider.java25
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbConnectionInformationContributor.java21
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbTransactionWork.java41
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java127
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java36
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java83
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SQL3DataType.java81
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java132
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoRegistryImpl.java84
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/ServiceUtil.java57
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/UriDbConnectionInfo.java42
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/BaseOseeConnection.java130
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionProvider.java32
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java211
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceProxy.java186
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java118
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java511
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigUtil.java152
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigurationProvider.java83
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolFactory.java133
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledConnectionProvider.java101
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledDataSourceFetcher.java212
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java138
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConfigParser.java209
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConnectionData.java97
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbDetailData.java103
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbInformation.java131
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbSetupData.java78
46 files changed, 0 insertions, 4838 deletions
diff --git a/plugins/org.eclipse.osee.framework.database/.classpath b/plugins/org.eclipse.osee.framework.database/.classpath
deleted file mode 100644
index ad32c83a78..0000000000
--- a/plugins/org.eclipse.osee.framework.database/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.osee.framework.database/.pmd b/plugins/org.eclipse.osee.framework.database/.pmd
deleted file mode 100644
index c7b0a9fb3f..0000000000
--- a/plugins/org.eclipse.osee.framework.database/.pmd
+++ /dev/null
@@ -1,925 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<pmd>
- <useProjectRuleSet>false</useProjectRuleSet>
- <ruleSetFile>.ruleset</ruleSetFile>
- <rules>
- <rule>
- <name>LooseCoupling</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- <rule>
- <name>CloneMethodMustImplementCloneable</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedImports</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- <rule>
- <name>SignatureDeclareThrowsException</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- <rule>
- <name>IfStmtsMustUseBraces</name>
- <ruleset>Braces Rules</ruleset>
- </rule>
- <rule>
- <name>WhileLoopsMustUseBraces</name>
- <ruleset>Braces Rules</ruleset>
- </rule>
- <rule>
- <name>IfElseStmtsMustUseBraces</name>
- <ruleset>Braces Rules</ruleset>
- </rule>
- <rule>
- <name>ForLoopsMustUseBraces</name>
- <ruleset>Braces Rules</ruleset>
- </rule>
- <rule>
- <name>UseSingleton</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>SimplifyBooleanReturns</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>SimplifyBooleanExpressions</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>SwitchStmtsShouldHaveDefault</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidDeeplyNestedIfStmts</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidReassigningParameters</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>SwitchDensity</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>ConstructorCallsOverridableMethod</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AccessorClassGeneration</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>FinalFieldCouldBeStatic</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>CloseResource</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>NonStaticInitializer</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>DefaultLabelNotLastInSwitchStmt</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>NonCaseLabelInSwitchStatement</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>OptimizableToArrayCall</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>BadComparison</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>EqualsNull</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>ConfusingTernary</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>InstantiationToGetClass</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>IdempotentOperations</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>SimpleDateFormatNeedsLocale</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>ImmutableField</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>UseLocaleWithCaseConversions</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidProtectedFieldInFinalClass</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AssignmentToNonFinalStatic</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>MissingStaticMethodInNonInstantiatableClass</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidSynchronizedAtMethodLevel</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>MissingBreakInSwitch</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>UseNotifyAllInsteadOfNotify</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidInstanceofChecksInCatchClause</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AbstractClassWithoutAbstractMethod</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>SimplifyConditional</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>CompareObjectsWithEquals</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>PositionLiteralsFirstInComparisons</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryLocalBeforeReturn</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>NonThreadSafeSingleton</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>UncommentedEmptyMethod</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>UncommentedEmptyConstructor</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidConstantsInterface</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>UnsynchronizedStaticDateFormatter</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>PreserveStackTrace</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>UseCollectionIsEmpty</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>ClassWithOnlyPrivateConstructorsShouldBeFinal</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyMethodInAbstractClassShouldBeAbstract</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>SingularField</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>ReturnEmptyArrayRatherThanNull</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AbstractClassWithoutAnyMethod</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>TooFewBranchesForASwitchStatement</name>
- <ruleset>Design Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidCatchingThrowable</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>SignatureDeclareThrowsException</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- <rule>
- <name>ExceptionAsFlowControl</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidCatchingNPE</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidThrowingRawExceptionTypes</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidThrowingNullPointerException</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidRethrowingException</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>DoNotExtendJavaLangError</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>DoNotThrowExceptionInFinally</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidThrowingNewInstanceOfSameException</name>
- <ruleset>Strict Exception Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedPrivateField</name>
- <ruleset>Unused Code Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedLocalVariable</name>
- <ruleset>Unused Code Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedPrivateMethod</name>
- <ruleset>Unused Code Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedFormalParameter</name>
- <ruleset>Unused Code Rules</ruleset>
- </rule>
- <rule>
- <name>MoreThanOneLogger</name>
- <ruleset>Java Logging Rules</ruleset>
- </rule>
- <rule>
- <name>LoggerIsNotStaticFinal</name>
- <ruleset>Java Logging Rules</ruleset>
- </rule>
- <rule>
- <name>SystemPrintln</name>
- <ruleset>Java Logging Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidPrintStackTrace</name>
- <ruleset>Java Logging Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidDuplicateLiterals</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>StringInstantiation</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>StringToString</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>InefficientStringBuffering</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryCaseChange</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>UseStringBufferLength</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>AppendCharacterWithChar</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>ConsecutiveLiteralAppends</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>UseIndexOfChar</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>InefficientEmptyStringCheck</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>InsufficientStringBufferDeclaration</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>UselessStringValueOf</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>StringBufferInstantiationWithChar</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>UseEqualsToCompareStrings</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidStringBufferField</name>
- <ruleset>String and StringBuffer Rules</ruleset>
- </rule>
- <rule>
- <name>ReplaceVectorWithList</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>ReplaceHashtableWithMap</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>ReplaceEnumerationWithIterator</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidEnumAsIdentifier</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidAssertAsIdentifier</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>IntegerInstantiation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>ByteInstantiation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>ShortInstantiation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>LongInstantiation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>JUnit4TestShouldUseBeforeAnnotation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>JUnit4TestShouldUseAfterAnnotation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>JUnit4TestShouldUseTestAnnotation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>JUnit4SuitesShouldUseSuiteAnnotation</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>JUnitUseExpected</name>
- <ruleset>Migration Rules</ruleset>
- </rule>
- <rule>
- <name>UseProperClassLoader</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>MDBAndSessionBeanNamingConvention</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>RemoteSessionInterfaceNamingConvention</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>LocalInterfaceSessionNamingConvention</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>LocalHomeNamingConvention</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>RemoteInterfaceNamingConvention</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>DoNotCallSystemExit</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>StaticEJBFieldShouldBeFinal</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>DoNotUseThreads</name>
- <ruleset>J2EE Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidInstantiatingObjectsInLoops</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>UseArrayListInsteadOfVector</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>SimplifyStartsWith</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>UseStringBufferForStringAppends</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>UseArraysAsList</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidArrayLoops</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryWrapperObjectCreation</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>AddEmptyString</name>
- <ruleset>Optimization Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyCatchBlock</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyIfStmt</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyWhileStmt</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyTryBlock</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyFinallyBlock</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptySwitchStatements</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>JumbledIncrementer</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>ForLoopShouldBeWhileLoop</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryConversionTemporary</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>OverrideBothEqualsAndHashcode</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>DoubleCheckedLocking</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>ReturnFromFinallyBlock</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptySynchronizedBlock</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryReturn</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyStaticInitializer</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>UnconditionalIfStatement</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyStatementNotInLoop</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>BooleanInstantiation</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryFinalModifier</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>CollapsibleIfStatements</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>UselessOverridingMethod</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>ClassCastExceptionWithToArray</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidDecimalLiteralsInBigDecimalConstructor</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>UselessOperationOnImmutable</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>MisplacedNullCheck</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedNullCheckInEquals</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidThreadGroup</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>BrokenNullCheck</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>BigIntegerInstantiation</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidUsingOctalValues</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidUsingHardCodedIP</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>CheckResultSet</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidMultipleUnaryOperators</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyInitializer</name>
- <ruleset>Basic Rules</ruleset>
- </rule>
- <rule>
- <name>MethodReturnsInternalArray</name>
- <ruleset>Security Code Guidelines</ruleset>
- </rule>
- <rule>
- <name>ArrayIsStoredDirectly</name>
- <ruleset>Security Code Guidelines</ruleset>
- </rule>
- <rule>
- <name>CouplingBetweenObjects</name>
- <ruleset>Coupling Rules</ruleset>
- </rule>
- <rule>
- <name>ExcessiveImports</name>
- <ruleset>Coupling Rules</ruleset>
- </rule>
- <rule>
- <name>LooseCoupling</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- <rule>
- <name>DuplicateImports</name>
- <ruleset>Import Statement Rules</ruleset>
- </rule>
- <rule>
- <name>DontImportJavaLang</name>
- <ruleset>Import Statement Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedImports</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- <rule>
- <name>ImportFromSamePackage</name>
- <ruleset>Import Statement Rules</ruleset>
- </rule>
- <rule>
- <name>TooManyStaticImports</name>
- <ruleset>Import Statement Rules</ruleset>
- </rule>
- <rule>
- <name>JUnitStaticSuite</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>JUnitSpelling</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>JUnitAssertionsShouldIncludeMessage</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>JUnitTestsShouldIncludeAssert</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>TestClassWithoutTestCases</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryBooleanAssertion</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>UseAssertEqualsInsteadOfAssertTrue</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>UseAssertSameInsteadOfAssertTrue</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>UseAssertNullInsteadOfAssertTrue</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>SimplifyBooleanAssertion</name>
- <ruleset>JUnit Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryConstructor</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>NullAssignment</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>UnusedModifier</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>AssignmentInOperand</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>AtLeastOneConstructor</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>DontImportSun</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>SuspiciousOctalEscape</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>CallSuperInConstructor</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>UnnecessaryParentheses</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>DefaultPackage</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>BooleanInversion</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>DataflowAnomalyAnalysis</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidFinalLocalVariable</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidUsingShortType</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidUsingVolatile</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidUsingNativeCode</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidAccessibilityAlteration</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>DoNotCallGarbageCollectionExplicitly</name>
- <ruleset>Controversial Rules</ruleset>
- </rule>
- <rule>
- <name>MethodNamingConventions</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>ClassNamingConventions</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>AbstractNaming</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidDollarSigns</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>MethodWithSameNameAsEnclosingClass</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>SuspiciousHashcodeMethodName</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>SuspiciousConstantFieldName</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>SuspiciousEqualsMethodName</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidFieldNameMatchingTypeName</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidFieldNameMatchingMethodName</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>NoPackage</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>PackageCase</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>MisleadingVariableName</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>BooleanGetMethodName</name>
- <ruleset>Naming Rules</ruleset>
- </rule>
- <rule>
- <name>NPathComplexity</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>ExcessiveMethodLength</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>ExcessiveParameterList</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>ExcessiveClassLength</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>CyclomaticComplexity</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>ExcessivePublicCount</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>TooManyFields</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>NcssMethodCount</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>NcssTypeCount</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>NcssConstructorCount</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>TooManyMethods</name>
- <ruleset>Code Size Rules</ruleset>
- </rule>
- <rule>
- <name>EmptyFinalizer</name>
- <ruleset>Finalizer Rules</ruleset>
- </rule>
- <rule>
- <name>FinalizeOnlyCallsSuperFinalize</name>
- <ruleset>Finalizer Rules</ruleset>
- </rule>
- <rule>
- <name>FinalizeOverloaded</name>
- <ruleset>Finalizer Rules</ruleset>
- </rule>
- <rule>
- <name>FinalizeDoesNotCallSuperFinalize</name>
- <ruleset>Finalizer Rules</ruleset>
- </rule>
- <rule>
- <name>FinalizeShouldBeProtected</name>
- <ruleset>Finalizer Rules</ruleset>
- </rule>
- <rule>
- <name>AvoidCallingFinalize</name>
- <ruleset>Finalizer Rules</ruleset>
- </rule>
- <rule>
- <name>UseCorrectExceptionLogging</name>
- <ruleset>Jakarta Commons Logging Rules</ruleset>
- </rule>
- <rule>
- <name>ProperLogger</name>
- <ruleset>Jakarta Commons Logging Rules</ruleset>
- </rule>
- <rule>
- <name>MissingSerialVersionUID</name>
- <ruleset>JavaBean Rules</ruleset>
- </rule>
- <rule>
- <name>ProperCloneImplementation</name>
- <ruleset>Clone Implementation Rules</ruleset>
- </rule>
- <rule>
- <name>CloneThrowsCloneNotSupportedException</name>
- <ruleset>Clone Implementation Rules</ruleset>
- </rule>
- <rule>
- <name>CloneMethodMustImplementCloneable</name>
- <ruleset>Type Resolution Rules</ruleset>
- </rule>
- </rules>
- <includeDerivedFiles>false</includeDerivedFiles>
- <violationsAsErrors>true</violationsAsErrors>
-</pmd>
diff --git a/plugins/org.eclipse.osee.framework.database/.project b/plugins/org.eclipse.osee.framework.database/.project
deleted file mode 100644
index 02527d7283..0000000000
--- a/plugins/org.eclipse.osee.framework.database/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.osee.framework.database</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ds.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF
deleted file mode 100644
index 4a6b0d10f1..0000000000
--- a/plugins/org.eclipse.osee.framework.database/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,30 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Database Plug-in (Incubation)
-Bundle-SymbolicName: org.eclipse.osee.framework.database;singleton:=true
-Bundle-Version: 0.20.0.qualifier
-Export-Package: org.eclipse.osee.framework.database,
- org.eclipse.osee.framework.database.core
-Bundle-ActivationPolicy: lazy
-DynamicImport-Package: *
-Bundle-Vendor: Eclipse Open System Engineering Environment
-Import-Package: org.apache.commons.dbcp,
- org.apache.commons.pool,
- org.apache.commons.pool.impl,
- org.eclipse.osee.framework.core.data,
- org.eclipse.osee.framework.core.enums,
- org.eclipse.osee.framework.core.exception,
- org.eclipse.osee.framework.core.model,
- org.eclipse.osee.framework.core.model.cache,
- org.eclipse.osee.framework.core.operation,
- org.eclipse.osee.framework.core.services,
- org.eclipse.osee.framework.core.util,
- org.eclipse.osee.framework.jdk.core.type,
- org.eclipse.osee.framework.jdk.core.util,
- org.eclipse.osee.framework.jdk.core.util.time,
- org.eclipse.osee.framework.jdk.core.util.xml,
- org.eclipse.osee.framework.logging
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Service-Component: OSGI-INF/*.xml
-Require-Bundle: org.eclipse.equinox.ds,
- org.eclipse.core.runtime
diff --git a/plugins/org.eclipse.osee.framework.database/OSGI-INF/database.info.registry.xml b/plugins/org.eclipse.osee.framework.database/OSGI-INF/database.info.registry.xml
deleted file mode 100644
index f722a2d447..0000000000
--- a/plugins/org.eclipse.osee.framework.database/OSGI-INF/database.info.registry.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.framework.database.internal.DatabaseInfoRegistryImpl">
- <implementation class="org.eclipse.osee.framework.database.internal.DatabaseInfoRegistryImpl"/>
- <reference bind="addConnectionInfo" cardinality="1..n" interface="org.eclipse.osee.framework.database.core.IDbConnectionInformationContributor" name="IDbConnectionInformationContributor" policy="dynamic" unbind="removeConnectionInfo"/>
- <service>
- <provide interface="org.eclipse.osee.framework.database.DatabaseInfoRegistry"/>
- </service>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.framework.database/OSGI-INF/database.service.xml b/plugins/org.eclipse.osee.framework.database/OSGI-INF/database.service.xml
deleted file mode 100644
index 8420cb8a89..0000000000
--- a/plugins/org.eclipse.osee.framework.database/OSGI-INF/database.service.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.framework.database.OseeDatabaseServiceProxy">
- <implementation class="org.eclipse.osee.framework.database.internal.core.OseeDatabaseServiceProxy"/>
- <service>
- <provide interface="org.eclipse.osee.framework.database.IOseeDatabaseService"/>
- <provide interface="org.eclipse.osee.framework.database.DatabaseService"/>
- </service>
- <reference bind="addConnectionFactory" unbind="removeConnectionFactory" cardinality="0..n" interface="org.eclipse.osee.framework.database.core.IConnectionFactory" name="IConnectionFactory" policy="dynamic"/>
- <reference bind="setDatabaseInfoProvider" cardinality="1..1" interface="org.eclipse.osee.framework.database.core.IDatabaseInfoProvider" name="IDatabaseInfoProvider" policy="static"/>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.framework.database/OSGI-INF/uri.connection.contributor.xml b/plugins/org.eclipse.osee.framework.database/OSGI-INF/uri.connection.contributor.xml
deleted file mode 100644
index 4a7b5d5bde..0000000000
--- a/plugins/org.eclipse.osee.framework.database/OSGI-INF/uri.connection.contributor.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.framework.database.internal.UriDbConnectionInfo">
- <implementation
- class="org.eclipse.osee.framework.database.internal.UriDbConnectionInfo" />
- <service>
- <provide
- interface="org.eclipse.osee.framework.database.core.IDbConnectionInformationContributor" />
- </service>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.framework.database/build.properties b/plugins/org.eclipse.osee.framework.database/build.properties
deleted file mode 100644
index dc65daf816..0000000000
--- a/plugins/org.eclipse.osee.framework.database/build.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- OSGI-INF/,\
- OSGI-INF/database.info.registry.xml
-source.. = src/
diff --git a/plugins/org.eclipse.osee.framework.database/pom.xml b/plugins/org.eclipse.osee.framework.database/pom.xml
deleted file mode 100644
index c29539d9cd..0000000000
--- a/plugins/org.eclipse.osee.framework.database/pom.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<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.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.orcs.parent</artifactId>
- <version>0.20.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.orcs.parent</relativePath>
- </parent>
-
- <artifactId>org.eclipse.osee.framework.database</artifactId>
- <packaging>eclipse-plugin</packaging>
- <name>OSEE Framework Database - (Incubation)</name>
-
- <build>
- <!-- workaround for https://issues.sonatype.org/browse/TYCHO-168 -->
- <resources>
- <resource>
- <directory>src</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/AbstractDatabaseInfoContributor.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/AbstractDatabaseInfoContributor.java
deleted file mode 100644
index cce8a21b0e..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/AbstractDatabaseInfoContributor.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database;
-
-import java.io.IOException;
-import java.io.InputStream;
-import javax.xml.parsers.ParserConfigurationException;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.database.core.IDbConnectionInformationContributor;
-import org.eclipse.osee.framework.database.internal.parser.DbConfigParser;
-import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-/**
- * @author Roberto E. Escobar
- */
-public abstract class AbstractDatabaseInfoContributor implements IDbConnectionInformationContributor {
-
- protected IDatabaseInfo[] readFromXml(InputStream inputStream) throws IOException, ParserConfigurationException, SAXException {
- try {
- Document document = Jaxp.readXmlDocument(inputStream, "UTF-8");
- Element rootElement = document.getDocumentElement();
- return DbConfigParser.parse(rootElement);
- } finally {
- if (inputStream != null) {
- inputStream.close();
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseInfoRegistry.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseInfoRegistry.java
deleted file mode 100644
index c3c5991c0b..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseInfoRegistry.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database;
-
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface DatabaseInfoRegistry {
-
- IDatabaseInfo getDatabaseInfo(String serviceId) throws OseeCoreException;
-
- IDatabaseInfo getSelectedDatabaseInfo() throws OseeDataStoreException;
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseService.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseService.java
deleted file mode 100644
index 4c39e7d931..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/DatabaseService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database;
-
-import java.util.Map;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface DatabaseService {
-
- IOseeStatement getStatement() throws OseeDataStoreException;
-
- IOseeStatement getStatement(OseeConnection connection) throws OseeDataStoreException;
-
- IOseeStatement getStatement(OseeConnection connection, boolean autoClose) throws OseeDataStoreException;
-
- IOseeStatement getStatement(int resultSetType, int resultSetConcurrency) throws OseeDataStoreException;
-
- OseeConnection getConnection() throws OseeCoreException;
-
- OseeConnection getConnection(IDatabaseInfo info) throws OseeCoreException;
-
- <O extends Object> int runBatchUpdate(String query, Iterable<O[]> dataList) throws OseeCoreException;
-
- <O extends Object> int runPreparedUpdate(String query, O... data) throws OseeCoreException;
-
- <O extends Object> int runBatchUpdate(OseeConnection connection, String query, Iterable<O[]> dataList) throws OseeCoreException;
-
- <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeCoreException;
-
- <T, O extends Object> T runPreparedQueryFetchObject(T defaultValue, String query, O... data) throws OseeCoreException;
-
- <T, O extends Object> T runPreparedQueryFetchObject(OseeConnection connection, T defaultValue, String query, O... data) throws OseeCoreException;
-
- void runQuery(IQueryProcessor processor, String query, Object... data);
-
- boolean isProduction() throws OseeCoreException;
-
- Map<String, String> getStatistics() throws OseeCoreException;
-
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
deleted file mode 100644
index 5737f14c97..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database;
-
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IOseeDatabaseService extends DatabaseService {
- public static final int MAX_VARCHAR_LENGTH = 4000;
-
- long getNextSequence(String sequenceName);
-
- void invalidateSequences();
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IQueryProcessor.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IQueryProcessor.java
deleted file mode 100644
index 42f2a0d875..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IQueryProcessor.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database;
-
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-
-/**
- * @author Donald G. Dunne
- */
-public interface IQueryProcessor {
-
- void processNext(IOseeStatement chStmt);
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseConnectionInfo.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseConnectionInfo.java
deleted file mode 100644
index 836d18719a..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseConnectionInfo.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.util.Properties;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-
-/**
- * @author Ryan D. Brooks
- */
-public class DatabaseConnectionInfo implements IDatabaseInfo {
-
- private static final long serialVersionUID = -6513818831248393100L;
- private final String databaseLoginName;
- private final String connectionPrefix;
- private final String databaseName;
- private final String driver;
- private final String id;
- private final String dbHome;
- private final boolean isProduction;
- private final Properties properties;
-
- public DatabaseConnectionInfo(String databaseLoginName, String connectionPrefix, String databaseName, String driver, String id, String dbHome, Properties properties, boolean isProduction) {
- super();
- this.databaseLoginName = databaseLoginName;
- this.connectionPrefix = connectionPrefix;
- this.databaseName = databaseName;
- this.driver = driver;
- this.id = id;
- this.dbHome = dbHome;
- this.isProduction = isProduction;
- this.properties = properties;
- properties.setProperty("user", databaseLoginName);
- }
-
- @Override
- public Properties getConnectionProperties() {
- return properties;
- }
-
- @Override
- public String getConnectionUrl() {
- return connectionPrefix + ":" + databaseName;
- }
-
- @Override
- public String getDatabaseLoginName() {
- return databaseLoginName;
- }
-
- @Override
- public String getDatabaseName() {
- return databaseName;
- }
-
- @Override
- public String getDriver() {
- return driver;
- }
-
- @Override
- public String getId() {
- return id;
- }
-
- @Override
- public boolean isProduction() {
- return isProduction;
- }
-
- @Override
- public String toString() {
- return getId() + ": " + getConnectionUrl();
- }
-
- @Override
- public String getDatabaseHome() {
- return dbHome;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseInfoManager.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseInfoManager.java
deleted file mode 100644
index 164a0dd287..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseInfoManager.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.database.DatabaseInfoRegistry;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceReference;
-
-public final class DatabaseInfoManager {
-
- private DatabaseInfoManager() {
- //Utility Class
- }
-
- private static BundleContext getBundleContext() throws OseeCoreException {
- Bundle bundle = FrameworkUtil.getBundle(DatabaseInfoManager.class);
- Conditions.checkNotNull(bundle, "bundle");
- return bundle.getBundleContext();
- }
-
- private static <T> T getService(Class<T> clazz) throws OseeCoreException {
- BundleContext context = getBundleContext();
- Conditions.checkNotNull(context, "bundleContext");
- ServiceReference<T> reference = context.getServiceReference(clazz);
- Conditions.checkNotNull(reference, "serviceReference");
- T service = context.getService(reference);
- Conditions.checkNotNull(service, "service");
- return service;
- }
-
- public static IDatabaseInfo getDataStoreById(String id) throws OseeCoreException {
- DatabaseInfoRegistry service = getService(DatabaseInfoRegistry.class);
- return service.getDatabaseInfo(id);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java
deleted file mode 100644
index 3ebb6f6304..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-public final class DatabaseTransactions {
-
- private DatabaseTransactions() {
- // Utility class
- }
-
- public static void execute(IOseeDatabaseService dbService, OseeConnection connection, IDbTransactionWork dbWork) throws OseeCoreException {
- boolean initialAutoCommit = true;
- Exception saveException = null;
- try {
- OseeLog.logf(DatabaseTransactions.class, Level.FINEST, "Start Transaction: [%s]", dbWork.getName());
-
- initialAutoCommit = connection.getAutoCommit();
- connection.setAutoCommit(false);
- setConstraintChecking(dbService, connection, false);
- dbWork.handleTxWork(connection);
-
- connection.commit();
- OseeLog.logf(DatabaseTransactions.class, Level.FINEST, "End Transaction: [%s]", dbWork.getName());
- } catch (Exception ex) {
- saveException = ex;
- try {
- connection.rollback();
- } finally {
- try {
- connection.destroy();
- } finally {
- dbWork.handleTxException(ex);
- }
- }
- } finally {
- try {
- try {
- if (!connection.isClosed()) {
- try {
- setConstraintChecking(dbService, connection, true);
- } catch (OseeCoreException ex) {
- OseeLog.log(DatabaseTransactions.class, Level.WARNING, "Error while enabling constraint checking",
- ex);
- } finally {
- connection.setAutoCommit(initialAutoCommit);
- connection.close();
- }
- }
- } finally {
- dbWork.handleTxFinally();
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(DatabaseTransactions.class, Level.SEVERE, ex);
- if (saveException == null) {
- saveException = ex;
- }
- }
-
- if (saveException != null) {
- OseeExceptions.wrapAndThrow(saveException);
- }
- }
- }
-
- private static void setConstraintChecking(IOseeDatabaseService dbService, OseeConnection connection, boolean enable) throws OseeCoreException {
- String cmd = null;
- SupportedDatabase dbType = SupportedDatabase.getDatabaseType(connection.getMetaData());
- switch (dbType) {
- case h2:
- cmd = String.format("SET REFERENTIAL_INTEGRITY = %s", Boolean.toString(enable).toUpperCase());
- break;
- case hsql:
- cmd = String.format("SET DATABASE REFERENTIAL INTEGRITY %s", Boolean.toString(enable).toUpperCase());
- break;
- default:
- // NOTE: this must be a PreparedStatement to play correctly with DB Transactions.
- cmd = String.format("SET CONSTRAINTS ALL %s", enable ? "IMMEDIATE" : "DEFERRED");
- break;
- }
- dbService.runPreparedUpdate(connection, cmd);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IConnectionFactory.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IConnectionFactory.java
deleted file mode 100644
index 013ad8744b..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IConnectionFactory.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.sql.Connection;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-
-/**
- * @author Andrew M. Finkbeiner
- */
-public interface IConnectionFactory {
-
- Connection getConnection(IDatabaseInfo dbInfo) throws Exception;
-
- String getDriver();
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDatabaseInfoProvider.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDatabaseInfoProvider.java
deleted file mode 100644
index 194c264cd1..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDatabaseInfoProvider.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface IDatabaseInfoProvider {
-
- public IDatabaseInfo getDatabaseInfo() throws OseeDataStoreException;
-
- public int getPriority();
-
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbConnectionInformationContributor.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbConnectionInformationContributor.java
deleted file mode 100644
index 66ab251803..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbConnectionInformationContributor.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osee.framework.database.core;
-
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-
-/**
- * @author Andrew M. Finkbeiner
- */
-public interface IDbConnectionInformationContributor {
- IDatabaseInfo[] getDbInformation() throws Exception;
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbTransactionWork.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbTransactionWork.java
deleted file mode 100644
index e9d8d8db09..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IDbTransactionWork.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.osee.framework.database.core;
-
-import org.eclipse.osee.framework.jdk.core.type.Named;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- * @author Jeff C. Phillips
- */
-public interface IDbTransactionWork extends Named {
-
- /**
- * Provides the transaction's work implementation.
- */
- void handleTxWork(OseeConnection connection) throws OseeCoreException;
-
- /**
- * When an exception is detected during transaction processing, the exception is caught and passed to this method.
- * This convenience method is provided so child classes have access to the exception. <br/>
- * <b>Override to handle transaction exception</b>
- */
- void handleTxException(Exception ex);
-
- /**
- * This convenience method is provided in case child classes have a portion of code that needs to execute always at
- * the end of the transaction, regardless of exceptions. <br/>
- * <b>Override to add additional code to finally block</b>
- */
- void handleTxFinally() throws OseeCoreException;
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java
deleted file mode 100644
index 01894fc339..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.io.Closeable;
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.sql.Date;
-import java.sql.Time;
-import java.sql.Timestamp;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Jeff C. Phillips
- * @author Ryan D. Brooks
- */
-public interface IOseeStatement extends Closeable {
- int MAX_FETCH = 10000;
-
- void runPreparedQuery(String query, Object... data) throws OseeCoreException;
-
- /**
- * @param fetchSize hint as to the number of rows that should be fetched from the database at a time. will be limited
- * to 10,000
- */
- void runPreparedQuery(int fetchSize, String query, Object... data) throws OseeCoreException;
-
- /**
- * Invokes a stored procedure parameters of type SQL3DataType are registered as Out parameters and all others are set
- * as in parameters
- */
- void runCallableStatement(String query, Object... data) throws OseeCoreException;
-
- boolean next() throws OseeCoreException;
-
- /**
- * The application must call close when it is done using this object; however, it is safe to use this same object
- * multiple times, for example calling runPreparedQuery() repeatedly, without any intermediate calls to close
- */
- @Override
- void close();
-
- void cancel() throws OseeCoreException;
-
- InputStream getBinaryStream(String columnName) throws OseeCoreException;
-
- InputStream getAsciiStream(String columnName) throws OseeCoreException;
-
- String getString(String columnName) throws OseeCoreException;
-
- float getFloat(String columnName) throws OseeCoreException;
-
- long getLong(String columnName) throws OseeCoreException;
-
- int getInt(String columnName) throws OseeCoreException;
-
- boolean getBoolean(String columnName) throws OseeCoreException;
-
- Timestamp getTimestamp(String columnName) throws OseeCoreException;
-
- BigDecimal getBigDecimal(String name) throws OseeCoreException;
-
- Time getTime(String name) throws OseeCoreException;
-
- double getDouble(String columnName) throws OseeCoreException;
-
- Date getDate(String columnName) throws OseeCoreException;
-
- boolean wasNull() throws OseeCoreException;
-
- int getColumnCount() throws OseeCoreException;
-
- String getColumnName(int columnIndex) throws OseeCoreException;
-
- int getColumnType(int columnIndex) throws OseeCoreException;
-
- String getColumnTypeName(int columnIndex) throws OseeCoreException;
-
- Object getObject(int columnIndex) throws OseeCoreException;
-
- Object getObject(String columnName) throws OseeCoreException;
-
- /**
- * Returns the number of rows in the result set. Once this method returns the result set will be pointing to the last
- * row
- *
- * @return the number of rows in the result set
- */
- int getRowCount() throws OseeCoreException;
-
- boolean isNullable(int columnIndex) throws OseeCoreException;
-
- double getCallableDouble(int columnIndex) throws OseeCoreException;
-
- /**
- * should not be used by application code because it is less readable than using the column name
- */
- int getInt(int columnIndex) throws OseeCoreException;
-
- int getCallableInt(int columnIndex) throws OseeCoreException;
-
- /**
- * should not be used by application code because it is less readable than using the column name
- */
- long getLong(int columnIndex) throws OseeCoreException;
-
- /**
- * should not be used by application code because it is less readable than using the column name
- */
- String getString(int columnIndex) throws OseeCoreException;
-
- String getComplementSql() throws OseeCoreException;
-
- boolean isDatabaseType(SupportedDatabase type) throws OseeCoreException;
-
- void updateObject(String columnName, Object value) throws OseeCoreException;
-
- void updateRow() throws OseeCoreException;
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java
deleted file mode 100644
index 743b7c8965..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.sql.DatabaseMetaData;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-public abstract class OseeConnection {
-
- public abstract void close() throws OseeCoreException;
-
- public abstract boolean isClosed() throws OseeCoreException;
-
- public abstract boolean isStale();
-
- public abstract DatabaseMetaData getMetaData() throws OseeCoreException;
-
- protected abstract void setAutoCommit(boolean autoCommit) throws OseeCoreException;
-
- protected abstract boolean getAutoCommit() throws OseeCoreException;
-
- protected abstract void commit() throws OseeCoreException;
-
- protected abstract void rollback() throws OseeCoreException;
-
- protected abstract void destroy() throws OseeCoreException;
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java
deleted file mode 100644
index 5848702d3d..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.Date;
-import java.sql.Timestamp;
-import java.sql.Types;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.jdk.core.type.IVariantData;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.VariantData;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-
-/**
- * @author Roberto E. Escobar
- */
-public class ResultSetProcessor {
- public static IVariantData parse(IOseeStatement chStmt) throws OseeCoreException {
- IVariantData toReturn = new VariantData();
- int numberOfColumns = chStmt.getColumnCount() + 1;
- for (int index = 1; index < numberOfColumns; index++) {
- int columnIndex = index;
- int type = chStmt.getColumnType(columnIndex);
- String name = chStmt.getColumnName(columnIndex);
- // Store name - all upper case
- String upperCasedName = name.toUpperCase();
- switch (type) {
- case Types.CLOB:
- case Types.BINARY:
- InputStream inputStream = chStmt.getAsciiStream(name);
- toReturn.put(upperCasedName, streamToByteArray(inputStream));
- break;
- case Types.BLOB:
- InputStream blobStream = chStmt.getBinaryStream(name);
- toReturn.put(upperCasedName, streamToByteArray(blobStream));
- break;
- case Types.TIMESTAMP:
- Timestamp timeStamp = chStmt.getTimestamp(name);
- if (timeStamp != null) {
- toReturn.put(upperCasedName, timeStamp.getTime());
- }
- break;
- case Types.DATE:
- Date date = chStmt.getDate(name);
- if (date != null) {
- toReturn.put(upperCasedName, date.getTime());
- }
- break;
- default:
- String value = chStmt.getString(name);
- if (Strings.isValid(value) != false) {
- value = value.trim();
- }
- toReturn.put(upperCasedName, chStmt.getString(name));
- break;
- }
- }
- return toReturn;
- }
-
- private static byte[] streamToByteArray(InputStream inputStream) throws OseeCoreException {
- byte[] toReturn = new byte[0];
- if (inputStream != null) {
- try {
- toReturn = Lib.inputStreamToBytes(inputStream);
- } catch (IOException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
- return toReturn;
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SQL3DataType.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SQL3DataType.java
deleted file mode 100644
index 748cba767a..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SQL3DataType.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.math.BigInteger;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Date;
-import java.util.HashMap;
-
-/**
- * @author Roberto E. Escobar
- */
-public enum SQL3DataType {
-
- BIT(java.sql.Types.BIT, Boolean.class),
- TINYINT(java.sql.Types.TINYINT, Integer.class),
- SMALLINT(java.sql.Types.SMALLINT, Integer.class),
- INTEGER(java.sql.Types.INTEGER, Integer.class),
- BIGINT(java.sql.Types.BIGINT, BigInteger.class),
- FLOAT(java.sql.Types.FLOAT, Float.class),
- REAL(java.sql.Types.REAL, Double.class),
- DOUBLE(java.sql.Types.DOUBLE, Double.class),
- NUMERIC(java.sql.Types.NUMERIC, Double.class),
- DECIMAL(java.sql.Types.DECIMAL, Integer.class),
- CHAR(java.sql.Types.CHAR, Character.class),
- VARCHAR(java.sql.Types.VARCHAR, String.class),
- LONGVARCHAR(java.sql.Types.LONGVARCHAR, String.class),
- DATE(java.sql.Types.DATE, Date.class),
- TIME(java.sql.Types.TIME, Time.class),
- TIMESTAMP(java.sql.Types.TIMESTAMP, Timestamp.class),
- BINARY(java.sql.Types.BINARY, Object.class),
- VARBINARY(java.sql.Types.VARBINARY, Object.class),
- LONGVARBINARY(java.sql.Types.LONGVARBINARY, Object.class),
- NULL(java.sql.Types.NULL, Object.class),
- OTHER(java.sql.Types.OTHER, Object.class),
- JAVA_OBJECT(java.sql.Types.JAVA_OBJECT, Object.class),
- DISTINCT(java.sql.Types.DISTINCT, Object.class),
- STRUCT(java.sql.Types.STRUCT, Object.class),
- ARRAY(java.sql.Types.ARRAY, Object.class),
- BLOB(java.sql.Types.BLOB, Object.class),
- CLOB(java.sql.Types.CLOB, Object.class),
- REF(java.sql.Types.REF, Object.class),
- DATALINK(java.sql.Types.DATALINK, Object.class),
- BOOLEAN(java.sql.Types.BOOLEAN, Boolean.class);
-
- private Class<?> javaClassEquivalent;
- private int sqlTypeNumber;
-
- private static HashMap<Integer, SQL3DataType> typeToEnum = new HashMap<Integer, SQL3DataType>();
-
- private SQL3DataType(int sqlTypeNumber, Class<?> classEquiv) {
- this.javaClassEquivalent = classEquiv;
- this.sqlTypeNumber = sqlTypeNumber;
- }
-
- public int getSQLTypeNumber() {
- return sqlTypeNumber;
- }
-
- public Class<?> getJavaEquivalentClass() {
- return javaClassEquivalent;
- }
-
- public static SQL3DataType get(int type) {
- if (typeToEnum.isEmpty()) {
- for (SQL3DataType enumType : SQL3DataType.values()) {
- typeToEnum.put(enumType.sqlTypeNumber, enumType);
- }
- }
- return typeToEnum.get(type);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
deleted file mode 100644
index ba46429292..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.core;
-
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-public enum SupportedDatabase {
- h2,
- oracle,
- foxpro,
- mysql,
- postgresql,
- hsql;
-
- public static String getDatabaseName(DatabaseMetaData metaData) throws OseeCoreException {
- String name = "";
- try {
- name = metaData.getDatabaseProductName();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- return name;
- }
-
- public static SupportedDatabase getDatabaseTypeAllowNull(DatabaseMetaData metaData) throws OseeCoreException {
- String dbName = getDatabaseName(metaData);
- return getDatabaseTypeAllowNull(dbName);
- }
-
- private static SupportedDatabase getDatabaseTypeAllowNull(String dbName) {
- SupportedDatabase toReturn = null;
- String lowerCaseName = dbName.toLowerCase();
- if (lowerCaseName.contains(h2.toString())) {
- toReturn = h2;
- } else if (lowerCaseName.contains(oracle.toString())) {
- toReturn = oracle;
- } else if (lowerCaseName.contains(foxpro.toString())) {
- toReturn = foxpro;
- } else if (lowerCaseName.contains(mysql.toString())) {
- toReturn = mysql;
- } else if (lowerCaseName.contains(postgresql.toString())) {
- toReturn = postgresql;
- } else if (lowerCaseName.contains(hsql.toString())) {
- toReturn = hsql;
- }
- return toReturn;
- }
-
- public static SupportedDatabase getDatabaseType(DatabaseMetaData metaData) throws OseeCoreException {
- String dbName = getDatabaseName(metaData);
- SupportedDatabase toReturn = getDatabaseTypeAllowNull(dbName);
- if (toReturn == null) {
- throw new OseeDataStoreException("Unsupported database type [%s] ", dbName);
- }
- return toReturn;
- }
-
- public static boolean isDatabaseType(DatabaseMetaData metaData, SupportedDatabase... dbTypes) throws OseeCoreException {
- boolean result = false;
- SupportedDatabase supportedType = getDatabaseTypeAllowNull(metaData);
- for (SupportedDatabase dbType : dbTypes) {
- if (dbType == supportedType) {
- result = true;
- break;
- }
- }
- return result;
- }
-
- public static boolean areHintsSupported(DatabaseMetaData metaData) throws OseeCoreException {
- try {
- if (SupportedDatabase.isDatabaseType(metaData, oracle)) {
- return metaData.getDatabaseMajorVersion() > 10;
- }
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- return false;
- }
-
- public static String getRegularExpMatchSql(DatabaseMetaData metaData) throws OseeCoreException {
- String pattern = "";
- SupportedDatabase db = getDatabaseType(metaData);
- switch (db) {
- case oracle:
- pattern = "REGEXP_LIKE (%s, %s)";
- break;
- case postgresql:
- case hsql:
- pattern = "REGEXP_MATCHES (%s, %s)";
- break;
- case mysql:
- pattern = "(%s REGEXP %s)";
- break;
- default:
- throw new OseeArgumentException("RegExp matching is not supported for db [%s]", db);
- }
- return pattern;
- }
-
- public static String getRecursiveWithSql(DatabaseMetaData metaData) throws OseeCoreException {
- return isDatabaseType(metaData, oracle) ? "" : "RECURSIVE";
- }
-
- public static String getComplementSql(DatabaseMetaData metaData) throws OseeCoreException {
- return isDatabaseType(metaData, oracle) ? "MINUS" : "EXCEPT";
- }
-
- public static String getValidationSql(DatabaseMetaData metaData) throws OseeCoreException {
- String validation;
- if (isDatabaseType(metaData, oracle, h2)) {
- validation = "select 1 from dual";
- } else {
- validation = "select 1";
- }
- return validation;
-
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoRegistryImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoRegistryImpl.java
deleted file mode 100644
index f467c4b8e5..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/DatabaseInfoRegistryImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.DatabaseInfoRegistry;
-import org.eclipse.osee.framework.database.core.IDbConnectionInformationContributor;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
-import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Roberto E. Escobar
- */
-public class DatabaseInfoRegistryImpl implements DatabaseInfoRegistry {
-
- private final List<IDbConnectionInformationContributor> contributors =
- new CopyOnWriteArrayList<IDbConnectionInformationContributor>();
-
- private IDatabaseInfo selectedDbInfo;
-
- public void addConnectionInfo(IDbConnectionInformationContributor contributor) {
- contributors.add(contributor);
- }
-
- public void removeConnectionInfo(IDbConnectionInformationContributor contributor) {
- contributors.remove(contributor);
- }
-
- @Override
- public IDatabaseInfo getDatabaseInfo(String serviceId) throws OseeCoreException {
- Conditions.checkNotNull(serviceId, "Service Id to find");
- return findDatabaseInfo(serviceId);
- }
-
- @Override
- public IDatabaseInfo getSelectedDatabaseInfo() throws OseeDataStoreException {
- if (selectedDbInfo == null) {
- String dbConnectionId = OseeProperties.getOseeDbConnectionId();
- if (Strings.isValid(dbConnectionId)) {
- selectedDbInfo = findDatabaseInfo(dbConnectionId);
- } else {
- throw new IllegalStateException("No DB connection information provided");
- }
- }
- return selectedDbInfo;
- }
-
- private IDatabaseInfo findDatabaseInfo(String serverIdToFind) throws OseeDataStoreException {
- Set<String> infoKeys = new HashSet<String>();
- for (IDbConnectionInformationContributor contributor : contributors) {
- try {
- for (IDatabaseInfo databaseInfo : contributor.getDbInformation()) {
- String key = databaseInfo.getId();
- infoKeys.add(key);
- if (serverIdToFind.equals(key)) {
- return databaseInfo;
- }
- }
- } catch (Exception ex) {
- OseeLog.log(DatabaseInfoRegistryImpl.class, Level.SEVERE, ex);
- }
- }
- throw new OseeDataStoreException(
- "DB connection information was not found for: [%s]\n Available connection ids are: [%s]\n", serverIdToFind,
- infoKeys);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/ServiceUtil.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/ServiceUtil.java
deleted file mode 100644
index 1c62c551b7..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/ServiceUtil.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal;
-
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceReference;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class ServiceUtil {
-
- public static final String PLUGIN_ID = "org.eclipse.osee.framework.database";
-
- private ServiceUtil() {
- // Utility class
- }
-
- private static BundleContext getBundleContext() throws OseeCoreException {
- Bundle bundle = FrameworkUtil.getBundle(ServiceUtil.class);
- Conditions.checkNotNull(bundle, "bundle");
- return bundle.getBundleContext();
- }
-
- private static <T> T getService(Class<T> clazz) throws OseeCoreException {
- BundleContext context = getBundleContext();
- Conditions.checkNotNull(context, "bundleContext");
- ServiceReference<T> reference = context.getServiceReference(clazz);
- Conditions.checkNotNull(reference, "serviceReference");
- T service = context.getService(reference);
- Conditions.checkNotNull(service, "service");
- return service;
- }
-
- public static IOseeDatabaseService getDatabaseService() throws OseeDataStoreException {
- try {
- return getService(IOseeDatabaseService.class);
- } catch (OseeCoreException ex) {
- throw new OseeDataStoreException(ex);
- }
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/UriDbConnectionInfo.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/UriDbConnectionInfo.java
deleted file mode 100644
index ec087c3300..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/UriDbConnectionInfo.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal;
-
-import java.io.File;
-import java.net.URI;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.database.AbstractDatabaseInfoContributor;
-import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Roberto E. Escobar
- */
-public class UriDbConnectionInfo extends AbstractDatabaseInfoContributor {
-
- @Override
- public IDatabaseInfo[] getDbInformation() throws Exception {
- String uri = OseeProperties.getOseeConnectionInfoUri();
- if (Strings.isValid(uri)) {
- OseeLog.logf(UriDbConnectionInfo.class, Level.INFO, "Loading connection info from: [%s]", uri);
- URI connectionFile = null;
- if (!uri.contains("://")) {
- connectionFile = new File(uri).toURI();
- } else {
- connectionFile = new URI(uri);
- }
- return readFromXml(connectionFile.toURL().openStream());
- }
- return new IDatabaseInfo[0];
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/BaseOseeConnection.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/BaseOseeConnection.java
deleted file mode 100644
index a82da66161..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/BaseOseeConnection.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.sql.CallableStatement;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public class BaseOseeConnection extends OseeConnection {
-
- private static final int timeout = 60000;
- private final Connection conn;
-
- public BaseOseeConnection(Connection conn) {
- super();
- this.conn = conn;
- }
-
- @Override
- public boolean isStale() {
- boolean result = true;
- try {
- result = !conn.isValid(timeout);
- } catch (SQLException ex) {
- // do nothing
- }
- return result;
- }
-
- @Override
- public void close() throws OseeCoreException {
- destroy();
- }
-
- @Override
- public boolean isClosed() throws OseeCoreException {
- try {
- return conn.isClosed();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return false; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public DatabaseMetaData getMetaData() throws OseeCoreException {
- try {
- return conn.getMetaData();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
- return conn.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- PreparedStatement prepareStatement(String sql) throws SQLException {
- return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
- }
-
- CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
- return conn.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- @Override
- protected void destroy() throws OseeCoreException {
- try {
- conn.close();
- } catch (SQLException ex) {
- // Do Nothing - OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- @Override
- protected void setAutoCommit(boolean autoCommit) throws OseeCoreException {
- try {
- conn.setAutoCommit(autoCommit);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- @Override
- protected boolean getAutoCommit() throws OseeCoreException {
- try {
- return conn.getAutoCommit();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return false; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- protected void commit() throws OseeCoreException {
- try {
- conn.commit();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- @Override
- protected void rollback() throws OseeCoreException {
- try {
- conn.rollback();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionProvider.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionProvider.java
deleted file mode 100644
index f198562584..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/ConnectionProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.util.Map;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public interface ConnectionProvider {
-
- Map<String, String> getStatistics() throws OseeCoreException;
-
- IDatabaseInfo getDefaultDatabaseInfo() throws OseeCoreException;
-
- BaseOseeConnection getConnection() throws OseeCoreException;
-
- BaseOseeConnection getConnection(IDatabaseInfo databaseInfo) throws OseeCoreException;
-
- void dispose() throws OseeCoreException;
-
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
deleted file mode 100644
index a390722901..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.Map;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.DatabaseService;
-import org.eclipse.osee.framework.database.IQueryProcessor;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Roberto E. Escobar
- */
-public class OseeDatabaseServiceImpl implements DatabaseService {
-
- private final ConnectionProvider connectionProvider;
-
- public OseeDatabaseServiceImpl(ConnectionProvider connectionProvider) {
- super();
- this.connectionProvider = connectionProvider;
- }
-
- @Override
- public OseeConnection getConnection() throws OseeCoreException {
- return connectionProvider.getConnection();
- }
-
- @Override
- public OseeConnection getConnection(IDatabaseInfo databaseInfo) throws OseeCoreException {
- return connectionProvider.getConnection(databaseInfo);
- }
-
- @Override
- public IOseeStatement getStatement() {
- return new OseeStatementImpl(connectionProvider);
- }
-
- @Override
- public IOseeStatement getStatement(OseeConnection connection) {
- return new OseeStatementImpl(connectionProvider, (BaseOseeConnection) connection);
- }
-
- @Override
- public IOseeStatement getStatement(OseeConnection connection, boolean autoClose) {
- return new OseeStatementImpl(connectionProvider, (BaseOseeConnection) connection, autoClose);
- }
-
- @Override
- public IOseeStatement getStatement(int resultSetType, int resultSetConcurrency) {
- return new OseeStatementImpl(connectionProvider, resultSetType, resultSetConcurrency);
- }
-
- @Override
- public <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeCoreException {
- if (connection == null) {
- return runPreparedUpdate(query, data);
- }
- PreparedStatement preparedStatement = null;
- int updateCount = 0;
- try {
- preparedStatement = ((BaseOseeConnection) connection).prepareStatement(query);
- StatementUtil.populateValuesForPreparedStatement(preparedStatement, data);
- updateCount = preparedStatement.executeUpdate();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- } finally {
- StatementUtil.close(preparedStatement);
- }
- return updateCount;
- }
-
- @Override
- public <O extends Object> int runBatchUpdate(OseeConnection connection, String query, Iterable<O[]> dataList) throws OseeCoreException {
- if (connection == null) {
- return runBatchUpdate(query, dataList);
- }
- int returnCount = 0;
- PreparedStatement preparedStatement = null;
- try {
- preparedStatement = ((BaseOseeConnection) connection).prepareStatement(query);
- boolean needExecute = false;
- int count = 0;
- for (Object[] data : dataList) {
- count++;
- StatementUtil.populateValuesForPreparedStatement(preparedStatement, data);
- preparedStatement.addBatch();
- preparedStatement.clearParameters();
- needExecute = true;
- if (count > 2000) {
- int[] updates = preparedStatement.executeBatch();
- returnCount += StatementUtil.calculateBatchUpdateResults(updates);
- count = 0;
- needExecute = false;
- }
- }
- if (needExecute) {
- int[] updates = preparedStatement.executeBatch();
- returnCount += StatementUtil.calculateBatchUpdateResults(updates);
- }
-
- } catch (SQLException ex) {
- SQLException exlist;
- if ((exlist = ex.getNextException()) != null) {
- OseeLog.log(OseeDatabaseServiceImpl.class, Level.SEVERE, "This is the nested exception", exlist);
- }
- throw new OseeCoreException(ex, "sql update failed: \n%s\n%s", query,
- StatementUtil.getBatchErrorMessage(dataList));
- } finally {
- StatementUtil.close(preparedStatement);
- }
- return returnCount;
- }
-
- @Override
- public <O> int runBatchUpdate(String query, Iterable<O[]> dataList) throws OseeCoreException {
- OseeConnection connection = getConnection();
- try {
- return runBatchUpdate(connection, query, dataList);
- } finally {
- connection.close();
- }
- }
-
- @Override
- public <O> int runPreparedUpdate(String query, O... data) throws OseeCoreException {
- OseeConnection connection = getConnection();
- try {
- return runPreparedUpdate(connection, query, data);
- } finally {
- connection.close();
- }
- }
-
- @Override
- public <T, O extends Object> T runPreparedQueryFetchObject(T defaultValue, String query, O... data) throws OseeCoreException {
- return runPreparedQueryFetchObject(getStatement(), defaultValue, query, data);
- }
-
- @Override
- public <T, O extends Object> T runPreparedQueryFetchObject(OseeConnection connection, T defaultValue, String query, O... data) throws OseeCoreException {
- return runPreparedQueryFetchObject(getStatement(connection), defaultValue, query, data);
- }
-
- @SuppressWarnings("unchecked")
- private <T, O extends Object> T runPreparedQueryFetchObject(IOseeStatement chStmt, T defaultValue, String query, O... data) throws OseeCoreException {
- Conditions.checkNotNull(defaultValue, "default value");
- try {
- chStmt.runPreparedQuery(1, query, data);
- if (chStmt.next()) {
- Object toReturn = null;
- Class<?> classValue = defaultValue.getClass();
- if (classValue.isAssignableFrom(Integer.class)) {
- toReturn = chStmt.getInt(1);
- } else if (classValue.isAssignableFrom(String.class)) {
- toReturn = chStmt.getString(1);
- } else if (classValue.isAssignableFrom(Long.class)) {
- toReturn = chStmt.getLong(1);
- } else if (classValue.isAssignableFrom(Boolean.class)) {
- String value = chStmt.getObject(1).toString();
- toReturn = Boolean.parseBoolean(value);
- } else {
- toReturn = chStmt.getObject(1);
- }
- return (T) toReturn;
- }
- return defaultValue;
- } finally {
- chStmt.close();
- }
- }
-
- @Override
- public boolean isProduction() throws OseeCoreException {
- return connectionProvider.getDefaultDatabaseInfo().isProduction();
- }
-
- @Override
- public Map<String, String> getStatistics() throws OseeCoreException {
- return connectionProvider.getStatistics();
- }
-
- @Override
- public void runQuery(IQueryProcessor processor, String query, Object... data) {
- IOseeStatement chStmt = getStatement();
- try {
- chStmt.runPreparedQuery(query, data);
- while (chStmt.next()) {
- processor.processNext(chStmt);
- }
- } finally {
- chStmt.close();
- }
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceProxy.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceProxy.java
deleted file mode 100644
index f00ce3eb3d..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceProxy.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.DatabaseService;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.IQueryProcessor;
-import org.eclipse.osee.framework.database.core.IConnectionFactory;
-import org.eclipse.osee.framework.database.core.IDatabaseInfoProvider;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Roberto E. Escobar
- */
-public class OseeDatabaseServiceProxy implements IOseeDatabaseService {
-
- private final Map<String, IConnectionFactory> factories = new ConcurrentHashMap<String, IConnectionFactory>();
-
- private ConnectionProvider connectionProvider;
- private DatabaseService databaseService;
- private OseeSequenceImpl oseeSequence;
-
- private IDatabaseInfoProvider databaseInfoProvider;
-
- public void addConnectionFactory(IConnectionFactory connectionFactory) {
- factories.put(connectionFactory.getDriver(), connectionFactory);
- }
-
- public void removeConnectionFactory(IConnectionFactory connectionFactory) {
- factories.remove(connectionFactory.getDriver());
- }
-
- public void setDatabaseInfoProvider(IDatabaseInfoProvider provider) {
- databaseInfoProvider = provider;
- }
-
- private ConnectionProvider createConnectionProvider() {
- PoolFactory poolFactory = new PoolFactory(factories);
- return new PooledConnectionProvider(databaseInfoProvider, poolFactory);
- }
-
- public void start() {
- connectionProvider = createConnectionProvider();
- databaseService = new OseeDatabaseServiceImpl(connectionProvider);
- oseeSequence = new OseeSequenceImpl(databaseService);
- }
-
- public void stop() {
- if (connectionProvider != null) {
- try {
- connectionProvider.dispose();
- } catch (OseeCoreException ex) {
- OseeLog.log(OseeDatabaseServiceProxy.class, Level.WARNING, ex);
- }
- connectionProvider = null;
- }
- oseeSequence = null;
- databaseService = null;
- }
-
- private DatabaseService getDatabaseService() {
- return databaseService;
- }
-
- private void checkInitialized() throws OseeDataStoreException {
- if (databaseService == null) {
- throw new OseeDataStoreException("Error initializing database service");
- }
- }
-
- @Override
- public IOseeStatement getStatement() throws OseeDataStoreException {
- checkInitialized();
- return getDatabaseService().getStatement();
- }
-
- @Override
- public IOseeStatement getStatement(OseeConnection connection) throws OseeDataStoreException {
- checkInitialized();
- return getDatabaseService().getStatement(connection);
- }
-
- @Override
- public IOseeStatement getStatement(OseeConnection connection, boolean autoClose) throws OseeDataStoreException {
- checkInitialized();
- return getDatabaseService().getStatement(connection, autoClose);
- }
-
- @Override
- public IOseeStatement getStatement(int resultSetType, int resultSetConcurrency) throws OseeDataStoreException {
- checkInitialized();
- return getDatabaseService().getStatement(resultSetType, resultSetConcurrency);
- }
-
- @Override
- public OseeConnection getConnection() throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().getConnection();
- }
-
- @Override
- public OseeConnection getConnection(IDatabaseInfo info) throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().getConnection(info);
- }
-
- @Override
- public <O> int runBatchUpdate(String query, Iterable<O[]> dataList) throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().runBatchUpdate(query, dataList);
- }
-
- @Override
- public <O> int runPreparedUpdate(String query, O... data) throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().runPreparedUpdate(query, data);
- }
-
- @Override
- public <O> int runBatchUpdate(OseeConnection connection, String query, Iterable<O[]> dataList) throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().runBatchUpdate(connection, query, dataList);
- }
-
- @Override
- public <O> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().runPreparedUpdate(connection, query, data);
- }
-
- @Override
- public <T, O> T runPreparedQueryFetchObject(T defaultValue, String query, O... data) throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().runPreparedQueryFetchObject(defaultValue, query, data);
- }
-
- @Override
- public <T, O> T runPreparedQueryFetchObject(OseeConnection connection, T defaultValue, String query, O... data) throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().runPreparedQueryFetchObject(connection, defaultValue, query, data);
- }
-
- @Override
- public boolean isProduction() throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().isProduction();
- }
-
- @Override
- public Map<String, String> getStatistics() throws OseeCoreException {
- checkInitialized();
- return getDatabaseService().getStatistics();
- }
-
- @Override
- public void runQuery(IQueryProcessor processor, String query, Object... data) {
- checkInitialized();
- getDatabaseService().runQuery(processor, query, data);
- }
-
- @Override
- public long getNextSequence(String sequenceName) {
- return oseeSequence.getNextSequence(sequenceName);
- }
-
- @Override
- public void invalidateSequences() {
- oseeSequence.clear();
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java
deleted file mode 100644
index b31eac5443..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.util.HashMap;
-import org.eclipse.osee.framework.database.DatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Ryan D. Brooks
- */
-public class OseeSequenceImpl {
- private static final String TRANSACTION_ID_SEQ = "SKYNET_TRANSACTION_ID_SEQ";
-
- private static final String QUERY_SEQUENCE = "SELECT last_sequence FROM osee_sequence WHERE sequence_name = ?";
- private static final String INSERT_SEQUENCE =
- "INSERT INTO osee_sequence (last_sequence, sequence_name) VALUES (?,?)";
- private static final String UPDATE_SEQUENCE =
- "UPDATE osee_sequence SET last_sequence = ? WHERE sequence_name = ? AND last_sequence = ?";
-
- private final HashMap<String, SequenceRange> sequences = new HashMap<String, SequenceRange>(30);
-
- private final DatabaseService service;
-
- public OseeSequenceImpl(DatabaseService service) {
- this.service = service;
- }
-
- private DatabaseService getDatabase() {
- return service;
- }
-
- private SequenceRange getRange(String sequenceName) {
- SequenceRange range = sequences.get(sequenceName);
- if (range == null) {
- // do this to keep transaction id's sequential in the face of concurrent transaction by multiple users
- range = new SequenceRange(!sequenceName.equals(TRANSACTION_ID_SEQ));
- sequences.put(sequenceName, range);
- }
- return range;
- }
-
- public synchronized void clear() {
- sequences.clear();
- }
-
- @SuppressWarnings("unchecked")
- public synchronized long getNextSequence(String sequenceName) throws OseeCoreException {
- SequenceRange range = getRange(sequenceName);
- if (range.lastAvailable == 0) {
- long lastValue = -1L;
- boolean gotSequence = false;
- OseeConnection connection = getDatabase().getConnection();
- try {
- while (!gotSequence) {
- long currentValue =
- getDatabase().runPreparedQueryFetchObject(connection, lastValue, QUERY_SEQUENCE, sequenceName);
- if (currentValue == lastValue) {
- internalInitializeSequence(sequenceName);
- lastValue = 0;
- } else {
- lastValue = currentValue;
- }
- gotSequence =
- getDatabase().runPreparedUpdate(connection, UPDATE_SEQUENCE, lastValue + range.prefetchSize,
- sequenceName, lastValue) == 1;
- }
- range.updateRange(lastValue);
- } finally {
- connection.close();
- }
- }
- range.currentValue++;
- if (range.currentValue == range.lastAvailable) {
- range.lastAvailable = 0;
- }
- return range.currentValue;
- }
-
- @SuppressWarnings("unchecked")
- private void internalInitializeSequence(String sequenceName) throws OseeCoreException {
- SequenceRange range = getRange(sequenceName);
- range.lastAvailable = 0;
- getDatabase().runPreparedUpdate(INSERT_SEQUENCE, 0, sequenceName);
- }
-
- private static final class SequenceRange {
- private long currentValue;
- private long lastAvailable;
- private int prefetchSize;
- private final boolean aggressiveFetch;
-
- public SequenceRange(boolean aggressiveFetch) {
- super();
- this.prefetchSize = 1;
- this.aggressiveFetch = aggressiveFetch;
- }
-
- public void updateRange(long lastValue) {
- currentValue = lastValue;
- lastAvailable = lastValue + prefetchSize;
-
- if (aggressiveFetch) {
- prefetchSize *= 2; // next time grab twice as many
- }
- }
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java
deleted file mode 100644
index d255413de6..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.sql.CallableStatement;
-import java.sql.Date;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
-import org.eclipse.osee.framework.database.core.SupportedDatabase;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Jeff C. Phillips
- * @author Ryan D. Brooks
- */
-public final class OseeStatementImpl implements IOseeStatement {
- private ResultSet rSet;
- private PreparedStatement preparedStatement;
- private CallableStatement callableStatement;
- private BaseOseeConnection connection;
- private final boolean autoClose;
- private final ConnectionProvider connectionPool;
- private final int resultSetType;
- private final int resultSetConcurrency;
-
- public OseeStatementImpl(ConnectionProvider connectionPool, BaseOseeConnection connection) {
- this(connectionPool, connection, connection == null);
- }
-
- public OseeStatementImpl(ConnectionProvider connectionPool, BaseOseeConnection connection, boolean autoClose) {
- this(connectionPool, connection, autoClose, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
- }
-
- public OseeStatementImpl(ConnectionProvider connectionPool) {
- this(connectionPool, null);
- }
-
- public OseeStatementImpl(ConnectionProvider connectionPool, int resultSetType, int resultSetConcurrency) {
- this(connectionPool, null, true, resultSetType, resultSetConcurrency);
- }
-
- public OseeStatementImpl(ConnectionProvider connectionPool, BaseOseeConnection connection, boolean autoClose, int resultSetType, int resultSetConcurrency) {
- this.autoClose = autoClose;
- this.connection = connection;
- this.connectionPool = connectionPool;
- this.resultSetType = resultSetType;
- this.resultSetConcurrency = resultSetConcurrency;
- }
-
- @Override
- public void runPreparedQuery(String query, Object... data) throws OseeCoreException {
- runPreparedQuery(0, query, data);
- }
-
- /**
- * @param fetchSize hint as to the number of rows that should be fetched from the database at a time. will be limited
- * to 10,000
- */
- @Override
- public void runPreparedQuery(int fetchSize, String query, Object... data) throws OseeCoreException {
-
- try {
- allowReuse();
- preparedStatement = connection.prepareStatement(query, resultSetType, resultSetConcurrency);
- preparedStatement.setFetchSize(Math.min(fetchSize, 10000));
- StatementUtil.populateValuesForPreparedStatement(preparedStatement, data);
-
- rSet = preparedStatement.executeQuery();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- /**
- * Invokes a stored procedure parameters of type SQL3DataType are registered as Out parameters and all others are set
- * as in parameters
- */
- @Override
- public void runCallableStatement(String query, Object... data) throws OseeCoreException {
- try {
- allowReuse();
- callableStatement = connection.prepareCall(query, resultSetType, resultSetConcurrency);
-
- for (int index = 0; index < data.length; index++) {
- if (data[index] instanceof SQL3DataType) {
- callableStatement.registerOutParameter(index + 1, ((SQL3DataType) data[index]).getSQLTypeNumber());
- }
- }
- StatementUtil.populateValuesForPreparedStatement(callableStatement, data);
- if (callableStatement.execute()) {
- rSet = callableStatement.getResultSet();
- }
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- @Override
- public boolean next() throws OseeCoreException {
- if (rSet != null) {
- try {
- return rSet.next();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
- return false;
- }
-
- /**
- * The application must call close when it is done using this object; however, it is safe to use this same object
- * multiple times, for example calling runPreparedQuery() repeatedly, without any intermediate calls to close
- */
- @Override
- public void close() {
- closePreviousResources();
- if (autoClose && connection != null) {
- try {
- if (!connection.isClosed()) {
- connection.close();
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(OseeStatementImpl.class, Level.SEVERE, ex);
- } finally {
- connection = null;// this allows for multiple calls to runPreparedQuery to have an open connection
- }
- }
- }
-
- /**
- * allows for multiple uses of this object to have an open connection
- */
- private void allowReuse() throws OseeCoreException {
- closePreviousResources();
- if (connection == null) {
- connection = connectionPool.getConnection();
- }
- }
-
- private void closePreviousResources() {
- try {
- // rSet.isClosed is not supported by some JDBC drivers so don't check it
- if (rSet != null) {
- rSet.close();
- }
- } catch (SQLException ex) {
- OseeLog.log(OseeStatementImpl.class, Level.SEVERE, ex);
- } finally {
- rSet = null;
- }
- try {
- if (preparedStatement != null && !preparedStatement.isClosed()) {
- preparedStatement.close();
- }
- } catch (SQLException ex) {
- OseeLog.log(OseeStatementImpl.class, Level.SEVERE, ex);
- } finally {
- preparedStatement = null;
- }
-
- try {
- if (callableStatement != null && !callableStatement.isClosed()) {
- callableStatement.close();
- }
- } catch (SQLException ex) {
- OseeLog.log(OseeStatementImpl.class, Level.SEVERE, ex);
- } finally {
- callableStatement = null;
- }
- }
-
- @Override
- public InputStream getBinaryStream(String columnName) throws OseeCoreException {
- try {
- return rSet.getBinaryStream(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public InputStream getAsciiStream(String columnName) throws OseeCoreException {
- try {
- return rSet.getAsciiStream(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public String getString(String columnName) throws OseeCoreException {
- try {
- return rSet.getString(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public float getFloat(String columnName) throws OseeCoreException {
- try {
- return rSet.getFloat(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0.0f; // unreachable since wrapAndThrow() always throws an exceptions
- }
- }
-
- @Override
- public long getLong(String columnName) throws OseeCoreException {
- try {
- return rSet.getLong(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public int getInt(String columnName) throws OseeCoreException {
- try {
- return rSet.getInt(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public boolean getBoolean(String columnName) throws OseeCoreException {
- try {
- return rSet.getBoolean(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return false; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public int getInt(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getInt(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public int getCallableInt(int columnIndex) throws OseeCoreException {
- try {
- return callableStatement.getInt(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public double getCallableDouble(int columnIndex) throws OseeCoreException {
- try {
- return callableStatement.getDouble(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- /**
- * should not be used by application code because it is less readable than using the column name
- */
- @Override
- public long getLong(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getLong(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- /**
- * should not be used by application code because it is less readable than using the column name
- */
- @Override
- public String getString(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getString(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public Timestamp getTimestamp(String columnName) throws OseeCoreException {
- try {
- return rSet.getTimestamp(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public BigDecimal getBigDecimal(String name) throws OseeCoreException {
- try {
- return rSet.getBigDecimal(name);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public Time getTime(String name) throws OseeCoreException {
- try {
- return rSet.getTime(name);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public double getDouble(String columnName) throws OseeCoreException {
- try {
- return rSet.getDouble(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public Date getDate(String columnName) throws OseeCoreException {
- try {
- return rSet.getDate(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public boolean wasNull() throws OseeCoreException {
- try {
- return rSet.wasNull();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return false; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public int getColumnCount() throws OseeCoreException {
- try {
- return rSet.getMetaData().getColumnCount();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public String getColumnName(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getMetaData().getColumnName(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public int getColumnType(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getMetaData().getColumnType(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public String getColumnTypeName(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getMetaData().getColumnTypeName(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public Object getObject(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getObject(columnIndex);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public Object getObject(String columnName) throws OseeCoreException {
- try {
- return rSet.getObject(columnName);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return null; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- /**
- * Returns the number of rows in the result set. Once this method returns the result set will be pointing to the last
- * row
- *
- * @return the number of rows in the result set
- */
- @Override
- public int getRowCount() throws OseeCoreException {
- try {
- rSet.last();
- return rSet.getRow();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return 0; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public boolean isNullable(int columnIndex) throws OseeCoreException {
- try {
- return rSet.getMetaData().isNullable(columnIndex) == ResultSetMetaData.columnNullable;
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- return false; // unreachable since wrapAndThrow() always throws an exception
- }
- }
-
- @Override
- public String getComplementSql() throws OseeCoreException {
- allowReuse();
- return SupportedDatabase.getComplementSql(connection.getMetaData());
- }
-
- @Override
- public boolean isDatabaseType(SupportedDatabase type) throws OseeCoreException {
- allowReuse();
- return SupportedDatabase.isDatabaseType(connection.getMetaData(), type);
- }
-
- @Override
- public void updateObject(String columnName, Object value) throws OseeCoreException {
- try {
- rSet.updateObject(columnName, value);
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- @Override
- public void updateRow() throws OseeCoreException {
- try {
- rSet.updateRow();
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-
- @Override
- public void cancel() throws OseeCoreException {
- try {
- if (preparedStatement != null && !preparedStatement.isClosed()) {
- preparedStatement.cancel();
- }
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- try {
- if (callableStatement != null && !callableStatement.isClosed()) {
- callableStatement.cancel();
- }
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigUtil.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigUtil.java
deleted file mode 100644
index cf847e1c23..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigUtil.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.util.Properties;
-
-import org.apache.commons.dbcp.AbandonedConfig;
-import org.apache.commons.pool.impl.GenericKeyedObjectPool;
-import org.apache.commons.pool.impl.GenericObjectPool;
-import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
-
-/**
- * @see http://commons.apache.org/proper/commons-dbcp/configuration.html
- * @author Roberto E. Escobar
- */
-public final class PoolConfigUtil {
-
- public static final byte WHEN_EXHAUSTED_FAIL = 0;
- public static final byte WHEN_EXHAUSTED_BLOCK = 1;
- public static final byte WHEN_EXHAUSTED_GROW = 2;
-
- public static final byte DEFAULT_WHEN_EXHAUSTED_ACTION = WHEN_EXHAUSTED_FAIL; //WHEN_EXHAUSTED_BLOCK;
-
- public static final int DEFAULT_MAX_ACTIVE = OseeProperties.getOseeDbConnectionCount(); // default was 8
- public static final int DEFAULT_MAX_IDLE = DEFAULT_MAX_ACTIVE; // default was 8
- public static final int DEFAULT_MIN_IDLE = 0;
- public static final long DEFAULT_MAX_WAIT = -1L;
-
- public static final boolean DEFAULT_TEST_ON_BORROW = false;
- public static final boolean DEFAULT_TEST_ON_RETURN = false;
- public static final boolean DEFAULT_TEST_WHILE_IDLE = true;
-
- // The default number of objects to examine per run in the idle object evictor.
- public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN = 1; // dafault was DEFAULT_MAX_ACTIVE
-
- public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS = 5000L; // (5 sec) - default -1L (infinite)
- public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS = 60000L; // (60 secs) - default - 1000L * 60L * 30L - 30 mins;
- public static final long DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS = -1;
-
- public static final boolean DEFAULT_LIFO = true;
-
- public static final int DEFAULT_VALIDATION_QUERY_TIMEOUT_SECS = 10; // 3 secs
-
- public static final boolean DEFAULT_POOL_PREPARED_STATEMENTS = false; // default was false
-
- public static final int DEFAULT_MAX_TOTAL_STATEMENTS = 20; // default was 8
- public static final int DEFAULT_MAX_ACTIVE_STATEMENTS = DEFAULT_MAX_TOTAL_STATEMENTS; // default was 8
- public static final int DEFAULT_MAX_IDLE_STATEMENTS = DEFAULT_MAX_ACTIVE_STATEMENTS; // default was 8
- public static final int DEFAULT_MIN_IDLE_STATEMENTS = 0;
- public static final long DEFAULT_MAX_WAIT_STATEMENTS = -1L;
-
- public static final boolean DEFAULT_LOG_ABANDONED = false; // default was false
- public static final boolean DEFAULT_REMOVE_ABANDONED = false; // Flag whether to use abandoned timeout.
- public static final int DEFAULT_REMOVE_ABANDONED_TIMEOUT = 300; // Timeout in seconds before an abandoned connection can be removed.
-
- private PoolConfigUtil() {
- // Utility class
- }
-
- public static boolean isPoolingPreparedStatementsAllowed(Properties props) {
- return getBoolean(props, "poolPreparedStatements", DEFAULT_POOL_PREPARED_STATEMENTS);
- }
-
- public static int getValidationQueryTimeoutSecs(Properties props) {
- return getInt(props, "validationQueryTimeoutSecs", DEFAULT_VALIDATION_QUERY_TIMEOUT_SECS);
- }
-
- public static GenericObjectPool.Config getPoolConfig(Properties props) {
- GenericObjectPool.Config config = new GenericObjectPool.Config();
- //@formatter:off
- config.maxActive = getInt(props, "maxActive", DEFAULT_MAX_ACTIVE);
- config.maxIdle = getInt(props, "maxIdle", DEFAULT_MAX_IDLE);
- config.minIdle = getInt(props, "minIdle", DEFAULT_MIN_IDLE);
- config.maxWait = getLong(props, "maxWait", DEFAULT_MAX_WAIT);
-
- config.whenExhaustedAction= getByte(props, "whenExhaustedAction", DEFAULT_WHEN_EXHAUSTED_ACTION);
- config.testOnBorrow = getBoolean(props, "testOnBorrow", DEFAULT_TEST_ON_BORROW);
- config.testOnReturn = getBoolean(props, "testOnReturn", DEFAULT_TEST_ON_RETURN);
- config.testWhileIdle = getBoolean(props, "testWhileIdle", DEFAULT_TEST_WHILE_IDLE);
- config.timeBetweenEvictionRunsMillis = getLong(props, "timeBetweenEvictionRunsMillis", DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
- config.numTestsPerEvictionRun = getInt(props, "numTestsPerEvictionRun", DEFAULT_NUM_TESTS_PER_EVICTION_RUN);
- config.minEvictableIdleTimeMillis = getLong(props, "minEvictableIdleTimeMillis", DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
- config.lifo = getBoolean(props, "lifo", DEFAULT_LIFO);
-
- config.softMinEvictableIdleTimeMillis = getLong(props, "softMinEvictableIdleTimeMillis", DEFAULT_SOFT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
- //@formatter:on
-
- return config;
- }
-
- public static GenericKeyedObjectPool.Config getStatementPoolConfig(Properties props) {
- GenericKeyedObjectPool.Config config = new GenericKeyedObjectPool.Config();
-
- //@formatter:off
- config.maxTotal = getInt(props, "maxTotalPreparedStatements", DEFAULT_MAX_TOTAL_STATEMENTS);
- config.maxActive = getInt(props, "maxActivePreparedStatements", DEFAULT_MAX_ACTIVE_STATEMENTS);
- config.maxIdle = getInt(props, "maxIdlePreparedStatements", DEFAULT_MAX_IDLE_STATEMENTS);
- config.minIdle = getInt(props, "minIdlePreparedStatements", DEFAULT_MIN_IDLE_STATEMENTS);
- config.maxWait = getLong(props, "maxWaitPreparedStatements", DEFAULT_MAX_WAIT_STATEMENTS);
-
- // Same as Connection Pool
- config.whenExhaustedAction= getByte(props, "whenExhaustedAction", DEFAULT_WHEN_EXHAUSTED_ACTION);
- config.testOnBorrow = getBoolean(props, "testOnBorrow", DEFAULT_TEST_ON_BORROW);
- config.testOnReturn = getBoolean(props, "testOnReturn", DEFAULT_TEST_ON_RETURN);
- config.testWhileIdle = getBoolean(props, "testWhileIdle", DEFAULT_TEST_WHILE_IDLE);
- config.timeBetweenEvictionRunsMillis = getLong(props, "timeBetweenEvictionRunsMillis", DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS);
- config.numTestsPerEvictionRun = getInt(props, "numTestsPerEvictionRun", DEFAULT_NUM_TESTS_PER_EVICTION_RUN);
- config.minEvictableIdleTimeMillis = getLong(props, "minEvictableIdleTimeMillis", DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS);
- config.lifo = getBoolean(props, "lifo", DEFAULT_LIFO);
- //@formatter:on
-
- return config;
- }
-
- public static AbandonedConfig getAbandonedConnectionConfig(Properties props) {
- AbandonedConfig abandoned = new AbandonedConfig();
- abandoned.setLogAbandoned(getBoolean(props, "logAbandoned", DEFAULT_LOG_ABANDONED));
- abandoned.setRemoveAbandoned(getBoolean(props, "removeAbandoned", DEFAULT_REMOVE_ABANDONED));
- abandoned.setRemoveAbandonedTimeout(getInt(props, "removeAbandonedTimeout", DEFAULT_REMOVE_ABANDONED_TIMEOUT));
- return abandoned;
- }
-
- private static String get(Properties props, String key, String defaultValue) {
- String value = props.getProperty(key, defaultValue);
- props.setProperty(key, value);
- return value;
- }
-
- private static int getInt(Properties props, String key, int defaultValue) {
- return Integer.valueOf(get(props, key, String.valueOf(defaultValue)));
- }
-
- private static long getLong(Properties props, String key, long defaultValue) {
- return Long.valueOf(get(props, key, String.valueOf(defaultValue)));
- }
-
- private static boolean getBoolean(Properties props, String key, boolean defaultValue) {
- return Boolean.valueOf(get(props, key, String.valueOf(defaultValue)));
- }
-
- private static byte getByte(Properties props, String key, byte defaultWhenExhaustedAction) {
- return Byte.valueOf(get(props, key, String.valueOf(defaultWhenExhaustedAction)));
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigurationProvider.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigurationProvider.java
deleted file mode 100644
index 0ce1a599f9..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolConfigurationProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-import java.util.concurrent.FutureTask;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.database.internal.core.PoolFactory.PoolConfiguration;
-import org.eclipse.osee.framework.jdk.core.type.LazyObject;
-import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class PoolConfigurationProvider extends LazyObject<PoolConfiguration> {
-
- private URL getUserSpecifiedConfigURL() {
- URL configUri = null;
- String uri = OseeProperties.getOseeDbConnectionPoolConfigUri();
- if (Strings.isValid(uri)) {
- try {
- if (!uri.contains("://")) {
- configUri = new File(uri).toURI().toURL();
- } else {
- configUri = new URI(uri).toURL();
- }
- } catch (Exception ex) {
- OseeLog.logf(PoolConfigurationProvider.class, Level.SEVERE, ex,
- "Error get user specified connection pool config uri [%s]", uri);
- }
- }
- return configUri;
- }
-
- private Properties readConfig(URL url) {
- Properties props = new Properties();
-
- if (url != null) {
- InputStream inputStream = null;
- try {
- inputStream = new BufferedInputStream(url.openStream());
- props.loadFromXML(inputStream);
- } catch (Exception ex) {
- OseeLog.logf(PoolConfigurationProvider.class, Level.SEVERE, ex,
- "Error reading user specified connection pool config uri [%s]", url.toString());
- } finally {
- Lib.close(inputStream);
- }
- }
- return props;
- }
-
- @Override
- protected FutureTask<PoolConfiguration> createLoaderTask() {
- Callable<PoolConfiguration> callable = new Callable<PoolConfiguration>() {
- @Override
- public PoolConfiguration call() throws Exception {
- URL userURL = getUserSpecifiedConfigURL();
- Properties props = readConfig(userURL);
- return new PoolConfiguration(props);
- }
- };
- return new FutureTask<PoolConfiguration>(callable);
- }
-
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolFactory.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolFactory.java
deleted file mode 100644
index e4786f3dae..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PoolFactory.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-import java.util.concurrent.FutureTask;
-import javax.sql.DataSource;
-import org.apache.commons.dbcp.PoolingDriver;
-import org.apache.commons.pool.ObjectPool;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.core.IConnectionFactory;
-import org.eclipse.osee.framework.jdk.core.type.LazyObject;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-/**
- * @author Roberto E. Escobar
- */
-public class PoolFactory {
-
- private final PoolingDriverRef poolingDriver = new PoolingDriverRef();
- private final PoolConfigurationProvider poolConfig = new PoolConfigurationProvider();
-
- private final Map<String, IConnectionFactory> factories;
-
- public PoolFactory(Map<String, IConnectionFactory> factories) {
- this.factories = factories;
- }
-
- public void disposePools(Iterable<String> keys) throws OseeCoreException {
- PoolingDriver driver = poolingDriver.get();
- for (String key : keys) {
- try {
- driver.closePool(key);
- } catch (SQLException ex) {
- // Do Nothing
- }
- }
- poolingDriver.invalidate();
- }
-
- public Map<String, String> getPoolStats() throws OseeCoreException {
- Map<String, String> stats = new LinkedHashMap<String, String>();
-
- PoolConfiguration config = poolConfig.get();
- PoolingDriver driver = poolingDriver.get();
-
- stats.put("db.pool.driver", config.getConnectionPoolDriver());
-
- String poolVersion = String.format("%s.%s", driver.getMajorVersion(), driver.getMinorVersion());
- stats.put("db.pool.version", poolVersion);
-
- String[] names = driver.getPoolNames();
- for (String name : names) {
- try {
- ObjectPool<?> pool = driver.getConnectionPool(name);
- stats.put(String.format("db.pool.%s.active", name), String.valueOf(pool.getNumActive()));
- stats.put(String.format("db.pool.%s.idle", name), String.valueOf(pool.getNumIdle()));
- } catch (SQLException ex) {
- // Do Nothing
- }
- }
- return stats;
- }
-
- public Callable<DataSource> createDataSourceFetcher(IDatabaseInfo dbInfo) {
- return new PooledDataSourceFetcher(factories, poolingDriver, poolConfig, dbInfo);
- }
-
- private static final class PoolingDriverRef extends LazyObject<PoolingDriver> {
-
- @Override
- protected final FutureTask<PoolingDriver> createLoaderTask() {
- Callable<PoolingDriver> callable = new Callable<PoolingDriver>() {
- @Override
- public PoolingDriver call() throws Exception {
- try {
- Class.forName(PoolConfiguration.CONNECTION_POOL_DRIVER);
- } catch (Exception ex) {
- throw new OseeDataStoreException(ex, "Error loading connection pool driver [%s]",
- PoolConfiguration.CONNECTION_POOL_DRIVER);
- }
- PoolingDriver driver;
- try {
- driver = (PoolingDriver) DriverManager.getDriver(PoolConfiguration.CONNECTION_POOL_ID);
- } catch (SQLException ex) {
- throw new OseeDataStoreException(ex, "Error finding connection pool driver with id [%s]",
- PoolConfiguration.CONNECTION_POOL_ID);
- }
- return driver;
- }
- };
- return new FutureTask<PoolingDriver>(callable);
- }
- }
-
- public static class PoolConfiguration {
- private static final String CONNECTION_POOL_DRIVER = "org.apache.commons.dbcp.PoolingDriver";
- private static final String CONNECTION_POOL_ID = "jdbc:apache:commons:dbcp:";
-
- private final Properties config;
-
- public PoolConfiguration(Properties config) {
- this.config = config;
- }
-
- public String getConnectionPoolId() {
- return CONNECTION_POOL_ID;
- }
-
- public String getConnectionPoolDriver() {
- return CONNECTION_POOL_DRIVER;
- }
-
- public Properties getProperties() {
- return config;
- }
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledConnectionProvider.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledConnectionProvider.java
deleted file mode 100644
index 46d478c274..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledConnectionProvider.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-/**
- * @author Roberto E. Escobar
- */
-import java.sql.Connection;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.FutureTask;
-import javax.sql.DataSource;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.core.IDatabaseInfoProvider;
-import org.eclipse.osee.framework.jdk.core.type.LazyObject;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-
-public class PooledConnectionProvider implements ConnectionProvider {
-
- private final ConcurrentHashMap<String, LazyObject<DataSource>> dataSourceCache =
- new ConcurrentHashMap<String, LazyObject<DataSource>>();
-
- private final PoolFactory poolFactory;
- private final IDatabaseInfoProvider dbInfoProvider;
-
- public PooledConnectionProvider(IDatabaseInfoProvider dbInfoProvider, PoolFactory poolFactory) {
- this.dbInfoProvider = dbInfoProvider;
- this.poolFactory = poolFactory;
- }
-
- @Override
- public IDatabaseInfo getDefaultDatabaseInfo() throws OseeCoreException {
- return dbInfoProvider.getDatabaseInfo();
- }
-
- @Override
- public BaseOseeConnection getConnection() throws OseeCoreException {
- return getConnection(getDefaultDatabaseInfo());
- }
-
- @Override
- public BaseOseeConnection getConnection(IDatabaseInfo dbInfo) throws OseeCoreException {
- DataSource dataSource = getDataSource(dbInfo);
- return getOseeConnection(dataSource);
- }
-
- private DataSource getDataSource(final IDatabaseInfo dbInfo) throws OseeCoreException {
- String poolId = dbInfo.getId();
- LazyObject<DataSource> provider = dataSourceCache.get(poolId);
- if (provider == null) {
- LazyObject<DataSource> newProvider = new LazyObject<DataSource>() {
- @Override
- protected FutureTask<DataSource> createLoaderTask() {
- Callable<DataSource> newCallable = poolFactory.createDataSourceFetcher(dbInfo);
- return new FutureTask<DataSource>(newCallable);
- }
- };
- provider = dataSourceCache.putIfAbsent(poolId, newProvider);
- if (provider == null) {
- provider = newProvider;
- }
- }
- return provider.get();
- }
-
- private BaseOseeConnection getOseeConnection(DataSource dataSource) throws OseeCoreException {
- Connection connection = null;
- try {
- connection = dataSource.getConnection();
- } catch (Exception ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- return new BaseOseeConnection(connection);
- }
-
- @Override
- public void dispose() throws OseeCoreException {
- synchronized (poolFactory) {
- poolFactory.disposePools(dataSourceCache.keySet());
- dataSourceCache.clear();
- }
- }
-
- @Override
- public Map<String, String> getStatistics() throws OseeCoreException {
- synchronized (poolFactory) {
- return poolFactory.getPoolStats();
- }
- }
-
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledDataSourceFetcher.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledDataSourceFetcher.java
deleted file mode 100644
index ae4f1919d2..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/PooledDataSourceFetcher.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-import javax.sql.DataSource;
-import org.apache.commons.dbcp.AbandonedConfig;
-import org.apache.commons.dbcp.AbandonedObjectPool;
-import org.apache.commons.dbcp.ConnectionFactory;
-import org.apache.commons.dbcp.PoolableConnectionFactory;
-import org.apache.commons.dbcp.PoolingDataSource;
-import org.apache.commons.dbcp.PoolingDriver;
-import org.apache.commons.pool.ObjectPool;
-import org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.core.exception.OseeNotFoundException;
-import org.eclipse.osee.framework.database.core.IConnectionFactory;
-import org.eclipse.osee.framework.database.core.SupportedDatabase;
-import org.eclipse.osee.framework.database.internal.core.PoolFactory.PoolConfiguration;
-import org.eclipse.osee.framework.jdk.core.type.LazyObject;
-
-/**
- * @author Roberto E. Escobar
- */
-public class PooledDataSourceFetcher implements Callable<DataSource> {
-
- private final Map<String, IConnectionFactory> factories;
- private final LazyObject<? extends PoolingDriver> poolingDriver;
- private final LazyObject<? extends PoolConfiguration> poolConfig;
- private final IDatabaseInfo dbInfo;
-
- public PooledDataSourceFetcher(Map<String, IConnectionFactory> factories, LazyObject<? extends PoolingDriver> poolingDriver, LazyObject<? extends PoolConfiguration> poolConfig, IDatabaseInfo dbInfo) {
- this.factories = factories;
- this.poolConfig = poolConfig;
- this.poolingDriver = poolingDriver;
- this.dbInfo = dbInfo;
- }
-
- @Override
- public DataSource call() throws Exception {
- PoolConfiguration configuration = poolConfig.get();
- String driverClazz = configuration.getConnectionPoolDriver();
- try {
- Class.forName(driverClazz);
- } catch (Exception ex) {
- throw new OseeDataStoreException(ex, "Error loading connection pool driver [%s]", driverClazz);
- }
-
- String poolId = dbInfo.getId();
- ObjectPool<Connection> connectionPool = createConnectionPool();
-
- PoolingDriver driver = poolingDriver.get();
- driver.registerPool(poolId, connectionPool);
-
- return new PoolingDataSource(connectionPool);
- }
-
- @SuppressWarnings({"rawtypes", "unchecked"})
- private ObjectPool<Connection> createConnectionPool() throws Exception {
- PoolConfiguration configuration = poolConfig.get();
- Properties configProps = configuration.getProperties();
-
- IConnectionFactory proxiedFactory = getFactory(dbInfo.getDriver());
-
- MetaData metadata = getMetaData(proxiedFactory, dbInfo);
-
- ConnectionFactory connectionFactory =
- new ConnectionFactoryProxy(proxiedFactory, dbInfo, metadata.isTxIsolationLevelSupported());
-
- AbandonedObjectPool connectionPool =
- new AbandonedObjectPool(null, PoolConfigUtil.getAbandonedConnectionConfig(configProps));
- connectionPool.setConfig(PoolConfigUtil.getPoolConfig(configProps));
-
- GenericKeyedObjectPoolFactory statementPool = null;
- if (PoolConfigUtil.isPoolingPreparedStatementsAllowed(configProps)) {
- statementPool = new GenericKeyedObjectPoolFactory(null, PoolConfigUtil.getStatementPoolConfig(configProps));
- }
- AbandonedConfig abandoned = new AbandonedConfig();
- abandoned.setLogAbandoned(true);
- abandoned.setLogWriter(new PrintWriter(System.out));
-
- String validationQuery = metadata.getValidationQuery();
- int validationQueryTimeoutSecs = PoolConfigUtil.getValidationQueryTimeoutSecs(configProps);
- boolean defaultReadOnly = false;
- boolean defaultAutoCommit = true;
- new PoolableConnectionFactory(connectionFactory, connectionPool, statementPool, validationQuery,
- validationQueryTimeoutSecs, defaultReadOnly, defaultAutoCommit);
- return connectionPool;
- }
-
- private IConnectionFactory getFactory(String driver) {
- IConnectionFactory factory = factories.get(driver);
- if (factory == null) {
- factory = new DefaultConnectionFactory(driver);
- factories.put(driver, factory);
- }
- return factory;
- }
-
- private MetaData getMetaData(IConnectionFactory proxiedFactory, IDatabaseInfo dbInfo) throws Exception {
- MetaData metaData = new MetaData();
- Connection connection = null;
- try {
- connection = proxiedFactory.getConnection(dbInfo);
- DatabaseMetaData metadata = connection.getMetaData();
- metaData.setTxIsolationLevelSupported(metadata.supportsTransactionIsolationLevel(Connection.TRANSACTION_READ_COMMITTED));
- metaData.setValidationQuery(SupportedDatabase.getValidationSql(metadata));
- } finally {
- if (connection != null) {
- connection.close();
- }
- }
- return metaData;
- }
-
- private final class MetaData {
- private boolean isTxIsolationLevelSupported;
- private String validationQuery;
-
- public boolean isTxIsolationLevelSupported() {
- return isTxIsolationLevelSupported;
- }
-
- public void setTxIsolationLevelSupported(boolean isTxIsolationLevelSupported) {
- this.isTxIsolationLevelSupported = isTxIsolationLevelSupported;
- }
-
- public String getValidationQuery() {
- return validationQuery;
- }
-
- public void setValidationQuery(String validationQuery) {
- this.validationQuery = validationQuery;
- }
-
- }
-
- private static final class DefaultConnectionFactory implements IConnectionFactory {
-
- private final String driver;
-
- public DefaultConnectionFactory(String driver) {
- this.driver = driver;
- }
-
- @Override
- public Connection getConnection(IDatabaseInfo dbInfo) throws Exception {
- try {
- Class.forName(driver);
- } catch (Exception ex) {
- throw new OseeNotFoundException("Unable to find connection factory with driver [%s]", driver);
- }
- return DriverManager.getConnection(dbInfo.getConnectionUrl(), dbInfo.getConnectionProperties());
- }
-
- @Override
- public String getDriver() {
- return driver;
- }
- }
-
- private static final class ConnectionFactoryProxy implements ConnectionFactory {
- private final IConnectionFactory proxiedFactory;
- private final IDatabaseInfo dbInfo;
-
- private final boolean supportsIsolationLevel;
-
- public ConnectionFactoryProxy(IConnectionFactory proxiedFactory, IDatabaseInfo dbInfo, boolean supportsIsolationLevel) {
- super();
- this.proxiedFactory = proxiedFactory;
- this.dbInfo = dbInfo;
- this.supportsIsolationLevel = supportsIsolationLevel;
- }
-
- @Override
- public Connection createConnection() throws SQLException {
- Connection connection = null;
- try {
- connection = proxiedFactory.getConnection(dbInfo);
- if (supportsIsolationLevel) {
- connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
- }
- } catch (Exception ex) {
- if (connection != null) {
- try {
- connection.close();
- } catch (SQLException ex1) {
- // Do nothing on close exception;
- }
- }
- throw new SQLException(ex);
- }
- return connection;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
deleted file mode 100644
index c243845286..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.core;
-
-import static org.eclipse.osee.framework.database.IOseeDatabaseService.MAX_VARCHAR_LENGTH;
-import java.io.ByteArrayInputStream;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.Date;
-import java.util.logging.Level;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLog;
-
-/**
- * @author Roberto E. Escobar
- */
-public final class StatementUtil {
- private StatementUtil() {
- // Utility class
- }
-
- public static <O extends Object> String getBatchErrorMessage(Iterable<O[]> dataList) {
- StringBuilder details = new StringBuilder(MAX_VARCHAR_LENGTH);
- details.append("[ DATA OBJECT: \n");
- for (Object[] data : dataList) {
- for (int i = 0; i < data.length; i++) {
- details.append(i);
- details.append(": ");
- Object dataValue = data[i];
- if (dataValue != null) {
- details.append(dataValue.getClass().getName());
- details.append(":");
-
- String value = dataValue.toString();
- if (value.length() > 35) {
- details.append(value.substring(0, 35));
- } else {
- details.append(value);
- }
- details.append("\n");
- } else {
- details.append("NULL\n");
- }
- }
- details.append("---------\n");
- if (details.length() > MAX_VARCHAR_LENGTH) {
- break;
- }
- }
- details.append("]\n");
- return details.toString();
- }
-
- public static int calculateBatchUpdateResults(int[] updates) {
- int returnCount = 0;
- for (int update : updates) {
- if (update >= 0) {
- returnCount += update;
- } else if (Statement.EXECUTE_FAILED == update) {
- OseeLog.log(StatementUtil.class, Level.SEVERE, "sql execute failed.");
- } else if (Statement.SUCCESS_NO_INFO == update) {
- returnCount++;
- }
- }
- return returnCount;
- }
-
- public static void close(PreparedStatement stmt) {
- if (stmt != null) {
- try {
- stmt.close();
- } catch (SQLException ex) {
- OseeLog.log(StatementUtil.class, Level.WARNING, "Unable to close database statement: ", ex);
- }
- }
- }
-
- public static <O extends Object> void populateValuesForPreparedStatement(PreparedStatement preparedStatement, O... data) throws OseeCoreException {
- try {
- int preparedIndex = 0;
- for (Object dataValue : data) {
- preparedIndex++;
- if (dataValue instanceof String) {
- int length = ((String) dataValue).length();
- if (length > MAX_VARCHAR_LENGTH) {
- throw new OseeDataStoreException("SQL data value length must be <= %d not %d\nValue: %s",
- MAX_VARCHAR_LENGTH, length, dataValue);
- }
- }
-
- if (dataValue == null) {
- throw new OseeDataStoreException(
- "instead of passing null for an query parameter, pass the corresponding SQL3DataType");
- } else if (dataValue instanceof SQL3DataType) {
- int dataTypeNumber = ((SQL3DataType) dataValue).getSQLTypeNumber();
- if (dataTypeNumber == java.sql.Types.BLOB) {
- // TODO Need to check this - for PostgreSql, setNull for BLOB with the new JDBC driver gives the error "column
- // "content" is of type bytea but expression is of type oid"
- preparedStatement.setBytes(preparedIndex, null);
- } else {
- preparedStatement.setNull(preparedIndex, dataTypeNumber);
- }
- } else if (dataValue instanceof ByteArrayInputStream) {
- preparedStatement.setBinaryStream(preparedIndex, (ByteArrayInputStream) dataValue,
- ((ByteArrayInputStream) dataValue).available());
- } else if (dataValue instanceof Date) {
- java.util.Date javaDate = (java.util.Date) dataValue;
- java.sql.Timestamp date = new java.sql.Timestamp(javaDate.getTime());
- preparedStatement.setTimestamp(preparedIndex, date);
- } else if (dataValue instanceof BigInteger) {
- BigInteger bigInt = (BigInteger) dataValue;
- preparedStatement.setLong(preparedIndex, bigInt.longValue());
- } else if (dataValue instanceof BigDecimal) {
- BigDecimal bigDec = (BigDecimal) dataValue;
- preparedStatement.setLong(preparedIndex, bigDec.longValue());
- } else {
- preparedStatement.setObject(preparedIndex, dataValue);
- }
- }
- } catch (SQLException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConfigParser.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConfigParser.java
deleted file mode 100644
index e73ad483a4..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConfigParser.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.parser;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.osee.framework.database.internal.parser.DbInformation.DbObjectType;
-import org.eclipse.osee.framework.jdk.core.type.Pair;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @author Roberto E. Escobar
- */
-public class DbConfigParser {
-
- private final Map<String, DbDetailData> dbInfoMap;
- private final Map<String, DbSetupData> servicesMap;
- private final Map<String, DbConnectionData> connectionMap;
-
- private DbConfigParser() {
- dbInfoMap = new HashMap<String, DbDetailData>();
- servicesMap = new HashMap<String, DbSetupData>();
- connectionMap = new HashMap<String, DbConnectionData>();
- }
-
- public static DbInformation[] parse(Element rootElement) {
- DbConfigParser worker = new DbConfigParser();
- worker.parseDbInfo(rootElement);
- worker.parseDbService(rootElement);
- worker.parseDbConnection(rootElement);
- return worker.getAllDbServices();
- }
-
- private DbInformation[] getAllDbServices() {
- DbInformation[] info = new DbInformation[servicesMap.size()];
- int i = 0;
- for (String name : servicesMap.keySet()) {
- info[i] = buildDbInformation(name);
- i++;
- }
- return info;
- }
-
- private DbInformation buildDbInformation(String id) {
- DbSetupData serviceData = servicesMap.get(id);
- DbDetailData dbInfo = dbInfoMap.get(serviceData.getDbInfo());
- DbConnectionData connectionData =
- connectionMap.get(serviceData.getServerInfoValue(DbSetupData.ServerInfoFields.connectsWith));
- if (dbInfo != null && connectionData != null) {
- return new DbInformation(dbInfo, serviceData, connectionData);
- } else {
- return null;
- }
- }
-
- private void parseDbInfo(Element rootElement) {
- if (rootElement != null) {
- NodeList list = rootElement.getElementsByTagName(DbObjectType.DatabaseInfo.name());
- for (int i = 0; i < list.getLength(); i++) {
- DbDetailData dbInfo = new DbDetailData();
- Element element = (Element) list.item(i);
- NamedNodeMap map = element.getAttributes();
- if (map != null && map.getLength() != 0) {
- DbDetailData.DescriptionField[] descriptionFields = DbDetailData.DescriptionField.values();
- for (DbDetailData.DescriptionField descriptionField : descriptionFields) {
- Node node = map.getNamedItem(descriptionField.name());
- String value = node.getTextContent();
- if (Strings.isValid(value)) {
- dbInfo.addDescription(descriptionField, value);
- }
- }
- }
- DbDetailData.ConfigField[] configfields = DbDetailData.ConfigField.values();
- for (DbDetailData.ConfigField field : configfields) {
- Element fieldChild = Jaxp.getChild(element, field.name());
- if (fieldChild != null) {
- NamedNodeMap configMap = fieldChild.getAttributes();
- Node keyNode = configMap.getNamedItem(DbDetailData.ConfigPairField.key.name());
- Node valueNode = configMap.getNamedItem(DbDetailData.ConfigPairField.value.name());
- String key = null;
- if (keyNode != null) {
- key = keyNode.getTextContent();
- }
- String value = null;
- if (valueNode != null) {
- value = valueNode.getTextContent();
- }
- if (Strings.isValid(key)) {
- dbInfo.addConfigField(field, new Pair<String, String>(key, (value != null ? value : "")));
- }
-
- }
- }
- dbInfoMap.put(dbInfo.getId(), dbInfo);
- }
- }
- }
-
- private void parseDbService(Element rootElement) {
- if (rootElement != null) {
- NodeList list = rootElement.getElementsByTagName(DbObjectType.AvailableDbServices.name());
- for (int i = 0; i < list.getLength(); i++) {
-
- Element element = (Element) list.item(i);
-
- NodeList serverList = element.getElementsByTagName(DbSetupData.ServicesFields.Server.name());
- for (int index = 0; index < serverList.getLength(); index++) {
- DbSetupData dbServicesData = new DbSetupData();
- Element serviceChild = (Element) serverList.item(index);
- NamedNodeMap map = serviceChild.getAttributes();
- if (map != null && map.getLength() != 0) {
- DbSetupData.ServerInfoFields[] infoFields = DbSetupData.ServerInfoFields.values();
- for (DbSetupData.ServerInfoFields infoField : infoFields) {
- Node node = map.getNamedItem(infoField.name());
- String value = null;
- if (node != null) {
- value = node.getTextContent();
- }
- if (Strings.isValid(value)) {
- dbServicesData.addServerInfo(infoField, value);
- }
- }
- }
- servicesMap.put(dbServicesData.getId(), dbServicesData);
- }
- }
- }
- }
-
- private void parseDbConnection(Element rootElement) {
- if (rootElement != null) {
- NodeList list = rootElement.getElementsByTagName(DbObjectType.ConnectionDescription.name());
- for (int i = 0; i < list.getLength(); i++) {
- DbConnectionData dbConnectionData = new DbConnectionData();
- Element element = (Element) list.item(i);
-
- NamedNodeMap map = element.getAttributes();
- if (map != null && map.getLength() != 0) {
- Node node = map.getNamedItem(DbConnectionData.DescriptionFields.id.name());
- if (node != null) {
- String value = node.getTextContent();
- if (Strings.isValid(value)) {
- dbConnectionData.setId(value);
- }
- }
- }
-
- DbConnectionData.ConnectionFields[] connectionFields = DbConnectionData.ConnectionFields.values();
- for (DbConnectionData.ConnectionFields connectionField : connectionFields) {
- switch (connectionField) {
- case Driver:
- String driver = Jaxp.getChildText(element, connectionField.name());
- if (Strings.isValid(driver)) {
- dbConnectionData.setDBDriver(driver);
- }
- break;
- case Url:
- String url = Jaxp.getChildText(element, connectionField.name());
- if (Strings.isValid(url)) {
- dbConnectionData.setRawUrl(url);
- }
- break;
- case UrlAttributes:
- Element urlAttributes =
- Jaxp.getChild(element, DbConnectionData.ConnectionFields.UrlAttributes.name());
- if (urlAttributes != null) {
- NodeList attributes =
- urlAttributes.getElementsByTagName(DbConnectionData.UrlAttributes.Entry.name());
- if (attributes != null) {
- for (int index = 0; index < attributes.getLength(); index++) {
- Node node = attributes.item(index);
- String attributeValue = node.getTextContent();
- if (Strings.isValid(attributeValue)) {
- dbConnectionData.addAttribute(attributeValue);
- }
- }
- }
- }
- break;
- case Property: {
- NodeList nodes = element.getElementsByTagName(connectionField.name());
- for (int j = 0; j < nodes.getLength(); j++) {
- Element el = (Element) nodes.item(j);
- dbConnectionData.getProperties().setProperty(el.getAttribute("key"), el.getAttribute("value"));
- }
- }
- break;
- default:
- break;
- }
- }
- connectionMap.put(dbConnectionData.getId(), dbConnectionData);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConnectionData.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConnectionData.java
deleted file mode 100644
index e349f7db19..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbConnectionData.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.parser;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Properties;
-
-/**
- * @author Roberto E. Escobar
- */
-public class DbConnectionData implements Serializable {
-
- private static final long serialVersionUID = -7153773982095739831L;
-
- public enum DescriptionFields {
- id;
- }
-
- public enum UrlAttributes {
- Entry;
- }
-
- public enum ConnectionFields {
- Url,
- Driver,
- UrlAttributes,
- Property;
- }
-
- private String id;
- private String databaseDriver;
- private String databaseUrl;
- private final ArrayList<String> attributesList;
- private final Properties properties;
-
- public DbConnectionData() {
- attributesList = new ArrayList<String>();
- properties = new Properties();
- this.databaseDriver = "";
- this.databaseUrl = "";
- this.id = "";
- }
-
- public String getDBDriver() {
- return databaseDriver;
- }
-
- public String getRawUrl() {
- return databaseUrl;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
- public void addAttribute(String attribute) {
- attributesList.add(attribute);
- }
-
- public void setDBDriver(String driver) {
- databaseDriver = driver;
- }
-
- public void setRawUrl(String url) {
- databaseUrl = url;
- }
-
- public String getAttributes() {
- StringBuilder toReturn = new StringBuilder();
- for (String temp : attributesList) {
- toReturn.append(String.format("%s;", temp));
- }
- return toReturn.toString();
- }
-
- @Override
- public String toString() {
- return "DbConnection: " + id + "\n" + " Driver: " + databaseDriver + "\n" + " RawUrl: " + databaseUrl + "\n" + "Attributes: " + getAttributes() + "\n";
- }
-
- public Properties getProperties() {
- return properties;
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbDetailData.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbDetailData.java
deleted file mode 100644
index 34451d140d..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbDetailData.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.parser;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.osee.framework.database.core.SupportedDatabase;
-import org.eclipse.osee.framework.jdk.core.type.Pair;
-
-/**
- * @author Roberto E. Escobar
- */
-public class DbDetailData implements Serializable {
-
- private static final long serialVersionUID = 4610179141542353247L;
-
- public enum ConfigPairField {
- key,
- value;
- }
-
- public enum ConfigField {
- DatabaseType,
- DatabaseName,
- DatabaseHome,
- Prefix,
- UserName,
- Password,
- Host,
- Port
- }
-
- public enum DescriptionField {
- id;
- }
-
- private final Map<ConfigField, Pair<String, String>> configFieldMap;
- private final Map<DescriptionField, String> descriptionMap;
-
- public DbDetailData() {
- super();
- configFieldMap = new HashMap<ConfigField, Pair<String, String>>();
- descriptionMap = new HashMap<DescriptionField, String>();
- }
-
- public String getId() {
- return descriptionMap.get(DescriptionField.id);
- }
-
- public void addDescription(DescriptionField field, String value) {
- descriptionMap.put(field, value);
- }
-
- public void addConfigField(ConfigField field, Pair<String, String> pair) {
- configFieldMap.put(field, pair);
- }
-
- public SupportedDatabase getDbType() {
- return SupportedDatabase.valueOf(getFieldValue(ConfigField.DatabaseType).toLowerCase());
- }
-
- public String getFieldValue(ConfigField field) {
- String toReturn = "";
- if (configFieldMap.containsKey(field)) {
- Pair<String, String> pair = configFieldMap.get(field);
- toReturn = pair.getSecond();
- }
- return toReturn;
- }
-
- @Override
- public String toString() {
- StringBuilder toReturn = new StringBuilder("DatabaseInfo: \n");
- Set<DescriptionField> descriptionMapkeys = descriptionMap.keySet();
- for (DescriptionField field : descriptionMapkeys) {
- String value = descriptionMap.get(field);
- toReturn.append(String.format("%s: [%s]\n", field, value));
- }
-
- toReturn.append("Fields: \n");
- Set<ConfigField> keys = configFieldMap.keySet();
- for (ConfigField field : keys) {
- Pair<String, String> pair = configFieldMap.get(field);
- toReturn.append(field + ": " + "[" + pair.getFirst() + "],[" + pair.getSecond() + "]\n");
- }
- toReturn.append("\n");
- return toReturn.toString();
- }
-
- public Map<ConfigField, Pair<String, String>> getConfigMap() {
- return configFieldMap;
- }
-} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbInformation.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbInformation.java
deleted file mode 100644
index 4280aa87ca..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbInformation.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.parser;
-
-import java.util.Properties;
-import java.util.Set;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.database.internal.parser.DbDetailData.ConfigField;
-import org.eclipse.osee.framework.database.internal.parser.DbSetupData.ServerInfoFields;
-import org.eclipse.osee.framework.jdk.core.type.Pair;
-
-/**
- * @author Roberto E. Escobar
- */
-public class DbInformation implements IDatabaseInfo {
-
- private static final long serialVersionUID = -4704655033702137367L;
- private final DbDetailData dbDetailData;
- private final DbSetupData dbSetupData;
- private final DbConnectionData dbConnectionData;
-
- public enum DbObjectType {
- ConnectionDescription,
- AvailableDbServices,
- DatabaseInfo
- }
-
- public DbInformation(DbDetailData dbDetailData, DbSetupData dbSetupData, DbConnectionData dbConnectionData) {
- this.dbDetailData = dbDetailData;
- this.dbSetupData = dbSetupData;
- this.dbConnectionData = dbConnectionData;
- }
-
- public DbConnectionData getConnectionData() {
- return dbConnectionData;
- }
-
- public DbDetailData getDatabaseDetails() {
- return dbDetailData;
- }
-
- public DbSetupData getDatabaseSetupDetails() {
- return dbSetupData;
- }
-
- public String getFormattedURL() {
- String toReturn = dbConnectionData.getRawUrl();
- Set<DbDetailData.ConfigField> keys = dbDetailData.getConfigMap().keySet();
- for (DbDetailData.ConfigField field : keys) {
- Pair<String, String> pair = dbDetailData.getConfigMap().get(field);
- if (pair.getSecond().startsWith("@")) {
- DbObjectType type = DbObjectType.valueOf(pair.getSecond().substring(1, pair.getSecond().indexOf('.')));
- String value = pair.getSecond().substring(pair.getSecond().indexOf('.') + 1);
- String realValue = getValue(type, value);
-
- toReturn = toReturn.replace(pair.getFirst(), realValue);
- } else {
- toReturn = toReturn.replace(pair.getFirst(), pair.getSecond());
- }
- }
- return toReturn;
- }
-
- private String getValue(DbObjectType type, String key) {
- switch (type) {
- case AvailableDbServices:
- return dbSetupData.getServerInfoValue(DbSetupData.ServerInfoFields.valueOf(key));
- case ConnectionDescription:
- break;
- case DatabaseInfo:
- break;
- }
- return "none";
- }
-
- @Override
- public String toString() {
- return getFormattedURL() + " : user=" + getDatabaseLoginName();
- }
-
- @Override
- public String getConnectionUrl() {
- return getFormattedURL() + getConnectionData().getAttributes();
- }
-
- @Override
- public Properties getConnectionProperties() {
- Properties properties = getConnectionData().getProperties();
- properties.setProperty("user", getDatabaseLoginName());
- properties.setProperty("password", getDatabaseDetails().getFieldValue(ConfigField.Password));
- return properties;
- }
-
- @Override
- public String getDatabaseLoginName() {
- return getDatabaseDetails().getFieldValue(ConfigField.UserName);
- }
-
- @Override
- public String getDatabaseName() {
- return getDatabaseDetails().getFieldValue(ConfigField.DatabaseName);
- }
-
- @Override
- public String getDriver() {
- return getConnectionData().getDBDriver();
- }
-
- @Override
- public String getId() {
- return getDatabaseSetupDetails().getId();
- }
-
- @Override
- public boolean isProduction() {
- return Boolean.valueOf(getDatabaseSetupDetails().getServerInfoValue(ServerInfoFields.isProduction));
- }
-
- @Override
- public String getDatabaseHome() {
- return getDatabaseDetails().getFieldValue(ConfigField.DatabaseHome);
- }
-}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbSetupData.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbSetupData.java
deleted file mode 100644
index 8b9b06174e..0000000000
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/parser/DbSetupData.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.database.internal.parser;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author Roberto E. Escobar
- */
-public class DbSetupData implements Serializable {
-
- private static final long serialVersionUID = -7195682073850593321L;
-
- public enum ServicesFields {
- Server;
- }
-
- public enum ServerInfoFields {
- id,
- dbInfo,
- hostAddress,
- port,
- connectsWith,
- serverConfig,
- isProduction;
- }
-
- Map<ServerInfoFields, String> serverFieldMap;
-
- public DbSetupData() {
- this.serverFieldMap = new HashMap<ServerInfoFields, String>();
- }
-
- public void addServerInfo(ServerInfoFields field, String value) {
- serverFieldMap.put(field, value);
- }
-
- public String getServerInfoValue(ServerInfoFields field) {
- if (serverFieldMap.containsKey(field)) {
- return serverFieldMap.get(field);
- }
- return "";
- }
-
- public String getId() {
- return serverFieldMap.get(ServerInfoFields.id);
- }
-
- public String getDbInfo() {
- return serverFieldMap.get(ServerInfoFields.dbInfo);
- }
-
- @Override
- public String toString() {
- StringBuilder toReturn = new StringBuilder("Service: \n");
- Set<ServerInfoFields> keys = serverFieldMap.keySet();
- for (ServerInfoFields field : keys) {
- String value = serverFieldMap.get(field);
- toReturn.append(String.format("%s: %s ", field, value));
- }
- return toReturn.toString();
- }
-
- public Map<ServerInfoFields, String> getServerFieldMap() {
- return serverFieldMap;
- }
-}

Back to the top