Skip to content

Commit 1db7fe1

Browse files
author
ehennum
committed
Merge branch 'develop-failover' into develop
2 parents 67680df + c314ccd commit 1db7fe1

File tree

305 files changed

+4098
-7765
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+4098
-7765
lines changed

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestOpticOnFromSparql.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ public void setUpBeforTest() {
100100
* @param client
101101
* @param filename
102102
* @param uri
103-
* @param type
104103
* @throws IOException
105104
* @throws ParserConfigurationException
106105
* @throws SAXException

marklogic-client-api/build.gradle

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,14 @@ dependencies {
3333
compileOnly group: 'com.opencsv', name: 'opencsv', version: '4.1'
3434
compileOnly group: 'org.geonames', name: 'geonames', version:'1.0'
3535
compileOnly group: 'org.springframework', name: 'spring-jdbc', version: '5.0.4.RELEASE'
36-
// uncomment to build XOMHandle
37-
// compileOnly group: 'com.io7m.xom', name: 'xom', version: '1.2.10'
38-
}
39-
40-
// comment the exclusion to build XOMHandle
41-
compileJava {
42-
exclude (
43-
'com/marklogic/client/extra/xom/**',
44-
'com/marklogic/client/example/handle/XOMHandleExample.java'
45-
)
46-
}
47-
48-
// comment the exclusion to test XOMHandle
49-
compileTestJava {
50-
exclude (
51-
'com/marklogic/client/test/extra/XOMHandleTest.java'
52-
)
5336
}
5437

5538
jar {
5639
exclude (
5740
'search.xsd', 'search-bindings.xjb', 'query-options-template.xml',
5841
'com/marklogic/client/example/**', 'data/**', 'Example.properties',
5942
'example/**', 'scripts/**', '*.txt', 'property.xsd',
60-
'restapi-bindings.xjb', 'security.xsd',
61-
'com/marklogic/client/extra/xom/**'
43+
'restapi-bindings.xjb', 'security.xsd'
6244
)
6345
}
6446
task sourcesJar(type: Jar) {
@@ -78,9 +60,7 @@ javadoc {
7860
options.use = true
7961
options.addBooleanOption('html4', true)
8062
exclude([
81-
'**/impl/**', '**/jaxb/**', '**/test/**',
82-
'com/marklogic/client/extra/xom/**',
83-
'com/marklogic/client/example/handle/XOMHandleExample.java'
63+
'**/impl/**', '**/jaxb/**', '**/test/**'
8464
])
8565
// workaround for bug in options.docFilesSubDirs = true
8666
doLast{

marklogic-client-api/src/main/java/com/marklogic/client/MarkLogicServerException.java

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
* the FailedRequest Java object. The MarkLogicServerException contains the FailedRequest object which
2424
* is incorporated into getMessage() or can be examined via getFailedRequest()
2525
*
26-
* @see FailedRequest
27-
*
2826
*/
2927
@SuppressWarnings("serial")
3028
public abstract class MarkLogicServerException extends RuntimeException {
@@ -60,6 +58,43 @@ else if (failedRequest != null) {
6058
else return super.getMessage();
6159
}
6260

61+
/**
62+
* Gets the HTTP status code (if any) associated with the error on the server.
63+
* @return the status code
64+
*/
65+
public int getServerStatusCode() {
66+
return (failedRequest == null) ? null : failedRequest.getStatusCode();
67+
}
68+
/**
69+
* Gets the HTTP status message (if any) associated with the error on the server.
70+
* @return the status message
71+
*/
72+
public String getServerStatus() {
73+
return (failedRequest == null) ? null : failedRequest.getStatus();
74+
}
75+
/**
76+
* Gets the error code (if any) specific to the error on the server.
77+
* @return the error code
78+
*/
79+
public String getServerMessageCode() {
80+
return (failedRequest == null) ? null : failedRequest.getMessageCode();
81+
}
82+
/**
83+
* Gets the error message (if any) specific to the error on the server.
84+
* @return the error message
85+
*/
86+
public String getServerMessage() {
87+
return (failedRequest == null) ? null : failedRequest.getMessage();
88+
}
89+
/**
90+
* Gets the stack trace (if any) specific to the error on the server.
91+
* @return the server stack trace
92+
*/
93+
public String getServerStackTrace() {
94+
return (failedRequest == null) ? null : failedRequest.getStackTrace();
95+
}
96+
97+
@Deprecated
6398
public FailedRequest getFailedRequest() {
6499
return failedRequest;
65100
}

marklogic-client-api/src/main/java/com/marklogic/client/dataservices/CallBatcher.java renamed to marklogic-client-api/src/main/java/com/marklogic/client/dataservices/impl/CallBatcher.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package com.marklogic.client.dataservices;
16+
package com.marklogic.client.dataservices.impl;
1717

1818
import java.util.concurrent.TimeUnit;
1919
import java.util.function.Function;
2020
import java.util.stream.Stream;
2121

22+
import com.marklogic.client.datamovement.BatchEvent;
2223
import com.marklogic.client.datamovement.Batcher;
2324
import com.marklogic.client.datamovement.DataMovementManager;
2425
import com.marklogic.client.datamovement.ForestConfiguration;
2526
import com.marklogic.client.datamovement.JobTicket;
26-
import com.marklogic.client.dataservices.CallManager.CallArgs;
27-
import com.marklogic.client.dataservices.CallManager.CallEvent;
27+
import com.marklogic.client.dataservices.impl.CallManager.CallArgs;
2828

2929
/**
3030
* A CallBatcher executes multiple concurrent calls to a Data Service endpoint
@@ -45,7 +45,7 @@
4545
* @param <W> the type of the input passed to the add() method of the CallBatcher
4646
* @param <E> the CallEvent subinterface for the results of a successful call
4747
*/
48-
public interface CallBatcher<W,E extends CallManager.CallEvent> extends Batcher {
48+
public interface CallBatcher<W,E extends CallBatcher.CallEvent> extends Batcher {
4949
/**
5050
* Registers a lambda function for processing the CallEvent for a successful call.
5151
* @param listener the lambda function for a successful result
@@ -258,7 +258,7 @@ public interface CallBatcher<W,E extends CallManager.CallEvent> extends Batcher
258258
* then call the batcher() method on the caller to use the CallBatcherBuilder.
259259
* @param <E> the CallEvent subinterface for the results of a successful call
260260
*/
261-
interface CallBatcherBuilder<E extends CallManager.CallEvent> {
261+
interface CallBatcherBuilder<E extends CallEvent> {
262262
/**
263263
* Builds a CallBatcher that takes input values for a parameter, making
264264
* a call after accumulating a batch of values for the parameter.
@@ -290,9 +290,32 @@ interface CallBatcherBuilder<E extends CallManager.CallEvent> {
290290
* @return a CallBatcher for chaining with other methods.
291291
*/
292292
CallBatcher<Void,E> forArgsGenerator(CallArgsGenerator<E> generator);
293+
/**
294+
* Takes a callback and the forest name for generating the arguments for calls.
295+
* The callback takes the CallEvent and the forest name from the previous call in
296+
* the thread and returns the CallArgs for the next call in the thread.
297+
*
298+
* @param generator instance implementing {@link CallArgsGenerator}
299+
* @param forestName is the name of the forest.
300+
* @return a CallBatcher for chaining with other methods.
301+
*/
302+
CallBatcher<Void,E> forArgsGenerator(CallArgsGenerator<E> generator, String forestName);
293303
}
294304

295305
@FunctionalInterface
296306
public interface CallArgsGenerator<E extends CallEvent> extends Function<E, CallArgs> {
297307
}
308+
309+
interface CallEvent extends BatchEvent {
310+
CallArgs getArgs();
311+
CallManager.EndpointDefiner getEndpointDefiner();
312+
}
313+
314+
interface ManyCallEvent<R> extends CallEvent {
315+
Stream<R> getItems();
316+
}
317+
318+
interface OneCallEvent<R> extends CallEvent {
319+
R getItem();
320+
}
298321
}

0 commit comments

Comments
 (0)