Skip to content

Commit 1f9c7ba

Browse files
author
Sravan Kottam
committed
Merge branch 'release-3.0.0-EA3'
2 parents df4ba2d + d6e2c7e commit 1f9c7ba

File tree

267 files changed

+51279
-28098
lines changed

Some content is hidden

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

267 files changed

+51279
-28098
lines changed

CONTRIBUTING.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
= Contributor License Agreement ("Agreement")
2+
3+
Thank you for your interest in an open source project administered by
4+
the MarkLogic Corporation (the "Project"). This Agreement states the
5+
terms under which you, the person listed below, may contribute to the
6+
Project any software, modifications or additions, bug fixes,
7+
documentation, or any other materials that you provide (whether
8+
electronically, verbally, or in written form) to MarkLogic
9+
Corporation ("MarkLogic" or "us") related to the Project (each a
10+
"Contribution"). This license is for your protection as well as the
11+
protection of MarkLogic and its licensees. This Agreement does not
12+
otherwise change your rights to use your own Contributions for any
13+
other purpose. Please complete the following information about you and
14+
the Contributions and either (a) sign electronically by filling out
15+
the form below or (b) sign and submit the form to the contact
16+
information below.
17+
18+
If you develop software or create software code as a part of your
19+
employment, or if your employer is in the business of developing
20+
software, or otherwise may claim rights in the Contributions, please
21+
provide information about your employer's policy on contributing to
22+
open source projects below, including the name of the supervisor to
23+
contact in connection with such contributions.
24+
25+
If you have questions about this Agreement, please contact us at
26+
27+
28+
.You and MarkLogic acknowledge and agree:
29+
. Control of the Project. We, in our sole discretion, determine the
30+
Contributions that will be included in the Project. You understand
31+
that this Agreement, and your submission of any Contribution, does
32+
not guarantee that any such Contributions will be included in the
33+
Project.
34+
. License Grants. You hereby grant to MarkLogic, a perpetual,
35+
non-exclusive, irrevocable, worldwide, royalty-free and fully
36+
paid-up, sublicenseable, and transferable license under all of your
37+
relevant intellectual property rights (including copyright, patent,
38+
trade secret, and any other rights), to use, copy, modify, prepare
39+
derivative works of, distribute and publicly perform and publicly
40+
display your Contributions on any licensing terms, in our sole
41+
discretion, including without limitation: (a) the GNU General Public
42+
License, the GNU Lesser General Public License, the Common Public
43+
License, the MIT License, the Apache License, or the Berkeley
44+
Software Distribution license; and (b) binary, proprietary, or
45+
commercial licenses. You hereby grant to MarkLogic and to recipients
46+
of the Project a perpetual, worldwide, non-exclusive, fully-paid up
47+
and royalty-free, irrevocable patent license to make, have made, use,
48+
offer to sell, sell, import, and otherwise transfer the Project,
49+
where such license applies only to those patent claims licensable by
50+
you that are necessarily infringed by your Contributions alone or by
51+
combination of your Contributions with the Project.
52+
. Ownership. Except for the licenses granted herein, you reserve all
53+
right, title, and interest in and to your Contributions.
54+
. Your Representations. You represent that you are able and entitled to
55+
grant us the above license rights. You represent that your
56+
Contributions are your original works of authorship, and to your
57+
knowledge, no other person claims, or has the right to claim, any
58+
right in any intellectual property right, including without
59+
limitation invention or patent rights, related to your Contributions.
60+
You also represent that you are not legally obligated, whether by
61+
entering into an agreement or otherwise, in any way that conflicts
62+
with the terms of the foregoing license grant. If your employer has
63+
rights to intellectual property that you create, you represent that
64+
you have received permission to make your Contributions on behalf of
65+
that employer, or that your employer has waived such rights for your
66+
Contributions.
67+
. No Implied Warranties. MarkLogic acknowledges that, except as
68+
explicitly described in this Agreement, your Contribution is
69+
provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
70+
ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION,
71+
ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
72+
MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
73+
74+
== Complete and sign
75+
76+
----
77+
Full name: ____________________________________________________________
78+
79+
Email address: ____________________________________________________________
80+
81+
Postal address:
82+
83+
Street: _____________________________________________________
84+
85+
_____________________________________________________
86+
87+
City: _____________________________________________________
88+
89+
State or province: _____________________________________________________
90+
91+
Postal code: _____________________________________________________
92+
93+
Country: _____________________________________________________
94+
95+
Phone number: ____________________________________________________________
96+
97+
98+
Corporate contributor information:
99+
100+
____________________________________________________________
101+
102+
____________________________________________________________
103+
104+
____________________________________________________________
105+
106+
____________________________________________________________
107+
108+
109+
Signature: ____________________________________________________________
110+
111+
----
112+
113+
== Signing Alternatives
114+
115+
You may print the document and send the original to:
116+
117+
MarkLogic Corporation +
118+
Attn: Contract Administrator +
119+
999 Skyway Road, +
120+
San Carlos, CA 94070 +
121+
USA +
122+
123+
You may also send a scanned PDF of the form to
124+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ You might want to skip the tests until you have configured a test database and R
5252

