Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add CLI `config convert` command * Complete server config serialization * Proper serialization API for secret masking * Implement JGroups stack serialization * Delay JGroups stack initialization * Fix parsing of YAML attribute lists * Don't include implict authorization roles
- Loading branch information
1 parent
f38b497
commit 75332ff
Showing
78 changed files
with
1,582 additions
and
820 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
20 changes: 20 additions & 0 deletions
20
cli/src/main/java/org/infinispan/cli/activators/ConfigConversionAvailable.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,20 @@ | ||
package org.infinispan.cli.activators; | ||
|
||
import org.aesh.command.activator.CommandActivator; | ||
import org.aesh.command.impl.internal.ParsedCommand; | ||
import org.infinispan.commons.util.Util; | ||
|
||
/** | ||
* @since 14.0 | ||
**/ | ||
public class ConfigConversionAvailable implements CommandActivator { | ||
@Override | ||
public boolean isActivated(ParsedCommand command) { | ||
try { | ||
Util.loadClass("org.infinispan.configuration.parsing.ParserRegistry", this.getClass().getClassLoader()); | ||
return true; | ||
} catch (Exception e) { | ||
return false; | ||
} | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
cli/src/main/java/org/infinispan/cli/completers/MediaTypeCompleter.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,16 @@ | ||
package org.infinispan.cli.completers; | ||
|
||
/** | ||
* @since 14.0 | ||
*/ | ||
public class MediaTypeCompleter extends EnumCompleter<MediaTypeCompleter.MediaType> { | ||
public enum MediaType { | ||
XML, | ||
JSON, | ||
YAML | ||
} | ||
|
||
public MediaTypeCompleter() { | ||
super(MediaType.class); | ||
} | ||
} |
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
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
43 changes: 43 additions & 0 deletions
43
...n/java/org/infinispan/commons/configuration/attributes/PropertiesAttributeSerializer.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,43 @@ | ||
package org.infinispan.commons.configuration.attributes; | ||
|
||
import java.util.Map; | ||
|
||
import org.infinispan.commons.configuration.io.ConfigurationFormatFeature; | ||
import org.infinispan.commons.configuration.io.ConfigurationWriter; | ||
|
||
public class PropertiesAttributeSerializer implements AttributeSerializer<Map<?, ?>> { | ||
public static final PropertiesAttributeSerializer PROPERTIES = new PropertiesAttributeSerializer("properties", "property", "name"); | ||
private final String collectionElement; | ||
private final String itemElement; | ||
private final String nameAttribute; | ||
|
||
public PropertiesAttributeSerializer(Enum<?> collectionElement, Enum<?> itemElement, Enum<?> nameAttribute) { | ||
this(collectionElement.toString(), itemElement.toString(), nameAttribute.toString()); | ||
} | ||
|
||
public PropertiesAttributeSerializer(String collectionElement, String itemElement, String nameAttribute) { | ||
this.collectionElement = collectionElement; | ||
this.itemElement = itemElement; | ||
this.nameAttribute = nameAttribute; | ||
} | ||
|
||
@Override | ||
public void serialize(ConfigurationWriter writer, String name, Map<?, ?> properties) { | ||
if (!properties.isEmpty()) { | ||
if (writer.hasFeature(ConfigurationFormatFeature.BARE_COLLECTIONS)) { | ||
for (Map.Entry<?, ?> entry : properties.entrySet()) { | ||
writer.writeStartElement(itemElement); | ||
writer.writeAttribute(nameAttribute, entry.getKey().toString()); | ||
writer.writeCharacters(entry.getValue().toString()); | ||
writer.writeEndElement(); | ||
} | ||
} else { | ||
writer.writeStartMap(collectionElement); | ||
for (Map.Entry<?, ?> entry : properties.entrySet()) { | ||
writer.writeMapItem(itemElement, nameAttribute, entry.getKey().toString(), entry.getValue().toString()); | ||
} | ||
writer.writeEndMap(); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.