@@ -130,10 +130,6 @@ public class NativeBroker implements DBBroker {
130
130
public static final String EXIST_STATISTICS_LOGGER = "org.exist.statistics" ;
131
131
private static final Logger LOG_STATS = LogManager .getLogger (EXIST_STATISTICS_LOGGER );
132
132
133
- public static final byte PREPEND_DB_ALWAYS = 0 ;
134
- public static final byte PREPEND_DB_NEVER = 1 ;
135
- public static final byte PREPEND_DB_AS_NEEDED = 2 ;
136
-
137
133
public static final byte COLLECTIONS_DBX_ID = 0 ;
138
134
public static final byte VALUES_DBX_ID = 2 ;
139
135
public static final byte DOM_DBX_ID = 3 ;
@@ -213,8 +209,6 @@ public class NativeBroker implements DBBroker {
213
209
214
210
private final Path dataDir ;
215
211
216
- private final byte prepend ;
217
-
218
212
private final Runtime run = Runtime .getRuntime ();
219
213
220
214
private final NodeProcessor nodeProcessor = new NodeProcessor ();
@@ -239,15 +233,6 @@ public NativeBroker(final BrokerPool pool, final Configuration config) throws EX
239
233
this .lockManager = pool .getLockManager ();
240
234
LOG .debug ("Initializing broker {}" , hashCode ());
241
235
242
- final String prependDB = (String ) config .getProperty ("db-connection.prepend-db" );
243
- if ("always" .equalsIgnoreCase (prependDB )) {
244
- this .prepend = PREPEND_DB_ALWAYS ;
245
- } else if ("never" .equalsIgnoreCase (prependDB )) {
246
- this .prepend = PREPEND_DB_NEVER ;
247
- } else {
248
- this .prepend = PREPEND_DB_AS_NEEDED ;
249
- }
250
-
251
236
this .dataDir = config .getProperty (BrokerPool .PROPERTY_DATA_DIR , Paths .get (DEFAULT_DATA_DIR ));
252
237
253
238
nodesCountThreshold = config .getInteger (BrokerPool .PROPERTY_NODES_BUFFER );
@@ -696,15 +681,21 @@ public Serializer newSerializer(final List<String> chainOfReceivers) {
696
681
return new NativeSerializer (this , getConfiguration (), chainOfReceivers );
697
682
}
698
683
699
- public XmldbURI prepend (final XmldbURI uri ) {
700
- switch (prepend ) {
701
- case PREPEND_DB_ALWAYS :
702
- return uri .prepend (XmldbURI .ROOT_COLLECTION_URI );
703
- case PREPEND_DB_AS_NEEDED :
704
- return uri .startsWith (XmldbURI .ROOT_COLLECTION_URI ) ? uri : uri .prepend (XmldbURI .ROOT_COLLECTION_URI );
705
- default :
706
- return uri ;
684
+ /**
685
+ * Prepends '/db' to the URI if it is missing
686
+ *
687
+ * @param uri the URI
688
+ *
689
+ * @return the database URI
690
+ *
691
+ * @deprecated This is used inconsistently in NativeBroker, instead the caller should if necessary enforce the correct URI
692
+ */
693
+ @ Deprecated
694
+ private XmldbURI prepend (final XmldbURI uri ) {
695
+ if (uri .startsWith (XmldbURI .ROOT_COLLECTION_URI )) {
696
+ return uri ;
707
697
}
698
+ return uri .prepend (XmldbURI .ROOT_COLLECTION_URI );
708
699
}
709
700
710
701
/**
0 commit comments