5353
> mvn package -Dmaven.test.skip=true
5454
55+
## Support
56+
The MarkLogic Java Client API is maintained by MarkLogic Engineering and distributed under the [Apache 2.0 license](https://github.com/marklogic/java-client-api/blob/master/LICENSE). It is designed for use in production applications with MarkLogic Server. Everyone is encouraged to file bug reports, feature requests, and pull requests through GitHub. This input is critical and will be carefully considered, but we can’t promise a specific resolution or timeframe for any request. In addition, MarkLogic provides technical support for [release tags](https://github.com/marklogic/java-client-api/releases) of the Java Client API to licensed customers under the terms outlined in the [Support Handbook](http://www.marklogic.com/files/Mark_Logic_Support_Handbook.pdf). For more information or to sign up for support, visit [help.marklogic.com](http://help.marklogic.com).

pom.xml

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<groupId>com.marklogic</groupId>
55
<artifactId>client-api-java</artifactId>
66
<packaging>jar</packaging>
7-
<version>3.0.0-EA2</version>
7+
<version>3.0.0-EA3</version>
88
<name>client-api-java</name>
99
<url>http://developer.marklogic.com</url>
1010
<properties>
11-
<javadoc-title>${project.name} 2.0 ${maven.build.timestamp}</javadoc-title>
11+
<javadoc-title>${project.name} 3.0.0</javadoc-title>
1212
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<github.global.server>github</github.global.server>
@@ -138,7 +138,7 @@
138138
<plugin>
139139
<groupId>com.github.github</groupId>
140140
<artifactId>site-maven-plugin</artifactId>
141-
<version>0.9</version>
141+
<version>0.10</version>
142142
<configuration>
143143
<message>Maven artifacts for ${project.version}</message>
144144
<merge>true</merge>
@@ -161,8 +161,44 @@
161161
</plugin>
162162
</plugins>
163163
</build>
164+
<profiles>
165+
<profile>
166+
<id>Java 8</id>
167+
<activation>
168+
<jdk>1.8</jdk>
169+
</activation>
170+
<properties>
171+
<!-- Disable Java 8 overly strict javadoc linter when building with Java 8
172+
http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
173+
-->
174+
<additionalparam>-Xdoclint:none</additionalparam>
175+
</properties>
176+
</profile>
177+
</profiles>
164178
<dependencies>
165179
<!-- direct build / run dependencies -->
180+
<!--
181+
<dependency>
182+
<groupId>com.sun.jersey</groupId>
183+
<artifactId>jersey-client</artifactId>
184+
<version>1.17</version>
185+
</dependency>
186+
<dependency>
187+
<groupId>com.sun.jersey.contribs</groupId>
188+
<artifactId>jersey-apache-client4</artifactId>
189+
<version>1.17</version>
190+
</dependency>
191+
<dependency>
192+
<groupId>com.sun.jersey.contribs</groupId>
193+
<artifactId>jersey-multipart</artifactId>
194+
<version>1.17</version>
195+
</dependency>
196+
<dependency>
197+
<groupId>org.glassfish.jersey.media</groupId>
198+
<artifactId>jersey-media-multipart</artifactId>
199+
<version>2.12</version>
200+
</dependency>
201+
-->
166202
<dependency>
167203
<groupId>com.sun.jersey</groupId>
168204
<artifactId>jersey-client</artifactId>
@@ -181,7 +217,7 @@
181217
<dependency>
182218
<groupId>ch.qos.logback</groupId>
183219
<artifactId>logback-classic</artifactId>
184-
<version>1.0.12</version>
220+
<version>1.1.2</version>
185221
</dependency>
186222
<dependency>
187223
<groupId>commons-logging</groupId>
@@ -203,11 +239,6 @@
203239
<artifactId>mimepull</artifactId>
204240
<version>1.9.4</version>
205241
</dependency>
206-
<dependency>
207-
<groupId>ch.qos.logback</groupId>
208-
<artifactId>logback-core</artifactId>
209-
<version>1.0.12</version>
210-
</dependency>
211242
<dependency>
212243
<groupId>org.slf4j</groupId>
213244
<artifactId>slf4j-api</artifactId>

src/main/java/com/marklogic/client/DatabaseClient.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.marklogic.client.document.JSONDocumentManager;
2525
import com.marklogic.client.document.TextDocumentManager;
2626
import com.marklogic.client.document.XMLDocumentManager;
27+
import com.marklogic.client.eval.ServerEvaluationCall;
2728
import com.marklogic.client.extensions.ResourceManager;
2829
import com.marklogic.client.admin.ExtensionMetadata;
2930
import com.marklogic.client.query.QueryManager;
@@ -106,7 +107,7 @@ public interface DatabaseClient {
106107
* Creates a manager for configuring the REST server for the database. The
107108
* ServerConfigurationManager can persist query options and transforms or
108109
* set properties of the server. The application must have rest-admin
109-
* privilieges to use the ServerConfigurationManager.
110+
* privileges to use the ServerConfigurationManager.
110111
*
111112
* @return a manager for the server properties or administrative resources
112113
*/
@@ -177,4 +178,13 @@ public <T extends ResourceManager> T init(String resourceName, T resourceManager
177178
* @return the object implementing communication with the server
178179
*/
179180
public Object getClientImplementation();
181+
182+
/**
183+
* Creates a ServerEvaluationCall for eval and invoke of server-side xquery or
184+
* javascript code. Eval requires the xdbc:eval privilege and invoke requires the
185+
* xdbc:invoke privilege. If this DatabaseClient is pointed at a database different
186+
* than the default for this REST server, you will need the xdbc:eval-in or xdbc:invoke-in
187+
* privilege.
188+
*/
189+
public ServerEvaluationCall newServerEval();
180190
}

src/main/java/com/marklogic/client/DatabaseClientFactory.java

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,21 @@ private DatabaseClientFactory() {
207207
* @return a new client for making database requests
208208
*/
209209
static public DatabaseClient newClient(String host, int port) {
210-
return newClient(host, port, null, null, null, null, null);
210+
return newClient(host, port, null, null, null, null, null, null);
211+
}
212+
213+
/**
214+
* Creates a client to access the database by means of a REST server
215+
* without any authentication. Such clients can be convenient for
216+
* experimentation but should not be used in production.
217+
*
218+
* @param host the host with the REST server
219+
* @param port the port for the REST server
220+
* @param database the database to access (default: configured database for the REST server)
221+
* @return a new client for making database requests
222+
*/
223+
static public DatabaseClient newClient(String host, int port, String database) {
224+
return newClient(host, port, database, null, null, null, null, null);
211225
}
212226

213227
/**
@@ -221,7 +235,21 @@ static public DatabaseClient newClient(String host, int port) {
221235
* @return a new client for making database requests
222236
*/
223237
static public DatabaseClient newClient(String host, int port, String user, String password, Authentication type) {
224-
return newClient(host, port, user, password, type, null, null);
238+
return newClient(host, port, null, user, password, type, null, null);
239+
}
240+
/**
241+
* Creates a client to access the database by means of a REST server.
242+
*
243+
* @param host the host with the REST server
244+
* @param port the port for the REST server
245+
* @param database the database to access (default: configured database for the REST server)
246+
* @param user the user with read, write, or administrative privileges
247+
* @param password the password for the user
248+
* @param type the type of authentication applied to the request
249+
* @return a new client for making database requests
250+
*/
251+
static public DatabaseClient newClient(String host, int port, String database, String user, String password, Authentication type) {
252+
return newClient(host, port, database, user, password, type, null, null);
225253
}
226254
/**
227255
* Creates a client to access the database by means of a REST server.
@@ -235,7 +263,22 @@ static public DatabaseClient newClient(String host, int port, String user, Strin
235263
* @return a new client for making database requests
236264
*/
237265
static public DatabaseClient newClient(String host, int port, String user, String password, Authentication type, SSLContext context) {
238-
return newClient(host, port, user, password, type, context, SSLHostnameVerifier.COMMON);
266+
return newClient(host, port, null, user, password, type, context, SSLHostnameVerifier.COMMON);
267+
}
268+
/**
269+
* Creates a client to access the database by means of a REST server.
270+
*
271+
* @param host the host with the REST server
272+
* @param port the port for the REST server
273+
* @param database the database to access (default: configured database for the REST server)
274+
* @param user the user with read, write, or administrative privileges
275+
* @param password the password for the user
276+
* @param type the type of authentication applied to the request
277+
* @param context the SSL context for authenticating with the server
278+
* @return a new client for making database requests
279+
*/
280+
static public DatabaseClient newClient(String host, int port, String database, String user, String password, Authentication type, SSLContext context) {
281+
return newClient(host, port, database, user, password, type, context, SSLHostnameVerifier.COMMON);
239282
}
240283
/**
241284
* Creates a client to access the database by means of a REST server.
@@ -250,14 +293,32 @@ static public DatabaseClient newClient(String host, int port, String user, Strin
250293
* @return a new client for making database requests
251294
*/
252295
static public DatabaseClient newClient(String host, int port, String user, String password, Authentication type, SSLContext context, SSLHostnameVerifier verifier) {
253-
DatabaseClientImpl client = newClientImpl(host, port, user, password, type, context, verifier);
296+
DatabaseClientImpl client = newClientImpl(host, port, null, user, password, type, context, verifier);
297+
client.setHandleRegistry(getHandleRegistry().copy());
298+
return client;
299+
}
300+
/**
301+
* Creates a client to access the database by means of a REST server.
302+
*
303+
* @param host the host with the REST server
304+
* @param port the port for the REST server
305+
* @param database the database to access (default: configured database for the REST server)
306+
* @param user the user with read, write, or administrative privileges
307+
* @param password the password for the user
308+
* @param type the type of authentication applied to the request
309+
* @param context the SSL context for authenticating with the server
310+
* @param verifier a callback for checking hostnames
311+
* @return a new client for making database requests
312+
*/
313+
static public DatabaseClient newClient(String host, int port, String database, String user, String password, Authentication type, SSLContext context, SSLHostnameVerifier verifier) {
314+
DatabaseClientImpl client = newClientImpl(host, port, database, user, password, type, context, verifier);
254315
client.setHandleRegistry(getHandleRegistry().copy());
255316
return client;
256317
}
257-
static private DatabaseClientImpl newClientImpl(String host, int port, String user, String password, Authentication type, SSLContext context, SSLHostnameVerifier verifier) {
318+
static private DatabaseClientImpl newClientImpl(String host, int port, String database, String user, String password, Authentication type, SSLContext context, SSLHostnameVerifier verifier) {
258319
logger.debug("Creating new database client for server at "+host+":"+port);
259320
JerseyServices services = new JerseyServices();
260-
services.connect(host, port, user, password, type, context, verifier);
321+
services.connect(host, port, database, user, password, type, context, verifier);
261322

262323
if (clientConfigurator != null) {
263324
((HttpClientConfigurator) clientConfigurator).configure(
@@ -337,6 +398,7 @@ static public class Bean implements Serializable {
337398

338399
private String host;
339400
private int port;
401+
private String database;
340402
private String user;
341403
private String password;
342404
private Authentication authentication;
@@ -510,7 +572,7 @@ public void registerDefaultHandles() {
510572
* @return a new client for making database requests
511573
*/
512574
public DatabaseClient newClient() {
513-
DatabaseClientImpl client = newClientImpl(host, port, user, password, authentication, context, verifier);
575+
DatabaseClientImpl client = newClientImpl(host, port, database, user, password, authentication, context, verifier);
514576
client.setHandleRegistry(getHandleRegistry().copy());
515577

516578
return client;

src/main/java/com/marklogic/client/MarkLogicBindingException.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ public class MarkLogicBindingException extends RuntimeException {
2929
static final private Logger logger = LoggerFactory
3030
.getLogger(MarkLogicBindingException.class);
3131

32+
public MarkLogicBindingException(String message, Throwable e) {
33+
super(message, e);
34+
}
35+
3236
public MarkLogicBindingException(Exception e) {
37+
super(e);
3338
e.printStackTrace();
3439
}
3540

0 commit comments

Comments
 (0)