Plan/all/com/djrapitops/plan/storage/database/Database.html
2020-01-24 12:56:15 +02:00

369 lines
16 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="fi">
<head>
<!-- Generated by javadoc (1.8.0_201) on Fri Jan 24 12:56:08 EET 2020 -->
<title>Database (Plan 5.0-SNAPSHOT API)</title>
<meta name="date" content="2020-01-24">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Database (Plan 5.0-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":18,"i3":6,"i4":6,"i5":6,"i6":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/djrapitops/plan/storage/database/BukkitDBSystem.html" title="class in com.djrapitops.plan.storage.database"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/djrapitops/plan/storage/database/Database.State.html" title="enum in com.djrapitops.plan.storage.database"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/djrapitops/plan/storage/database/Database.html" target="_top">Frames</a></li>
<li><a href="Database.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.djrapitops.plan.storage.database</div>
<h2 title="Interface Database" class="title">Interface Database</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../com/djrapitops/plan/storage/database/AbstractDatabase.html" title="class in com.djrapitops.plan.storage.database">AbstractDatabase</a>, <a href="../../../../../com/djrapitops/plan/storage/database/H2DB.html" title="class in com.djrapitops.plan.storage.database">H2DB</a>, <a href="../../../../../com/djrapitops/plan/storage/database/MySQLDB.html" title="class in com.djrapitops.plan.storage.database">MySQLDB</a>, <a href="../../../../../com/djrapitops/plan/storage/database/SQLDB.html" title="class in com.djrapitops.plan.storage.database">SQLDB</a>, <a href="../../../../../com/djrapitops/plan/storage/database/SQLiteDB.html" title="class in com.djrapitops.plan.storage.database">SQLiteDB</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Database</span></pre>
<div class="block">Interface for interacting with a Plan SQL database.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.State.html" title="enum in com.djrapitops.plan.storage.database">Database.State</a></span></code>
<div class="block">Possible State changes:
CLOSED to PATCHING (Database init),
PATCHING to OPEN (Database initialized),
OPEN to CLOSING (Database closing),
CLOSING to CLOSED (Database closed),
PATCHING to CLOSED (Database closed prematurely)</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.html#close--">close</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.util.concurrent.Future&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.html#executeTransaction-com.djrapitops.plan.storage.database.transactions.Transaction-">executeTransaction</a></span>(<a href="../../../../../com/djrapitops/plan/storage/database/transactions/Transaction.html" title="class in com.djrapitops.plan.storage.database.transactions">Transaction</a>&nbsp;transaction)</code>
<div class="block">Execute an SQL Transaction.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>default <a href="../../../../../com/djrapitops/plan/storage/database/sql/building/Sql.html" title="class in com.djrapitops.plan.storage.database.sql.building">Sql</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.html#getSql--">getSql</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/djrapitops/plan/storage/database/Database.State.html" title="enum in com.djrapitops.plan.storage.database">Database.State</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.html#getState--">getState</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../com/djrapitops/plan/storage/database/DBType.html" title="enum in com.djrapitops.plan.storage.database">DBType</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.html#getType--">getType</a></span>()</code>
<div class="block">Used to get the <code>DBType</code> of the Database</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.html#init--">init</a></span>()</code>
<div class="block">Initializes the Database.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/djrapitops/plan/storage/database/Database.html#query-com.djrapitops.plan.storage.database.queries.Query-">query</a></span>(<a href="../../../../../com/djrapitops/plan/storage/database/queries/Query.html" title="interface in com.djrapitops.plan.storage.database.queries">Query</a>&lt;T&gt;&nbsp;query)</code>
<div class="block">Execute an SQL Query statement to get a result.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="init--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>void&nbsp;init()</pre>
<div class="block">Initializes the Database.
<p>
Queries can be performed after this request has completed all required transactions for the database operations.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../com/djrapitops/plan/exceptions/database/DBInitException.html" title="class in com.djrapitops.plan.exceptions.database">DBInitException</a></code> - if Database fails to initiate.</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>void&nbsp;close()</pre>
</li>
</ul>
<a name="query-com.djrapitops.plan.storage.database.queries.Query-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>query</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;query(<a href="../../../../../com/djrapitops/plan/storage/database/queries/Query.html" title="interface in com.djrapitops.plan.storage.database.queries">Query</a>&lt;T&gt;&nbsp;query)</pre>
<div class="block">Execute an SQL Query statement to get a result.
<p>
This method should only be called from an asynchronous thread.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Type of the object to be returned.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>query</code> - QueryStatement to execute.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Result of the query.</dd>
</dl>
</li>
</ul>
<a name="executeTransaction-com.djrapitops.plan.storage.database.transactions.Transaction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>executeTransaction</h4>
<pre>java.util.concurrent.Future&lt;?&gt;&nbsp;executeTransaction(<a href="../../../../../com/djrapitops/plan/storage/database/transactions/Transaction.html" title="class in com.djrapitops.plan.storage.database.transactions">Transaction</a>&nbsp;transaction)</pre>
<div class="block">Execute an SQL Transaction.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>transaction</code> - Transaction to execute.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Future that is finished when the transaction has been executed.</dd>
</dl>
</li>
</ul>
<a name="getType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getType</h4>
<pre><a href="../../../../../com/djrapitops/plan/storage/database/DBType.html" title="enum in com.djrapitops.plan.storage.database">DBType</a>&nbsp;getType()</pre>
<div class="block">Used to get the <code>DBType</code> of the Database</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>DBType</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../com/djrapitops/plan/storage/database/DBType.html" title="enum in com.djrapitops.plan.storage.database"><code>DBType</code></a></dd>
</dl>
</li>
</ul>
<a name="getSql--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSql</h4>
<pre>default&nbsp;<a href="../../../../../com/djrapitops/plan/storage/database/sql/building/Sql.html" title="class in com.djrapitops.plan.storage.database.sql.building">Sql</a>&nbsp;getSql()</pre>
</li>
</ul>
<a name="getState--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getState</h4>
<pre><a href="../../../../../com/djrapitops/plan/storage/database/Database.State.html" title="enum in com.djrapitops.plan.storage.database">Database.State</a>&nbsp;getState()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/djrapitops/plan/storage/database/BukkitDBSystem.html" title="class in com.djrapitops.plan.storage.database"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/djrapitops/plan/storage/database/Database.State.html" title="enum in com.djrapitops.plan.storage.database"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/djrapitops/plan/storage/database/Database.html" target="_top">Frames</a></li>
<li><a href="Database.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>