forked from apache/shardingsphere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename GlobalNodePath (apache#34255)
- Loading branch information
Showing
9 changed files
with
219 additions
and
206 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
123 changes: 0 additions & 123 deletions
123
...tadata/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/GlobalNode.java
This file was deleted.
Oops, something went wrong.
123 changes: 123 additions & 0 deletions
123
...ta/core/src/main/java/org/apache/shardingsphere/metadata/persist/node/GlobalNodePath.java
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,123 @@ | ||
/* | ||
* 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.shardingsphere.metadata.persist.node; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* Global node path. | ||
*/ | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public final class GlobalNodePath { | ||
|
||
private static final String RULE_NODE = "rules"; | ||
|
||
private static final String PROPS_NODE = "props"; | ||
|
||
private static final String VERSIONS_NODE = "versions"; | ||
|
||
private static final String ACTIVE_VERSION_NODE = "active_version"; | ||
|
||
/** | ||
* Get global rule root path. | ||
* | ||
* @return global rule root path | ||
*/ | ||
public static String getRuleRootPath() { | ||
return String.join("/", "", RULE_NODE); | ||
} | ||
|
||
/** | ||
* Get global rule path. | ||
* | ||
* @param ruleName rule name | ||
* @return global rule path | ||
*/ | ||
public static String getRulePath(final String ruleName) { | ||
return String.join("/", getRuleRootPath(), ruleName); | ||
} | ||
|
||
/** | ||
* Get global rule versions path. | ||
* | ||
* @param ruleName rule name | ||
* @return global rule versions path | ||
*/ | ||
public static String getRuleVersionsPath(final String ruleName) { | ||
return String.join("/", getRulePath(ruleName), VERSIONS_NODE); | ||
} | ||
|
||
/** | ||
* Get global rule version path. | ||
* | ||
* @param ruleName rule name | ||
* @param version version | ||
* @return global rule version path | ||
*/ | ||
public static String getRuleVersionPath(final String ruleName, final String version) { | ||
return String.join("/", getRuleVersionsPath(ruleName), version); | ||
} | ||
|
||
/** | ||
* Get global rule active version path. | ||
* | ||
* @param ruleName rule name | ||
* @return global rule active version path | ||
*/ | ||
public static String getRuleActiveVersionPath(final String ruleName) { | ||
return String.join("/", getRulePath(ruleName), ACTIVE_VERSION_NODE); | ||
} | ||
|
||
/** | ||
* Get properties path. | ||
* | ||
* @return properties path | ||
*/ | ||
public static String getPropsRootPath() { | ||
return String.join("/", "", PROPS_NODE); | ||
} | ||
|
||
/** | ||
* Get properties versions path. | ||
* | ||
* @return properties versions path | ||
*/ | ||
public static String getPropsVersionsPath() { | ||
return String.join("/", getPropsRootPath(), VERSIONS_NODE); | ||
} | ||
|
||
/** | ||
* Get properties version path. | ||
* | ||
* @param version version | ||
* @return properties version path | ||
*/ | ||
public static String getPropsVersionPath(final String version) { | ||
return String.join("/", getPropsVersionsPath(), version); | ||
} | ||
|
||
/** | ||
* Get properties active version path. | ||
* | ||
* @return properties active version path | ||
*/ | ||
public static String getPropsActiveVersionPath() { | ||
return String.join("/", getPropsRootPath(), ACTIVE_VERSION_NODE); | ||
} | ||
} |
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
Oops, something went wrong.