1

Add copyright

This commit is contained in:
2018-05-05 19:31:08 +03:00
parent da1564a0cc
commit 408e4cf53b
22 changed files with 334 additions and 22 deletions

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt package com.devsoap.dbt
import com.devsoap.dbt.actions.ExecutorChainAction import com.devsoap.dbt.actions.ExecutorChainAction

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.actions package com.devsoap.dbt.actions
import com.devsoap.dbt.config.DBTConfig import com.devsoap.dbt.config.DBTConfig

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.actions package com.devsoap.dbt.actions
import com.devsoap.dbt.config.DBTConfig import com.devsoap.dbt.config.DBTConfig

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.config package com.devsoap.dbt.config
class DBTConfig { class DBTConfig {

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.config package com.devsoap.dbt.config
class ExecutorConfig { class ExecutorConfig {

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.config package com.devsoap.dbt.config
class LedgerConfig { class LedgerConfig {

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.data package com.devsoap.dbt.data
import groovy.transform.ToString import groovy.transform.ToString

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.data package com.devsoap.dbt.data
class LedgerData implements Serializable { class LedgerData implements Serializable {

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.handlers package com.devsoap.dbt.handlers
import com.devsoap.dbt.config.DBTConfig import com.devsoap.dbt.config.DBTConfig
@@ -5,12 +20,10 @@ import com.devsoap.dbt.data.BlockTransaction
import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.ObjectMapper
import groovy.util.logging.Slf4j import groovy.util.logging.Slf4j
import ratpack.exec.Promise import ratpack.exec.Promise
import ratpack.func.Pair
import ratpack.handling.Context import ratpack.handling.Context
import ratpack.handling.Handler import ratpack.handling.Handler
import ratpack.http.Status import ratpack.http.Status
import ratpack.http.client.HttpClient import ratpack.http.client.HttpClient
import ratpack.http.client.ReceivedResponse
import ratpack.jdbctx.Transaction import ratpack.jdbctx.Transaction
import javax.inject.Inject import javax.inject.Inject

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.handlers package com.devsoap.dbt.handlers
import com.devsoap.dbt.services.LedgerService import com.devsoap.dbt.services.LedgerService

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.handlers package com.devsoap.dbt.handlers
import com.devsoap.dbt.services.LedgerService import com.devsoap.dbt.services.LedgerService

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.handlers package com.devsoap.dbt.handlers
import com.devsoap.dbt.config.DBTConfig import com.devsoap.dbt.config.DBTConfig

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.services package com.devsoap.dbt.services
import com.devsoap.dbt.data.BlockTransaction import com.devsoap.dbt.data.BlockTransaction

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.services package com.devsoap.dbt.services
import com.devsoap.dbt.config.DBTConfig import com.devsoap.dbt.config.DBTConfig

View File

@@ -1,15 +0,0 @@
package com.devsoap.dbt.demo
import org.flywaydb.core.Flyway
import ratpack.service.Service
import ratpack.service.StartEvent
import javax.sql.DataSource
class DatabaseService implements Service {
@Override
void onStart(StartEvent event){
new Flyway(dataSource: event.registry.get(DataSource)).migrate()
}
}

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt.demo
import org.flywaydb.core.Flyway
import ratpack.service.Service
import ratpack.service.StartEvent
import javax.sql.DataSource
class FlywayMigrationService implements Service {
@Override
void onStart(StartEvent event){
new Flyway(dataSource: event.registry.get(DataSource)).migrate()
}
}

View File

@@ -1,11 +1,25 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.devsoap.dbt.DBTModule import com.devsoap.dbt.DBTModule
import com.devsoap.dbt.demo.FlywayMigrationService
import com.devsoap.dbt.services.TransactionManagerService import com.devsoap.dbt.services.TransactionManagerService
import org.flywaydb.core.Flyway
import org.h2.jdbcx.JdbcDataSource import org.h2.jdbcx.JdbcDataSource
import ratpack.form.Form import ratpack.form.Form
import ratpack.handlebars.HandlebarsModule import ratpack.handlebars.HandlebarsModule
import ratpack.http.Status import ratpack.http.Status
import ratpack.service.Service
import javax.sql.DataSource import javax.sql.DataSource
@@ -43,7 +57,7 @@ ratpack {
/* /*
* Migrate Flyway migrations at application start * Migrate Flyway migrations at application start
*/ */
bindInstance { event -> new Flyway(dataSource: event.registry.get(DataSource)).migrate() } as Service bind FlywayMigrationService
} }

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import com.devsoap.dbt.DBTModule import com.devsoap.dbt.DBTModule
import com.devsoap.dbt.config.DBTConfig import com.devsoap.dbt.config.DBTConfig
import org.flywaydb.core.Flyway import org.flywaydb.core.Flyway
@@ -24,11 +39,11 @@ ratpack {
} }
bindInstance(DataSource, new JdbcDataSource(url: 'jdbc:h2:mem:dbtdb;DB_CLOSE_DELAY=-1', user: '')) bindInstance(DataSource, new JdbcDataSource(url: 'jdbc:h2:mem:dbtdb;DB_CLOSE_DELAY=-1', user: ''))
bind DatabaseService bind FlywayMigrationService
} }
} }
class DatabaseService implements Service { class FlywayMigrationService implements Service {
@Override @Override
void onStart(StartEvent event){ void onStart(StartEvent event){

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt package com.devsoap.dbt
import ratpack.groovy.test.GroovyRatpackMainApplicationUnderTest import ratpack.groovy.test.GroovyRatpackMainApplicationUnderTest

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt package com.devsoap.dbt
import com.devsoap.dbt.data.BlockTransaction import com.devsoap.dbt.data.BlockTransaction

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt package com.devsoap.dbt
import com.devsoap.dbt.data.BlockTransaction import com.devsoap.dbt.data.BlockTransaction

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2018 Devsoap Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.devsoap.dbt package com.devsoap.dbt
import com.devsoap.dbt.data.BlockTransaction import com.devsoap.dbt.data.BlockTransaction