-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f8f5ca
commit 6ac6957
Showing
12 changed files
with
458 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
wrapper/src/main/java/software/amazon/jdbc/states/RestoreSessionStateCallable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package software.amazon.jdbc.states; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
import java.util.EnumSet; | ||
import org.checkerframework.checker.nullness.qual.NonNull; | ||
import org.checkerframework.checker.nullness.qual.Nullable; | ||
|
||
public interface RestoreSessionStateCallable { | ||
/** | ||
* Restores partial session state from saved values to a connection. | ||
* | ||
* @param sessionState Session state flags for from-connection | ||
* @param dest The destination connection to transfer state to | ||
* @param readOnly ReadOnly flag to set to | ||
* @param autoCommit AutoCommit flag to set to | ||
* @return true, if session state is restored successful and no default logic should be executed after. | ||
* False, if default logic should be executed. | ||
*/ | ||
boolean restoreSessionState( | ||
final @NonNull EnumSet<SessionDirtyFlag> sessionState, | ||
final @NonNull Connection dest, | ||
final @Nullable Boolean readOnly, | ||
final @Nullable Boolean autoCommit) | ||
throws SQLException; | ||
} |
33 changes: 33 additions & 0 deletions
33
wrapper/src/main/java/software/amazon/jdbc/states/SessionDirtyFlag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package software.amazon.jdbc.states; | ||
|
||
|
||
import java.util.EnumSet; | ||
|
||
public enum SessionDirtyFlag { | ||
READONLY, | ||
AUTO_COMMIT, | ||
TRANSACTION_ISOLATION, | ||
CATALOG, | ||
NETWORK_TIMEOUT, | ||
SCHEMA, | ||
TYPE_MAP, | ||
HOLDABILITY; | ||
|
||
public static final EnumSet<SessionDirtyFlag> ALL = EnumSet.allOf(SessionDirtyFlag.class); | ||
} |
Oops, something went wrong.