-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CAMEL-20333 camel-kotlin-api: moved all internal configuration to Rou…
…teBuilder API, added intercepts and error handling
- Loading branch information
Showing
15 changed files
with
596 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ js-dsl | |
jsh-dsl | ||
jta | ||
kamelet-main | ||
kotlin-api | ||
kotlin-dsl | ||
leveldb | ||
lra | ||
|
15 changes: 15 additions & 0 deletions
15
...log/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/kotlin-api.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"other": { | ||
"kind": "other", | ||
"name": "kotlin-api", | ||
"title": "Kotlin API", | ||
"description": "Camel Kotlin API", | ||
"deprecated": false, | ||
"firstVersion": "4.4.0", | ||
"label": "dsl", | ||
"supportLevel": "Experimental", | ||
"groupId": "org.apache.camel", | ||
"artifactId": "camel-kotlin-api", | ||
"version": "4.4.0-SNAPSHOT" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
dsl/camel-kotlin-api/src/main/kotlin/org/apache/camel/kotlin/model/InterceptDsl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 org.apache.camel.kotlin.model | ||
|
||
import org.apache.camel.Predicate | ||
import org.apache.camel.kotlin.CamelDslMarker | ||
import org.apache.camel.kotlin.StepsDsl | ||
import org.apache.camel.model.InterceptDefinition | ||
|
||
@CamelDslMarker | ||
class InterceptDsl( | ||
val def: InterceptDefinition | ||
) { | ||
|
||
fun onWhen(onWhen: Predicate) { | ||
def.`when`(onWhen) | ||
} | ||
|
||
fun outputs(i: StepsDsl.() -> Unit) { | ||
StepsDsl(def).apply(i) | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
dsl/camel-kotlin-api/src/main/kotlin/org/apache/camel/kotlin/model/InterceptFromDsl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 org.apache.camel.kotlin.model | ||
|
||
import org.apache.camel.kotlin.CamelDslMarker | ||
import org.apache.camel.kotlin.StepsDsl | ||
import org.apache.camel.model.InterceptFromDefinition | ||
|
||
@CamelDslMarker | ||
class InterceptFromDsl( | ||
val def: InterceptFromDefinition | ||
) { | ||
|
||
fun uri(uri: String) { | ||
def.uri = uri | ||
} | ||
|
||
fun outputs(i: StepsDsl.() -> Unit) { | ||
StepsDsl(def).apply(i) | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...el-kotlin-api/src/main/kotlin/org/apache/camel/kotlin/model/InterceptSendToEndpointDsl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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 org.apache.camel.kotlin.model | ||
|
||
import org.apache.camel.Predicate | ||
import org.apache.camel.kotlin.CamelDslMarker | ||
import org.apache.camel.kotlin.StepsDsl | ||
import org.apache.camel.model.InterceptSendToEndpointDefinition | ||
|
||
@CamelDslMarker | ||
class InterceptSendToEndpointDsl( | ||
val def: InterceptSendToEndpointDefinition | ||
) { | ||
|
||
fun outputs(i: StepsDsl.() -> Unit) { | ||
StepsDsl(def).apply(i) | ||
} | ||
|
||
fun onWhen(onWhen: Predicate) { | ||
def.`when`(onWhen) | ||
} | ||
|
||
fun skipSendToOriginalEndpoint(skipSendToOriginalEndpoint: Boolean) { | ||
def.skipSendToOriginalEndpoint = skipSendToOriginalEndpoint.toString() | ||
} | ||
|
||
fun skipSendToOriginalEndpoint(skipSendToOriginalEndpoint: String) { | ||
def.skipSendToOriginalEndpoint = skipSendToOriginalEndpoint.toString() | ||
} | ||
|
||
fun afterUri(afterUri: String) { | ||
def.afterUri(afterUri) | ||
} | ||
} |
Oops, something went wrong.