Skip to content

Commit 8d40f86

Browse files
committed
GH-4037: Rename packagings and cmd names in Fuseki
1 parent da35f7f commit 8d40f86

10 files changed

Lines changed: 81 additions & 35 deletions

File tree

jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/FusekiServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class FusekiServer {
117117
/**
118118
* Construct a Fuseki server from command line arguments.
119119
* The return server has not been started.
120-
* @deprecated Use {@link FusekiMain#construct} or {@link FusekiRunner#basic()}
120+
* @deprecated Use {@link FusekiMain#construct} or {@link FusekiRunner#serverBasic()}
121121
*/
122122
@Deprecated
123123
static public FusekiServer construct(String... args) {
@@ -127,7 +127,7 @@ static public FusekiServer construct(String... args) {
127127
/**
128128
* Run a Fuseki server using the command line arguments for setup
129129
* The returned server has been started.
130-
* @deprecated Use {@link FusekiMain#run} or {@link FusekiRunner#basic()}
130+
* @deprecated Use {@link FusekiMain#run} or {@link FusekiRunner#serverBasic()}
131131
*/
132132
@Deprecated
133133
static public FusekiServer run(String...args) {

jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiBasicCmd.java

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,12 @@
2121

2222
package org.apache.jena.fuseki.main.cmds;
2323

24-
import org.apache.jena.fuseki.main.FusekiMain;
25-
import org.apache.jena.fuseki.main.runner.FusekiRunner;
26-
27-
/** Fuseki command that runs a minimal Fuseki server. No addition modules, no UI.
28-
* <p>
29-
* Use {@code --conf=} for multiple datasets and specific service names.
30-
* <p>
31-
* The command line dataset setup only supports a single dataset.
24+
/**
25+
* @deprecated Use {@link FusekiServerBasicCmd}
3226
*/
27+
@Deprecated(forRemoval = true)
3328
public class FusekiBasicCmd {
34-
/**
35-
* Build and run, a server based on command line syntax. This operation does not
36-
* return. See {@link FusekiMain#build} to build a server using command line
37-
* syntax but not start it.
38-
*/
39-
static public void main(String... args) {
40-
RunFuseki.run(args, FusekiRunner::execBasic);
29+
public static void main(String[] args) {
30+
FusekiServerBasicCmd.main(args);
4131
}
4232
}

jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiCmd.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121

2222
package org.apache.jena.fuseki.main.cmds;
2323

24-
/** Reserved. Entry point used by the combined jar and "--jar" (from v6.0.0) */
24+
/**
25+
* Reserved. Entry point used by the combined jar and "--jar" (from v6.0.0)
26+
* @deprecated Do not use. Equivalent to {@link FusekiServerUICmd}
27+
*/
28+
29+
@Deprecated(forRemoval = true)
2530
public class FusekiCmd {
2631
static public void main(String... args) {
2732
FusekiServerUICmd.main(args);
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*
19+
* SPDX-License-Identifier: Apache-2.0
20+
*/
21+
22+
package org.apache.jena.fuseki.main.cmds;
23+
24+
import org.apache.jena.fuseki.main.FusekiMain;
25+
import org.apache.jena.fuseki.main.runner.FusekiRunner;
26+
27+
/** Fuseki command that runs a minimal Fuseki server. No addition modules, no UI.
28+
* <p>
29+
* Use {@code --conf=} for multiple datasets and specific service names.
30+
* <p>
31+
* The command line dataset setup only supports a single dataset.
32+
*/
33+
public class FusekiServerBasicCmd {
34+
/**
35+
* Build and run, a server based on command line syntax. This operation does not
36+
* return. See {@link FusekiMain#build} to build a server using command line
37+
* syntax but not start it.
38+
*/
39+
static public void main(String... args) {
40+
RunFuseki.run(args, FusekiRunner::execBasic);
41+
}
42+
}

jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiServerCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121

2222
package org.apache.jena.fuseki.main.cmds;
2323

24-
/**
24+
/**
2525
* Old name used in the fuseki-server script up to v5.6.0
26+
* @deprecated Do not use. Equivalent to {@link FusekiServerUICmd}
2627
*/
28+
@Deprecated(forRemoval = true)
2729
public class FusekiServerCmd {
2830
static public void main(String... args) {
2931
FusekiServerUICmd.main(args);

jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/cmds/FusekiServerPlainCmd.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* Fuseki command that runs a Fuseki server with all function except with UI.
29-
* Shiro must be configured using the command line {@code --shiro=...}
29+
* Shiro is configured using the command line {@code --shiro=...}
3030
* or using environment {@code FUSEKI_SHIRO}.
3131
* <p>
3232
* Use {@code --conf=} for multiple datasets and specific service names.
@@ -44,4 +44,3 @@ static public void main(String... args) {
4444
RunFuseki.run(args, FusekiRunner::execServerPlain);
4545
}
4646
}
47-

jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/runner/FusekiArgs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ protected String getCommandName() {
211211
}
212212

213213
private void argumentsSetup() {
214-
modVersion.addClass("Fuseki", Fuseki.class);
214+
//modVersion.addClass("Fuseki", Fuseki.class);
215215

216216
getUsage().startCategory("Fuseki");
217217
add(argConfig, "--config=FILE",

jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/runner/FusekiRunner.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ public class FusekiRunner {
7272
*/
7373

7474
enum FusekiForm {
75-
BASIC("basic"), MAIN("main"), SERVER_PLAIN("server/plain"), SERVER("server/ui");
75+
SERVER_BASIC("server/basic"), SERVER_MAIN("server/main"), SERVER_PLAIN("server/plain"), SERVER_UI("server/ui");
7676
final String fusekiFormName;
7777
FusekiForm(String string) { this.fusekiFormName = string; }
7878
}
7979

8080
/** Minimal server - e.g. embedded use and testing. */
8181
public static void execBasic(String...args) {
82-
announcementExec(FusekiForm.BASIC);
82+
announcementExec(FusekiForm.SERVER_BASIC);
8383
runnerBasic().exec(args);
8484
}
8585

8686
/** Basic server */
8787
public static void execMain(String...args) {
88-
announcementExec(FusekiForm.MAIN);
88+
announcementExec(FusekiForm.SERVER_MAIN);
8989
runnerMain().exec(args);
9090
}
9191

@@ -97,19 +97,22 @@ public static void execServerPlain(String...args) {
9797

9898
/** General server, with UI */
9999
public static void execServerUI(String...args) {
100-
announcementExec(FusekiForm.SERVER);
100+
announcementExec(FusekiForm.SERVER_UI);
101101
runnerServerUI().exec(args);
102102
}
103103

104104
/** Minimal server - e.g. embedded use and testing */
105105
public static FusekiServer runAsyncBasic(String...args) {
106-
announcementAsync(FusekiForm.BASIC);
106+
announcementAsync(FusekiForm.SERVER_BASIC);
107107
return runnerBasic().runAsync(args);
108108
}
109109

110-
/** Basic server */
110+
/**
111+
* Server with ping, Shiro and Prometheus.
112+
* See {@link FusekiRunner#serverMain()}.
113+
*/
111114
public static FusekiServer runAsyncMain(String...args) {
112-
announcementAsync(FusekiForm.MAIN);
115+
announcementAsync(FusekiForm.SERVER_MAIN);
113116
return runnerMain().runAsync(args);
114117
}
115118

@@ -121,19 +124,24 @@ public static FusekiServer runAsyncServerPlain(String...args) {
121124

122125
/** General server, with UI */
123126
public static FusekiServer runAsyncServerUI(String...args) {
124-
announcementAsync(FusekiForm.SERVER);
127+
announcementAsync(FusekiForm.SERVER_UI);
125128
return runnerServerUI().runAsync(args);
126129
}
127130

128131
// @formatter:off
132+
129133
/** Minimal server - e.g. embedded use and testing */
130-
public static Runner basic() { return runnerBasic(); }
134+
public static Runner serverBasic() { return runnerBasic(); }
135+
131136
/** Basic server */
132-
public static Runner main() { return runnerMain(); }
137+
public static Runner serverMain() { return runnerMain(); }
138+
133139
/** All available server functionality, except admin functionality; no UI; Shiro configuration by command line or environment variable. */
134140
public static Runner serverPlain() { return runnerServerPlain(); }
141+
135142
/** General server, with UI */
136143
public static Runner serverUI() { return runnerServerUI(); }
144+
137145
// @formatter:on
138146

139147
// Banners

jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/main/TestFusekiStart.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ public class TestFusekiStart {
7575
}
7676

7777
@Test public void runner_01() {
78-
FusekiServer server = FusekiRunner.basic().runAsync("--port=0", "--empty");
78+
FusekiServer server = FusekiRunner.serverBasic().runAsync("--port=0", "--empty");
7979
server.stop();
8080
}
8181

8282
@Test public void runner_02() {
83-
FusekiServer server = FusekiRunner.main().runAsync("--port=0", "--empty");
83+
FusekiServer server = FusekiRunner.serverMain().runAsync("--port=0", "--empty");
8484
server.stop();
8585
}
8686

jena-fuseki2/jena-fuseki-main/src/test/java/org/apache/jena/fuseki/server/TestFusekiServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void runCmdLine() {
5858
String runBase = serverBase+"1";
5959
setup(runBase);
6060
// Build-run command line
61-
FusekiServer server = FusekiRunner.basic().runAsync("--port=0", "--empty");
61+
FusekiServer server = FusekiRunner.serverBasic().runAsync("--port=0", "--empty");
6262
try {
6363
int port = server.getPort();
6464
assertNotEquals(0, port, "Port is zero after async start");

0 commit comments

Comments
 (0)