├── doc ├── interference.png └── InterferenceManual.pdf ├── src └── main │ └── java │ └── su │ └── interference │ ├── metrics │ ├── MeterMBean.java │ ├── CallMBean.java │ ├── Call.java │ ├── TimerMBean.java │ ├── HistogramMBean.java │ ├── Counter.java │ ├── Meter.java │ ├── Timer.java │ └── Histogram.java │ ├── core │ ├── EventProcessor.java │ ├── SessionFactory.java │ ├── ManagedRunnable.java │ ├── ManagedProcess.java │ ├── AllowRPredicate.java │ ├── StreamCallable.java │ ├── ManagedCallable.java │ ├── NoCheck.java │ ├── Notran.java │ ├── MapColumn.java │ ├── IndexColumn.java │ ├── ResultSetEntity.java │ ├── NoDistribute.java │ ├── IndexChunk.java │ ├── Threshold.java │ ├── DisableSync.java │ ├── IndexEntity.java │ ├── SystemEntity.java │ ├── TransEntity.java │ ├── IndexOrganized.java │ ├── DistributedId.java │ ├── Interference.java │ ├── FrameOrderComparator.java │ ├── FrameAllocComparator.java │ ├── GenericObject.java │ ├── ChunkIdComparator.java │ ├── EntityContainer.java │ ├── FileType.java │ ├── MapField.java │ ├── Header.java │ ├── IndexField.java │ ├── Chunk.java │ ├── IndexElement.java │ ├── DataSet.java │ ├── TransFrameId.java │ ├── ValueSet.java │ └── SyncTask.java │ ├── exception │ ├── CannotAccessToForeignRecord.java │ ├── InvalidFrame.java │ ├── AccessDenied.java │ ├── InvalidParameter.java │ ├── InvalidFrameHeader.java │ ├── EmptyFrameHeaderFound.java │ ├── NotEnoughFrameSpace.java │ ├── IncorrectUndoChunkFound.java │ ├── MissingSyncFrameException.java │ ├── CannotAccessToDeletedRecord.java │ ├── CannotAccessToLockedRecord.java │ └── InternalException.java │ ├── persistent │ ├── OnDelete.java │ ├── FilePartitioned.java │ ├── Source.java │ ├── EventSubscriber.java │ └── RQFrame.java │ ├── transport │ ├── PersistentEvent.java │ ├── RemoteResultSet.java │ ├── RemoteRequest.java │ ├── TransportEvent.java │ └── TransportCallback.java │ ├── sqlexception │ ├── InvalidWindowByPart.java │ ├── MissingWithinClause.java │ ├── UnableToLockTableForProcess.java │ ├── AmbiguousColumnName.java │ ├── InvalidCondition.java │ ├── ConstraintViolation.java │ ├── InvalidGroupByPart.java │ ├── InvalidOrderByPart.java │ ├── InvalidSQLStatement.java │ ├── MissingFromClause.java │ ├── MissingRightParenthesis.java │ ├── UnexpectedEndOfStatement.java │ ├── InvalidGroupColumnSet.java │ ├── NotNullViolation.java │ ├── TooManyNestedConditions.java │ ├── InvalidColumnDescription.java │ ├── InvalidTableDescription.java │ ├── MissingTablesDescription.java │ ├── UniqueConstraintViolation.java │ ├── MissingTableInSerializableMode.java │ ├── InvalidConditionValue.java │ ├── SQLException.java │ ├── PrimaryKeyViolation.java │ └── ForeignKeyViolation.java │ ├── mgmt │ ├── MgmtClass.java │ ├── MgmtClassIdColumn.java │ ├── MgmtColumn.java │ ├── MgmtAction.java │ └── MgmtConfig.java │ ├── sql │ ├── ResultSetTerm.java │ ├── Finder.java │ ├── IntCondition.java │ ├── SQLStmt.java │ ├── SQLStatement.java │ ├── ColumnGroupComparator.java │ ├── ColumnOrderComparator.java │ ├── FieldContainer.java │ ├── ResultSet.java │ ├── SQLJoinThreadPool.java │ ├── FrameApi.java │ ├── FrameIterator.java │ ├── JoinCondition.java │ ├── SQLNode.java │ └── SQLGroup.java │ ├── api │ ├── GenericResult.java │ ├── TransportApi.java │ └── SerializerApi.java │ ├── standalone │ └── Start.java │ ├── proxy │ └── ClassContainer.java │ └── rest │ ├── HTTPResponse.java │ └── HTTPServer.java ├── .github ├── ISSUE_TEMPLATE │ ├── custom.md │ ├── feature_request.md │ └── bug_report.md └── workflows │ ├── maven.yml │ └── maven-publish.yml ├── LICENSE ├── config └── app-log-config.xml └── pom.xml /doc/interference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/interference-project/interference/HEAD/doc/interference.png -------------------------------------------------------------------------------- /doc/InterferenceManual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/interference-project/interference/HEAD/doc/InterferenceManual.pdf -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/MeterMBean.java: -------------------------------------------------------------------------------- 1 | package su.interference.metrics; 2 | 3 | public interface MeterMBean { 4 | long getCnt(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/CallMBean.java: -------------------------------------------------------------------------------- 1 | package su.interference.metrics; 2 | 3 | public interface CallMBean { 4 | void forceCleanUp(); 5 | void reportFrames(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/EventProcessor.java: -------------------------------------------------------------------------------- 1 | package su.interference.core; 2 | 3 | public interface EventProcessor { 4 | boolean process(Object event); 5 | boolean delete(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/CannotAccessToForeignRecord.java: -------------------------------------------------------------------------------- 1 | package su.interference.exception; 2 | 3 | public class CannotAccessToForeignRecord extends RuntimeException { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: Set up JDK 1.8 13 | uses: actions/setup-java@v1 14 | with: 15 | java-version: 1.8 16 | - name: Build with Maven 17 | run: mvn -B package --file pom.xml 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/workflows/maven-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created 2 | # For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path 3 | 4 | name: Maven Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Set up JDK 1.8 18 | uses: actions/setup-java@v1 19 | with: 20 | java-version: 1.8 21 | server-id: github # Value of the distributionManagement/repository/id field of the pom.xml 22 | settings-path: ${{ github.workspace }} # location for the settings.xml file 23 | 24 | - name: Build with Maven 25 | run: mvn -B package --file pom.xml 26 | 27 | - name: Publish to GitHub Packages Apache Maven 28 | run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml 29 | env: 30 | GITHUB_TOKEN: ${{ github.token }} 31 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/Call.java: -------------------------------------------------------------------------------- 1 | package su.interference.metrics; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import su.interference.core.DataChunk; 6 | import su.interference.core.Instance; 7 | import su.interference.core.SystemCleanUp; 8 | import su.interference.persistent.FrameData; 9 | 10 | import java.util.Map; 11 | 12 | public class Call extends Meter implements CallMBean { 13 | 14 | private final static Logger logger = LoggerFactory.getLogger(Call.class); 15 | public Call(String name) { 16 | super(name); 17 | } 18 | 19 | public void forceCleanUp() { 20 | SystemCleanUp.forceCleanUp(); 21 | } 22 | 23 | public void reportFrames() { 24 | for (Object entry : Instance.getInstance().getFramesMap().entrySet()) { 25 | final FrameData f = (FrameData) ((DataChunk) ((Map.Entry) entry).getValue()).getEntity(); 26 | logger.info("frame table:id:used "+f.getObjectId()+":"+f.getFrameId()+":"+f.getUsed()); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 interference-project 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /config/app-log-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date %level [%thread] %logger{10} [%file:%line] %msg%n 8 | 9 | 10 | 11 | 12 | logs/app.log 13 | 14 | 15 | logs/app-%d{yyyy-MM-dd}.%i.zip 16 | 50MB 17 | 3 18 | true 19 | 20 | 21 | 22 | %date %level [%thread] %logger{10} [%file:%line] %msg%n 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/SessionFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class SessionFactory { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/ManagedRunnable.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface ManagedRunnable extends Runnable { 33 | void stop(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/persistent/OnDelete.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.persistent; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface OnDelete { 33 | void onDelete() throws Exception; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/transport/PersistentEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.transport; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface PersistentEvent { 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/ManagedProcess.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface ManagedProcess { 33 | void stop() throws InterruptedException; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidWindowByPart.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidWindowByPart extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/MissingWithinClause.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class MissingWithinClause extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/AllowRPredicate.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | interface AllowRPredicate { 33 | boolean isAllowR(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/StreamCallable.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface StreamCallable { 33 | Object call(Object o); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/InvalidFrame.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidFrame extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/UnableToLockTableForProcess.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class UnableToLockTableForProcess extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/AccessDenied.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class AccessDenied extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/InvalidParameter.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidParameter extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/AmbiguousColumnName.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class AmbiguousColumnName extends SQLException { 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/InvalidFrameHeader.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidFrameHeader extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidCondition.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidCondition extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/EmptyFrameHeaderFound.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class EmptyFrameHeaderFound extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/NotEnoughFrameSpace.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class NotEnoughFrameSpace extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/persistent/FilePartitioned.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.persistent; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface FilePartitioned { 33 | 34 | int getFile(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/ConstraintViolation.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class ConstraintViolation extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidGroupByPart.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidGroupByPart extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidOrderByPart.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidOrderByPart extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidSQLStatement.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidSQLStatement extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/MissingFromClause.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class MissingFromClause extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/MissingRightParenthesis.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class MissingRightParenthesis extends SQLException { 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/UnexpectedEndOfStatement.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class UnexpectedEndOfStatement extends SQLException { 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/IncorrectUndoChunkFound.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class IncorrectUndoChunkFound extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidGroupColumnSet.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidGroupColumnSet extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/NotNullViolation.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class NotNullViolation extends ConstraintViolation { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/TooManyNestedConditions.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class TooManyNestedConditions extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/ManagedCallable.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.util.concurrent.Callable; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public interface ManagedCallable extends Callable { 35 | void stop(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/MissingSyncFrameException.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class MissingSyncFrameException extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidColumnDescription.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidColumnDescription extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidTableDescription.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidTableDescription extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/MissingTablesDescription.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class MissingTablesDescription extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/CannotAccessToDeletedRecord.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class CannotAccessToDeletedRecord extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/CannotAccessToLockedRecord.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class CannotAccessToLockedRecord extends RuntimeException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/UniqueConstraintViolation.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class UniqueConstraintViolation extends ConstraintViolation { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/MissingTableInSerializableMode.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class MissingTableInSerializableMode extends SQLException { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/su/interference/mgmt/MgmtClass.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 interference 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.mgmt; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface MgmtClass { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/ResultSetTerm.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import java.io.Serializable; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class ResultSetTerm implements Serializable { 35 | private final static long serialVersionUID = 7302274901293874556L; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/NoCheck.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface NoCheck { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/Notran.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface Notran { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/Finder.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.persistent.Session; 28 | import java.util.List; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public interface Finder { 36 | List get(Object key, Session s) throws Exception; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/MapColumn.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface MapColumn { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/su/interference/mgmt/MgmtClassIdColumn.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 interference 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.mgmt; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface MgmtClassIdColumn { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/TimerMBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.metrics; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface TimerMBean { 33 | long getCnt(); 34 | long getMin(); 35 | long getMax(); 36 | long getSum(); 37 | long getAvg(); 38 | void reset(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/su/interference/api/GenericResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.api; 26 | 27 | import java.lang.reflect.InvocationTargetException; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public interface GenericResult { 35 | Object getValueByName(String name) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/IndexColumn.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface IndexColumn { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/ResultSetEntity.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface ResultSetEntity { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/HistogramMBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.metrics; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface HistogramMBean { 33 | long getCnt(); 34 | long getMin(); 35 | long getMax(); 36 | long getSum(); 37 | long getAvg(); 38 | void reset(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/su/interference/api/TransportApi.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.api; 26 | 27 | import su.interference.transport.TransportEvent; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public interface TransportApi { 35 | 36 | /* 37 | send transport event to the specific node 38 | */ 39 | void send(TransportEvent transportEvent); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/su/interference/mgmt/MgmtColumn.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 interference 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.mgmt; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface MgmtColumn { 37 | String name(); 38 | int width(); 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/IntCondition.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class IntCondition { 33 | 34 | private int value; 35 | public int getValue() { 36 | return value; 37 | } 38 | public void setValue(int value) { 39 | this.value = value; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/InvalidConditionValue.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class InvalidConditionValue extends SQLException { 33 | public InvalidConditionValue() { 34 | } 35 | 36 | public InvalidConditionValue(String e) { 37 | super(e); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/NoDistribute.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2020 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | @Target({java.lang.annotation.ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | public @interface NoDistribute { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/IndexChunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public interface IndexChunk { 33 | 34 | DataChunk getDataChunk(); 35 | DataChunk getDataChunkForUpdate(LLT llt); 36 | RowId getFramePtrRowId(); 37 | void setDataChunk(DataChunk c); 38 | void setFramePtrRowId(RowId r); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/Threshold.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2020 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | @Target({java.lang.annotation.ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | public @interface Threshold { 39 | int value() default 131072; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/mgmt/MgmtAction.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 interference 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.mgmt; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | @Retention(RetentionPolicy.RUNTIME) 36 | public @interface MgmtAction { 37 | String name(); 38 | //check method name for action enable 39 | String enable(); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/DisableSync.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | @Target({java.lang.annotation.ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | public @interface DisableSync { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/SQLStmt.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.sqlexception.SQLException; 28 | import su.interference.persistent.Session; 29 | import su.interference.core.DataSet; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | public interface SQLStmt { 37 | 38 | DataSet executeSQL (Session s) throws SQLException; 39 | CList getCols(); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/IndexEntity.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Target; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | @Target({java.lang.annotation.ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | public @interface IndexEntity { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/SystemEntity.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | @Target({java.lang.annotation.ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | public @interface SystemEntity { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/TransEntity.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Retention; 28 | import java.lang.annotation.RetentionPolicy; 29 | import java.lang.annotation.Target; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | @Target({java.lang.annotation.ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | public @interface TransEntity { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/IndexOrganized.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.Target; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | @Target({java.lang.annotation.ElementType.TYPE}) 37 | @Retention(RetentionPolicy.RUNTIME) 38 | public @interface IndexOrganized { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/SQLStatement.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.sqlexception.SQLException; 28 | import su.interference.persistent.Session; 29 | import su.interference.core.DataSet; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | public interface SQLStatement { 37 | 38 | DataSet executeSQL (Session s) throws SQLException; 39 | SQLException getSQLException(); 40 | CList getCols(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/DistributedId.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | /** 33 | * @author Yuriy Glotanov 34 | * @since 1.0 35 | */ 36 | 37 | @Target({ElementType.METHOD, ElementType.FIELD}) 38 | @Retention(RetentionPolicy.RUNTIME) 39 | public @interface DistributedId { 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/Counter.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.metrics; 26 | 27 | import java.util.concurrent.atomic.AtomicLong; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class Counter extends Meter { 35 | 36 | private final AtomicLong cnt = new AtomicLong(0); 37 | 38 | public Counter(String name) { 39 | super(name); 40 | } 41 | 42 | @Override 43 | public void put() { 44 | cnt.incrementAndGet(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/SQLException.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class SQLException extends Exception { 33 | private String message; 34 | 35 | public SQLException () { 36 | 37 | } 38 | 39 | public SQLException (String e) { 40 | message = e; 41 | } 42 | 43 | public String getSQLExceptionMessage () { 44 | return message; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/Interference.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.persistent.Session; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public interface Interference { 35 | String createInstance(int nodeType, Session s); 36 | void startupInstance(Session s) throws Exception; 37 | void shutdownInstance(Session s) throws Exception; 38 | int getSystemState(); 39 | static Interference getInstance() { 40 | return Instance.getInstance(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/FrameOrderComparator.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.sql.FrameApi; 28 | 29 | import java.util.Comparator; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | public class FrameOrderComparator implements Comparator { 37 | public int compare(FrameApi f1, FrameApi f2) { 38 | if (f1.getFrameOrder() < f2.getFrameOrder()) { 39 | return -1; 40 | } else if (f1.getFrameOrder() > f2.getFrameOrder()) { 41 | return 1; 42 | } 43 | return 0; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/ColumnGroupComparator.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import java.util.Comparator; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | class ColumnGroupComparator implements Comparator { 35 | 36 | public int compare(SQLColumn o1, SQLColumn o2) { 37 | if (o1.getGroupOrd() < o2.getGroupOrd()) { 38 | return -1; 39 | } else if (o1.getGroupOrd() > o2.getGroupOrd()) { 40 | return 1; 41 | } 42 | return 0; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/ColumnOrderComparator.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import java.util.Comparator; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class ColumnOrderComparator implements Comparator { 35 | 36 | public int compare(SQLColumn o1, SQLColumn o2) { 37 | if (o1.getOrderOrd() < o2.getOrderOrd()) { 38 | return -1; 39 | } else if (o1.getOrderOrd() > o2.getOrderOrd()) { 40 | return 1; 41 | } 42 | return 0; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/su/interference/transport/RemoteResultSet.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.transport; 26 | 27 | import su.interference.core.GenericObject; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class RemoteResultSet { 35 | final String uuid; 36 | final RemoteSession remoteSession; 37 | 38 | public RemoteResultSet(String uuid, RemoteSession remoteSession) { 39 | this.uuid = uuid; 40 | this.remoteSession = remoteSession; 41 | } 42 | 43 | public GenericObject poll() throws InterruptedException { 44 | return remoteSession.rspoll(uuid); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/FieldContainer.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | import java.lang.reflect.Field; 33 | import java.lang.reflect.Method; 34 | 35 | public class FieldContainer { 36 | private Field field; 37 | private Method getter; 38 | 39 | public FieldContainer(Field field, Method getter) { 40 | this.field = field; 41 | this.getter = getter; 42 | } 43 | 44 | public Field getField() { 45 | return field; 46 | } 47 | 48 | public Method getGetter() { 49 | return getter; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/PrimaryKeyViolation.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class PrimaryKeyViolation extends ConstraintViolation { 33 | private int pkColumnId; 34 | 35 | public PrimaryKeyViolation (int pkColumnId) { 36 | this.pkColumnId = pkColumnId; 37 | } 38 | 39 | public int getPkColumnId() { 40 | return pkColumnId; 41 | } 42 | 43 | public void setPkColumnId(int pkColumnId) { 44 | this.pkColumnId = pkColumnId; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sqlexception/ForeignKeyViolation.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sqlexception; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class ForeignKeyViolation extends ConstraintViolation { 33 | private int fkColumnId; 34 | 35 | public ForeignKeyViolation(int fkColumnId) { 36 | this.fkColumnId = fkColumnId; 37 | } 38 | 39 | public int getFkColumnId() { 40 | return fkColumnId; 41 | } 42 | 43 | public void setFkColumnId(int fkColumnId) { 44 | this.fkColumnId = fkColumnId; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/FrameAllocComparator.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.persistent.FrameData; 28 | 29 | import java.util.Comparator; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | public class FrameAllocComparator implements Comparator { 37 | public int compare(FrameData bd1, FrameData bd2) { 38 | if (bd1.getAllocId() < bd2.getAllocId()) { 39 | return -1; 40 | } else if (bd1.getAllocId() > bd2.getAllocId()) { 41 | return 1; 42 | } 43 | return 0; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/GenericObject.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.api.GenericResult; 28 | 29 | import java.io.Serializable; 30 | import java.util.Map; 31 | 32 | /** 33 | * @author Yuriy Glotanov 34 | * @since 1.0 35 | */ 36 | 37 | public class GenericObject implements Serializable, GenericResult { 38 | private final static long serialVersionUID = 4330809121118587364L; 39 | private final Map vmap; 40 | 41 | protected GenericObject(Map vmap) { 42 | this.vmap = vmap; 43 | } 44 | 45 | public Object getValueByName(String name) { 46 | return vmap.get(name); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/ChunkIdComparator.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.persistent.Session; 28 | import java.util.Comparator; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public class ChunkIdComparator implements Comparator { 36 | private Session s; 37 | 38 | public ChunkIdComparator(Session s) { 39 | this.s = s; 40 | } 41 | 42 | @SuppressWarnings("unchecked") 43 | public int compare(Chunk c1, Chunk c2) { 44 | try { 45 | return c1.getId(null, s).compareTo(c2.getId(null, s)); 46 | } catch (Exception e) { 47 | throw new RuntimeException(e); 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/su/interference/transport/RemoteRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.transport; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class RemoteRequest { 33 | private final Object source; 34 | private final Class srcClass; 35 | private int type; 36 | 37 | public RemoteRequest(Object source, Class srcClass, int type) { 38 | this.source = source; 39 | this.srcClass = srcClass; 40 | this.type = type; 41 | } 42 | 43 | public Object getSource() { 44 | return source; 45 | } 46 | 47 | public Class getSrcClass() { 48 | return srcClass; 49 | } 50 | 51 | public int getType() { 52 | return type; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/EntityContainer.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.persistent.Session; 28 | import su.interference.persistent.Transaction; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public interface EntityContainer { 36 | 37 | Transaction getTran(); 38 | Object getEntity(Session s); 39 | void setTran(Transaction tran); 40 | su.interference.core.RowId getRowId(); 41 | void setRowId(su.interference.core.RowId r); 42 | su.interference.core.DataChunk getDataChunk(); 43 | void setDataChunk(su.interference.core.DataChunk c); 44 | boolean getReceived(); 45 | void setReceived(boolean received); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/FileType.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class FileType { 33 | 34 | private int type; 35 | private String name; 36 | 37 | public FileType(int type, String name) { 38 | this.type = type; 39 | this.name = name; 40 | } 41 | 42 | public int getType() { 43 | return type; 44 | } 45 | 46 | public void setType(int type) { 47 | this.type = type; 48 | } 49 | 50 | public String getName() { 51 | return name; 52 | } 53 | 54 | public void setName(String name) { 55 | this.name = name; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/su/interference/api/SerializerApi.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.api; 26 | 27 | import java.lang.reflect.Field; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public interface SerializerApi { 35 | /* 36 | serialize object, returns byte[] 37 | 1st parameter - fully qualified class name (type) 38 | 2nd parameter - instance of described class 39 | */ 40 | byte[] serialize (String t, Object o) throws Exception; 41 | /* 42 | deserialize byte array, returns object 43 | 1st parameter - byte[] 44 | 2nd parameter - field of class 45 | */ 46 | Object deserialize (byte[] b, Field f) throws Exception; 47 | Object deserialize (String v, String t) throws Exception; 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/ResultSet.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.core.Chunk; 28 | import su.interference.core.DataChunk; 29 | import su.interference.persistent.Session; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | public interface ResultSet { 37 | DataChunk persist(Object o, Session s) throws Exception; 38 | Object poll(Session s) throws Exception; 39 | Chunk cpoll(Session s) throws Exception; 40 | int getObjectId(); 41 | boolean isIndex(); 42 | Class getTableClass(); 43 | java.lang.reflect.Field[] getFields(); 44 | void deallocate(Session s) throws Exception; 45 | boolean isPersistent(); 46 | void clearPersistent(); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/MapField.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.reflect.Field; 28 | import java.util.Map; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public class MapField { 36 | 37 | private Field field; 38 | private Map map; 39 | 40 | public MapField(Field field, Map map) { 41 | this.field = field; 42 | this.map = map; 43 | } 44 | 45 | public Field getField() { 46 | return field; 47 | } 48 | 49 | public void setField(Field field) { 50 | this.field = field; 51 | } 52 | 53 | public Map getMap() { 54 | return map; 55 | } 56 | 57 | public void setMap(Map map) { 58 | this.map = map; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/SQLJoinThreadPool.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2020 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.core.Config; 28 | 29 | import java.util.concurrent.ExecutorService; 30 | import java.util.concurrent.Executors; 31 | 32 | /** 33 | * @author Yuriy Glotanov 34 | * @since 1.0 35 | */ 36 | 37 | public class SQLJoinThreadPool { 38 | 39 | private static ExecutorService exec = Executors.newFixedThreadPool(Config.getConfig().RETRIEVE_THREADS_AMOUNT); 40 | private static ExecutorService exec2 = Executors.newFixedThreadPool(Config.getConfig().RETRIEVE_THREADS_AMOUNT); 41 | 42 | public static ExecutorService getThreadPool() { 43 | return exec; 44 | } 45 | public static ExecutorService getThreadPool2() { 46 | return exec2; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/Header.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.persistent.Transaction; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public interface Header { 35 | 36 | int RECORD_NORMAL_STATE = 1; 37 | int RECORD_UPDATED_STATE = 2; 38 | int RECORD_DELETED_STATE = 3; 39 | 40 | Transaction getTran (); 41 | int getState(); 42 | int getLen(); 43 | int getPtr(); 44 | void setTran(Transaction tran); 45 | void setState(int state); 46 | void setLen(int len); 47 | void setPtr(int ptr); 48 | long getFramePtr(); 49 | byte[] getHeader(); 50 | RowId getRowID(); 51 | void setRowID(RowId rowID); 52 | long getLltId(); 53 | void setLltId(long lltId); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/IndexField.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.lang.reflect.Field; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class IndexField { 35 | 36 | private Field field; 37 | private IndexList index; 38 | 39 | public IndexField (Field field, IndexList index) { 40 | this.field = field; 41 | this.index = index; 42 | } 43 | 44 | public Field getField() { 45 | return field; 46 | } 47 | 48 | public void setField(Field field) { 49 | this.field = field; 50 | } 51 | 52 | public IndexList getIndex() { 53 | return index; 54 | } 55 | 56 | public void setIndex(IndexList index) { 57 | this.index = index; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/FrameApi.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.core.Chunk; 28 | import su.interference.persistent.Session; 29 | 30 | import java.util.ArrayList; 31 | 32 | /** 33 | * @author Yuriy Glotanov 34 | * @since 1.0 35 | */ 36 | 37 | public interface FrameApi { 38 | public static final int IMPL_DATA = 1; 39 | public static final int IMPL_INDEX = 2; 40 | public static final int IMPL_HASH = 3; 41 | public static final int IMPL_CONTAINER = 4; 42 | 43 | long getFrameId(); 44 | long getAllocId(); 45 | int getObjectId(); 46 | int getImpl(); 47 | long getFrameOrder(); 48 | ArrayList getFrameChunks(Session s) throws Exception; 49 | ArrayList getFrameEntities(Session s) throws Exception; 50 | boolean isProcess(); 51 | Class getEventProcessor(); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/su/interference/mgmt/MgmtConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 interference 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.mgmt; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | @MgmtClass 33 | public class MgmtConfig { 34 | @MgmtColumn(name="Configuration parameter",width=20) 35 | private final String confParam; 36 | @MgmtColumn(name="Parameter Value",width=80) 37 | private final Object confValue; 38 | 39 | public MgmtConfig(String confParam, Object confValue) { 40 | this.confParam = confParam; 41 | this.confValue = confValue; 42 | } 43 | 44 | public String getConfParam() { 45 | return confParam; 46 | } 47 | 48 | public String getConfValue() { 49 | if (confValue instanceof String[]) { 50 | return String.join("
", ((String[]) confValue)); 51 | } else { 52 | return String.valueOf(confValue); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/FrameIterator.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.exception.InternalException; 28 | 29 | import java.net.MalformedURLException; 30 | import java.util.List; 31 | 32 | /** 33 | * @author Yuriy Glotanov 34 | * @since 1.0 35 | */ 36 | 37 | public interface FrameIterator { 38 | 39 | public static final int TYPE_TABLE = 1; 40 | public static final int TYPE_CURSOR = 2; 41 | 42 | FrameApi nextFrame() throws Exception; 43 | boolean hasNextFrame() throws InternalException; 44 | void resetIterator(); 45 | int getType(); 46 | boolean isIndex() throws MalformedURLException, ClassNotFoundException; 47 | int getObjectId(); 48 | List getObjectIds(); 49 | boolean isLeftfs(); 50 | void setLeftfs(boolean leftfs); 51 | boolean noDistribute(); 52 | boolean isProcess(); 53 | Class getEventProcessor(); 54 | } -------------------------------------------------------------------------------- /src/main/java/su/interference/transport/TransportEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.transport; 26 | 27 | import java.io.Serializable; 28 | import java.util.concurrent.CountDownLatch; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public interface TransportEvent extends Serializable { 36 | int getChannelId(); 37 | boolean isBroadcast(); 38 | String getMessageUUID(); 39 | void setMessageUUID(String uuid); 40 | CountDownLatch getLatch(); 41 | void setLatch(CountDownLatch latch); 42 | int getCallbackNodeId(); 43 | void setCallbackNodeId(int callbackNodeId); 44 | TransportCallback getCallback(); 45 | boolean isSent(); 46 | void sent(); 47 | boolean isFail(); 48 | void failure(int channelId, Exception e); 49 | EventResult process(); 50 | Exception getProcessException(); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/su/interference/standalone/Start.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.standalone; 26 | 27 | import su.interference.core.Instance; 28 | import su.interference.persistent.Node; 29 | import su.interference.persistent.Session; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | public class Start { 37 | 38 | public static void main(String args[]) throws Exception { 39 | Instance instance = Instance.getInstance(); 40 | final Session s = Session.getSession(); 41 | 42 | Runtime.getRuntime().addShutdownHook(new Thread(() -> { 43 | try { 44 | instance.shutdownInstance(); 45 | } catch (Exception e) { 46 | e.printStackTrace(); 47 | } 48 | System.out.println("stopped"); 49 | })); 50 | 51 | s.setUserId(Session.ROOT_USER_ID); 52 | 53 | instance.startupInstance(s); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/su/interference/proxy/ClassContainer.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.proxy; 26 | 27 | import java.io.Serializable; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class ClassContainer implements Serializable { 35 | private final String source; 36 | private final String name; 37 | private final String prefix; 38 | private final String simpleName; 39 | private final static long serialVersionUID = 3939261107543234865L; 40 | 41 | public ClassContainer(String source, String name, String prefix, String simpleName) { 42 | this.source = source; 43 | this.name = name; 44 | this.prefix = prefix; 45 | this.simpleName = simpleName; 46 | } 47 | 48 | public String getSource() { 49 | return source; 50 | } 51 | 52 | public String getName() { 53 | return name; 54 | } 55 | 56 | public String getPrefix() { 57 | return prefix; 58 | } 59 | 60 | public String getSimpleName() { 61 | return simpleName; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/JoinCondition.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.sqlexception.InvalidCondition; 28 | import su.interference.core.Types; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public class JoinCondition extends Condition { 36 | 37 | private final SQLColumn conditionColumnRight; 38 | private int id; 39 | 40 | public JoinCondition(SQLColumn cc, int c, SQLColumn rc, NestedCondition nc) throws InvalidCondition { 41 | super(cc,c,nc); 42 | if (!Types.sqlCheck(cc.getColumn().getType().getName(), rc.getColumn().getType().getName())) { 43 | throw new InvalidCondition(); 44 | } 45 | this.conditionColumnRight = rc; 46 | } 47 | 48 | 49 | public SQLColumn getConditionColumnRight() { 50 | return conditionColumnRight; 51 | } 52 | 53 | public int getId() { 54 | return id; 55 | } 56 | 57 | public void setId(int id) { 58 | this.id = id; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/Chunk.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.exception.InternalException; 28 | import su.interference.persistent.Session; 29 | import su.interference.persistent.UndoChunk; 30 | 31 | import java.lang.reflect.Field; 32 | import java.lang.reflect.InvocationTargetException; 33 | 34 | /** 35 | * @author Yuriy Glotanov 36 | * @since 1.0 37 | */ 38 | 39 | public interface Chunk extends Comparable { 40 | 41 | Header getHeader(); 42 | void setHeader(Header header); 43 | byte[] getChunk(); 44 | int getBytesAmount(); 45 | Comparable getId (Field idfield, Session s) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException; 46 | ValueSet getDcs(); 47 | boolean isTerminate(); 48 | void setTerminate(boolean terminate); 49 | Object getEntity(); 50 | Object getEntity(Session s); 51 | Object getUndoEntity(); 52 | void updateEntity(Object o) throws InternalException, IllegalAccessException; 53 | UndoChunk getUndoChunk(); 54 | String getHexByChunk(); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/Meter.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.metrics; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | public class Meter implements MeterMBean { 33 | 34 | private final String name; 35 | private long value; 36 | 37 | public Meter (String name) { 38 | this.name = name; 39 | } 40 | 41 | public void put() { 42 | 43 | } 44 | 45 | public void put(final long value) { 46 | this.value = value; 47 | } 48 | 49 | public long getCnt() { 50 | return value; 51 | } 52 | 53 | public long getMin() { 54 | return 0; 55 | } 56 | 57 | public long getMax() { 58 | return 0; 59 | } 60 | 61 | public long getSum() { 62 | return 0; 63 | } 64 | 65 | public long getAvg() { 66 | return 0; 67 | } 68 | 69 | public void start() { 70 | 71 | } 72 | 73 | public void stop() { 74 | 75 | } 76 | 77 | public String toString() { 78 | return this.name+": cnt="+getCnt()+", min="+getMin()+", max="+getMax()+", avg="+getAvg(); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/su/interference/persistent/Source.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.persistent; 26 | 27 | import javax.persistence.*; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | @Entity 35 | public class Source { 36 | @Column 37 | @Id 38 | @GeneratedValue 39 | private int sourceId; 40 | @Column 41 | private int type; 42 | @Column 43 | private String text; 44 | 45 | public Source() { 46 | 47 | } 48 | 49 | public Source(Integer sourceId, Integer type, String text) { 50 | this.sourceId = sourceId; 51 | this.type = type; 52 | this.text = text; 53 | } 54 | 55 | public int getSourceId() { 56 | return sourceId; 57 | } 58 | 59 | public void setSourceId(int sourceId) { 60 | this.sourceId = sourceId; 61 | } 62 | 63 | public int getType() { 64 | return type; 65 | } 66 | 67 | public void setType(int type) { 68 | this.type = type; 69 | } 70 | 71 | public String getText() { 72 | return text; 73 | } 74 | 75 | public void setText(String text) { 76 | this.text = text; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/su/interference/transport/TransportCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.transport; 26 | 27 | import java.io.Serializable; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class TransportCallback implements Serializable { 35 | public static final int SUCCESS = 0; 36 | public static final int FAILURE = 1; 37 | private final static long serialVersionUID = 1010992982563811125L; 38 | 39 | private final int nodeId; 40 | private final String messageUUID; 41 | private final EventResult result; 42 | 43 | public TransportCallback() { 44 | this.nodeId = 0; 45 | this.messageUUID = null; 46 | this.result = null; 47 | } 48 | 49 | public TransportCallback(int nodeId, String messageUUID, EventResult result) { 50 | this.nodeId = nodeId; 51 | this.messageUUID = messageUUID; 52 | this.result = result; 53 | } 54 | 55 | public int getNodeId() { 56 | return nodeId; 57 | } 58 | 59 | public String getMessageUUID() { 60 | return messageUUID; 61 | } 62 | 63 | public EventResult getResult() { 64 | return result; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/Timer.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.metrics; 26 | 27 | import java.util.concurrent.ConcurrentHashMap; 28 | import java.util.concurrent.atomic.AtomicLong; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public class Timer extends Histogram implements TimerMBean { 36 | 37 | private final ConcurrentHashMap tmap = new ConcurrentHashMap(); 38 | 39 | public Timer(String name) { 40 | super(name); 41 | } 42 | 43 | @Override 44 | public void start() { 45 | if (tmap.get(Thread.currentThread().getId())==null) { 46 | tmap.put(Thread.currentThread().getId(), System.currentTimeMillis()); 47 | } 48 | } 49 | 50 | @Override 51 | public void stop() { 52 | final Long time = tmap.get(Thread.currentThread().getId()); 53 | if (time!=null) { 54 | if (time>0) { 55 | put(System.currentTimeMillis() - time); 56 | tmap.remove(Thread.currentThread().getId()); 57 | } 58 | } 59 | } 60 | 61 | @Override 62 | public void reset() { 63 | super.reset(); 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/SQLNode.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.persistent.Node; 28 | import su.interference.transport.SQLEvent; 29 | 30 | /** 31 | * @author Yuriy Glotanov 32 | * @since 1.0 33 | */ 34 | 35 | public class SQLNode { 36 | 37 | private final int nodeId; 38 | private final long slaveCursorId; 39 | private final Node node; 40 | private final int type; 41 | private int taskComplete; 42 | private SQLEvent sqlEvent; 43 | 44 | public static final int NODE_TYPE_MASTER = 1; 45 | public static final int NODE_TYPE_SLAVE = 2; 46 | 47 | public SQLNode(int nodeId, int type, long slaveCursorId) { 48 | this.nodeId = nodeId; 49 | this.node = null; 50 | this.type = type; 51 | this.slaveCursorId = slaveCursorId; 52 | } 53 | 54 | /* 55 | public SQLNode(Node node, int type) { 56 | this.node = node; 57 | this.type = type; 58 | } 59 | */ 60 | 61 | public int getNodeId() { 62 | return nodeId; 63 | } 64 | 65 | /* 66 | public Node getNode() { 67 | return node; 68 | } 69 | */ 70 | 71 | public int getType() { 72 | return type; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/IndexElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.util.Date; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class IndexElement implements Comparable { 35 | final private IndexElementKey key; 36 | private Object element; 37 | final private boolean ex; 38 | 39 | public IndexElement (IndexElementKey key, Object element, boolean ex) { 40 | this.key = key; 41 | this.element = element; 42 | this.ex = ex; 43 | } 44 | 45 | public int compareTo(final Object obj) { 46 | final IndexElement j = (IndexElement)obj; 47 | final int res = this.getKey().compareTo(j.getKey()); 48 | if (this.ex && res == 0) { 49 | if ((Integer)this.getElement() < (Integer)j.getElement()) { return -1; } else if ((Integer)this.getElement() > (Integer)j.getElement()) { return 1; } 50 | return 0; 51 | } 52 | return res; 53 | } 54 | 55 | public IndexElementKey getKey() { 56 | return key; 57 | } 58 | 59 | public Object getElement() { 60 | return element; 61 | } 62 | 63 | public void setElement(Object element) { 64 | this.element = element; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/DataSet.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import su.interference.sql.ResultSet; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class DataSet { 35 | private Object[] ds; 36 | private ResultSet table; 37 | private String message; 38 | 39 | public DataSet(Object[] ds) { 40 | this.ds = ds; 41 | } 42 | 43 | public DataSet(Object[] ds, String message) { 44 | this.ds = ds; 45 | this.message = message; 46 | } 47 | 48 | public DataSet(Object[] ds, ResultSet table, String message) { 49 | this.ds = ds; 50 | this.table = table; 51 | this.message = message; 52 | } 53 | 54 | public Object[] getDataSet() { 55 | return ds; 56 | } 57 | 58 | public void setDataSet(Object[] ds) { 59 | this.ds = ds; 60 | } 61 | 62 | public String getMessage() { 63 | return message; 64 | } 65 | 66 | public void setMessage(String message) { 67 | this.message = message; 68 | } 69 | 70 | public ResultSet getTable() { 71 | return table; 72 | } 73 | 74 | public void setTable(ResultSet table) { 75 | this.table = table; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/su/interference/persistent/EventSubscriber.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.persistent; 26 | 27 | import su.interference.core.DisableSync; 28 | import su.interference.core.IndexColumn; 29 | import su.interference.core.MapColumn; 30 | import su.interference.core.SystemEntity; 31 | import su.interference.mgmt.MgmtColumn; 32 | 33 | import javax.persistence.Column; 34 | import javax.persistence.Entity; 35 | import javax.persistence.Id; 36 | import javax.persistence.Transient; 37 | 38 | /** 39 | * @author Yuriy Glotanov 40 | * @since 1.0 41 | */ 42 | 43 | @Entity 44 | @SystemEntity 45 | @DisableSync 46 | public class EventSubscriber { 47 | 48 | @Id 49 | @Column 50 | @MapColumn 51 | private String entityId; 52 | @Column 53 | @IndexColumn 54 | private String subscriberId; 55 | 56 | @Transient 57 | public static final int CLASS_ID = 16; 58 | 59 | public static int getCLASS_ID() { 60 | return CLASS_ID; 61 | } 62 | 63 | public EventSubscriber() { 64 | 65 | } 66 | 67 | public EventSubscriber(String entityId, String subscriberId) { 68 | this.entityId = entityId; 69 | this.subscriberId = subscriberId; 70 | } 71 | 72 | public String getEntityId() { 73 | return entityId; 74 | } 75 | 76 | public String getSubscriberId() { 77 | return subscriberId; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/su/interference/core/TransFrameId.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2021 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.core; 26 | 27 | import java.io.Serializable; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class TransFrameId implements Serializable { 35 | private final static long serialVersionUID = 2122989901000213555L; 36 | private final long cframeId; 37 | private final long uframeId; 38 | private final long transId; 39 | 40 | public TransFrameId(long cframeId, long uframeId, long transId) { 41 | this.cframeId = cframeId; 42 | this.uframeId = uframeId; 43 | this.transId = transId; 44 | } 45 | 46 | public boolean equals(final Object obj) { 47 | final TransFrameId id = (TransFrameId)obj; 48 | return this.cframeId == id.cframeId && this.uframeId == id.uframeId && this.transId == id.transId; 49 | } 50 | 51 | public int hashCode() { 52 | int hashCode = 1; 53 | hashCode = 31 * hashCode + Long.valueOf(cframeId).hashCode(); 54 | hashCode = 31 * hashCode + Long.valueOf(uframeId).hashCode(); 55 | hashCode = 31 * hashCode + Long.valueOf(transId).hashCode(); 56 | return hashCode; 57 | } 58 | public long getCframeId() { 59 | return cframeId; 60 | } 61 | 62 | public long getUframeId() { 63 | return uframeId; 64 | } 65 | 66 | public long getTransId() { 67 | return transId; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/su/interference/persistent/RQFrame.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.persistent; 26 | 27 | import su.interference.core.DisableSync; 28 | import su.interference.core.IndexColumn; 29 | import su.interference.core.SystemEntity; 30 | 31 | import javax.persistence.Column; 32 | import javax.persistence.Entity; 33 | import javax.persistence.Id; 34 | import javax.persistence.Transient; 35 | 36 | /** 37 | * @author Yuriy Glotanov 38 | * @since 1.0 39 | */ 40 | 41 | @Entity 42 | @SystemEntity 43 | @DisableSync 44 | public class RQFrame { 45 | 46 | @Id 47 | @Column 48 | @IndexColumn 49 | private long frameId; 50 | @Column 51 | @IndexColumn 52 | private int nodeId; 53 | 54 | @Transient 55 | public static final int CLASS_ID = 5; 56 | 57 | public static int getCLASS_ID() { 58 | return CLASS_ID; 59 | } 60 | 61 | public RQFrame() { 62 | 63 | } 64 | 65 | public RQFrame(int nodeId, long frame) { 66 | this.frameId = frame; 67 | this.nodeId = nodeId; 68 | } 69 | 70 | public long getFrameId() { 71 | return frameId; 72 | } 73 | 74 | public void setFrameId(long frameId) { 75 | this.frameId = frameId; 76 | } 77 | 78 | public int getNodeId() { 79 | return nodeId; 80 | } 81 | 82 | public void setNodeId(int nodeId) { 83 | this.nodeId = nodeId; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/su/interference/exception/InternalException.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.exception; 26 | 27 | import org.slf4j.Logger; 28 | import org.slf4j.LoggerFactory; 29 | import su.interference.core.Instance; 30 | 31 | /** 32 | * @author Yuriy Glotanov 33 | * @since 1.0 34 | */ 35 | 36 | public class InternalException extends RuntimeException { 37 | 38 | private Exception e; 39 | private final static Logger logger = LoggerFactory.getLogger(InternalException.class); 40 | 41 | public InternalException (Exception e) { 42 | super(); 43 | this.e = e; 44 | checkDebugMode(); 45 | } 46 | 47 | public InternalException () { 48 | super(); 49 | this.e = this; 50 | checkDebugMode(); 51 | } 52 | 53 | public String getLogMessage () { 54 | StringBuffer r = new StringBuffer(); 55 | StackTraceElement[] ste = this.e.getStackTrace(); 56 | for (int i=0; i 2 | 5 | 6 | 4.0.0 7 | 8 | su.interference 9 | interference 10 | 2025.1 11 | jar 12 | 13 | interference 14 | distributed database platform 15 | https://github.com/interference-project/interference 16 | 17 | 18 | 19 | MIT 20 | 21 | 22 | 23 | 24 | 25 | yuriy-glotanov 26 | Yuriy Glotanov 27 | 28 | 29 | 30 | 31 | 32 | 33 | org.apache.maven.plugins 34 | maven-compiler-plugin 35 | 3.1 36 | 37 | 1.8 38 | 1.8 39 | 1.8 40 | 41 | 42 | 43 | org.apache.maven.plugins 44 | maven-jar-plugin 45 | 46 | 47 | 48 | true 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 63 | 64 | javax 65 | javaee-api 66 | 7.0 67 | 68 | 69 | ch.qos.logback 70 | logback-classic 71 | 1.2.13 72 | 73 | 74 | org.slf4j 75 | jcl-over-slf4j 76 | 1.7.21 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /src/main/java/su/interference/metrics/Histogram.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.metrics; 26 | 27 | import java.util.concurrent.atomic.AtomicLong; 28 | 29 | /** 30 | * @author Yuriy Glotanov 31 | * @since 1.0 32 | */ 33 | 34 | public class Histogram extends Meter implements HistogramMBean { 35 | 36 | private final AtomicLong cnt = new AtomicLong(0); 37 | private final AtomicLong min = new AtomicLong(Long.MAX_VALUE); 38 | private final AtomicLong max = new AtomicLong(Long.MIN_VALUE); 39 | private final AtomicLong sum = new AtomicLong(0); 40 | private final AtomicLong avg = new AtomicLong(0); 41 | 42 | public Histogram(String name) { 43 | super(name); 44 | } 45 | 46 | @Override 47 | public void put(final long value) { 48 | cnt.incrementAndGet(); 49 | sum.addAndGet(value); 50 | avg.set(sum.get()/cnt.get()); 51 | if (min.get()>value) min.set(value); 52 | if (max.get() { 41 | 42 | @SuppressWarnings("unchecked") 43 | private final PriorityBlockingQueue pq = new PriorityBlockingQueue(); 44 | private final DataFile df; 45 | private final static Logger logger = LoggerFactory.getLogger(SyncTask.class); 46 | 47 | public SyncTask(DataFile df) { 48 | this.df = df; 49 | } 50 | 51 | public void add(SyncFrame bd) { 52 | pq.add(bd); 53 | } 54 | 55 | public DataFile getDataFile() { 56 | return df; 57 | } 58 | 59 | public Integer call() { 60 | Thread.currentThread().setName("interference-sync-task-thread-"+Thread.currentThread().getId()); 61 | Metrics.get("syncFrames").start(); 62 | try { 63 | 64 | while (pq.peek() != null) { 65 | final SyncFrame bd = pq.poll(); 66 | final long ptr = bd.getFrameId() - (bd.getFrameId()%4096); 67 | this.df.writeFrame(ptr, bd.getBytes()); 68 | //Storage.getStorage().writeFrameWithBackup(bd.getBytes(), bd.getFrameId()); 69 | } 70 | 71 | Metrics.get("syncFrames").stop(); 72 | } catch (Exception e) { 73 | logger.error("exception occured during sync task process", e); 74 | } 75 | return 0; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/su/interference/rest/HTTPResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 interference 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.rest; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | import org.slf4j.Logger; 33 | import org.slf4j.LoggerFactory; 34 | import su.interference.core.Instance; 35 | 36 | import java.io.InputStream; 37 | import java.io.ByteArrayInputStream; 38 | import java.io.UnsupportedEncodingException; 39 | import java.util.Properties; 40 | 41 | public class HTTPResponse { 42 | 43 | public final String status; 44 | public final String mimeType; 45 | public final InputStream data; 46 | private Properties header = new Properties(); 47 | private final static Logger logger = LoggerFactory.getLogger(HTTPResponse.class); 48 | 49 | public HTTPResponse() { 50 | this.status = HTTPSession.HTTP_200_OK; 51 | this.mimeType = null; 52 | this.data = null; 53 | } 54 | 55 | public HTTPResponse(String status, String mimeType, InputStream data) { 56 | this.status = status; 57 | this.mimeType = mimeType; 58 | this.data = data; 59 | } 60 | 61 | public HTTPResponse(String status, String mimeType, String s) { 62 | this.status = status; 63 | this.mimeType = mimeType; 64 | String cp; 65 | try { 66 | cp = Instance.getInstance().getCodePage(); 67 | } catch (Exception e) { 68 | cp = "UTF-8"; 69 | } 70 | InputStream data_ = null; 71 | try { 72 | data_ = new ByteArrayInputStream(s.getBytes(cp)); 73 | } catch (UnsupportedEncodingException e) { 74 | logger.error(e.getMessage(), e); 75 | } 76 | this.data = data_; 77 | } 78 | 79 | public void addHeader (String name, String value) { 80 | header.put(name, value); 81 | } 82 | 83 | public Properties getHeader() { 84 | return header; 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/main/java/su/interference/sql/SQLGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2019 head systems, ltd 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.sql; 26 | 27 | import su.interference.core.DataChunk; 28 | import su.interference.core.ValueSet; 29 | import su.interference.exception.InternalException; 30 | import su.interference.persistent.Session; 31 | import su.interference.persistent.Table; 32 | 33 | import java.util.*; 34 | import java.net.MalformedURLException; 35 | 36 | /** 37 | * @author Yuriy Glotanov 38 | * @since 1.0 39 | */ 40 | 41 | public class SQLGroup { 42 | 43 | private final DataChunk dc; 44 | private final List cols; 45 | private final SQLGroupFunction[] fset; 46 | 47 | public SQLGroup (DataChunk c, List cols) { 48 | this.dc = c; 49 | this.cols = cols; 50 | this.fset = new SQLGroupFunction[cols.size()]; 51 | for (int i=0; i0) { 53 | fset[i] = new SQLGroupFunction(this.cols.get(i).getFtype()); 54 | } 55 | } 56 | } 57 | 58 | public void add (DataChunk c) throws InternalException { 59 | Object[] os = c.getDcs().getValueSet(); 60 | if (os.length!=this.cols.size()) { throw new InternalException(); } 61 | for (int i=0; i0) { 63 | fset[i].add(os[i]); 64 | } 65 | } 66 | } 67 | 68 | public DataChunk getDC(Table t, Session s) { 69 | ValueSet groupvs = this.dc.getDcs(); 70 | for (int i=0; i0) { 72 | groupvs.getValueSet()[i] = fset[i].getResult(); 73 | } 74 | } 75 | return new DataChunk(groupvs, s, t); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/su/interference/rest/HTTPServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2010-2025 interference 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | package su.interference.rest; 26 | 27 | /** 28 | * @author Yuriy Glotanov 29 | * @since 1.0 30 | */ 31 | 32 | import org.slf4j.Logger; 33 | import org.slf4j.LoggerFactory; 34 | import su.interference.core.Config; 35 | 36 | import java.io.IOException; 37 | import java.net.ServerSocket; 38 | import java.util.concurrent.ExecutorService; 39 | import java.util.concurrent.Executors; 40 | import java.util.concurrent.atomic.AtomicBoolean; 41 | 42 | public class HTTPServer { 43 | private final ExecutorService pool = Executors.newFixedThreadPool(1); 44 | private final static Logger logger = LoggerFactory.getLogger(HTTPServer.class); 45 | 46 | private int port; 47 | private ServerSocket sock; 48 | private static final HTTPServer instance = new HTTPServer(Config.getConfig().MMPORT); 49 | private final AtomicBoolean state = new AtomicBoolean(true); 50 | 51 | public static HTTPServer getInstance() { 52 | return instance; 53 | } 54 | 55 | private HTTPServer(int port) { 56 | try { 57 | this.port = port; 58 | this.sock = new ServerSocket(port); 59 | pool.submit(new Runnable() { 60 | public void run() { 61 | Thread.currentThread().setName("interference-http-server"); 62 | try { 63 | while (state.get()) { 64 | new HTTPSession(sock.accept()); 65 | } 66 | } catch (IOException e) { 67 | logger.error("Exception occured during HTTPServer run: ", e); 68 | } 69 | } 70 | }); 71 | logger.info("HTTP Server started on port " + port); 72 | } catch (IOException e) { 73 | logger.error("Exception occured during HTTPServer start", e); 74 | } 75 | } 76 | 77 | public void stop() { 78 | try { 79 | this.sock.close(); 80 | this.state.set(false); 81 | } catch (IOException e) { 82 | logger.error("Exception occured during HTTPServer stop", e); 83 | } 84 | 85 | } 86 | 87 | } 88 | 89 | --------------------------------------------------------------------------------