Fixed Pattern constraint validator messages
- Pattern uses {jakarta.validation.constraints.Pattern.message} by default
Signed-off-by: David Matějček <dmatej@seznam.cz>
diff --git a/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java b/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java
index 8cadb03..f26bd4e 100644
--- a/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java
+++ b/appserver/common/container-common/src/main/java/org/glassfish/ha/commands/ListPersistenceTypesCommand.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -17,7 +18,14 @@
package org.glassfish.ha.commands;
import com.sun.enterprise.config.serverbeans.Domain;
-import java.util.*;
+
+import jakarta.validation.constraints.Pattern;
+
+import java.util.ArrayList;
+import java.util.Properties;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.glassfish.api.ActionReport;
import org.glassfish.api.I18n;
@@ -25,15 +33,11 @@
import org.glassfish.api.admin.AdminCommand;
import org.glassfish.api.admin.AdminCommandContext;
import org.glassfish.api.admin.CommandLock;
-
-import org.jvnet.hk2.annotations.Service;
-import org.glassfish.hk2.api.PerLookup;
-
-import jakarta.validation.constraints.Pattern;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.glassfish.api.admin.*;
+import org.glassfish.api.admin.RestEndpoint;
+import org.glassfish.api.admin.RestEndpoints;
import org.glassfish.ha.store.spi.BackingStoreFactoryRegistry;
+import org.glassfish.hk2.api.PerLookup;
+import org.jvnet.hk2.annotations.Service;
/**
* The list-persistence-types command lists different kinds of persistence options for session data
@@ -51,10 +55,12 @@
})
public class ListPersistenceTypesCommand implements AdminCommand {
- @Param(name="type", optional=false, primary=false)
+ private static final String CONTAINER_TYPES = "(ejb|web)";
+
+ @Param(name = "type", optional = false, primary = false)
@I18n("list.persistence.types.container")
- @Pattern(regexp = "(ejb|web)")
- private String containerType = "";
+ @Pattern(regexp = CONTAINER_TYPES, message = "Valid values: " + CONTAINER_TYPES)
+ private final String containerType = "";
private Logger logger;
private static final String EOL = "\n";
@@ -89,7 +95,7 @@
output = output.substring(0, output.length()-1);
}
Properties extraProperties = new Properties();
- extraProperties.put("types", new ArrayList<String>(allPersistenceTypes));
+ extraProperties.put("types", new ArrayList<>(allPersistenceTypes));
report.setExtraProperties(extraProperties);
report.setMessage(output);
diff --git a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java
index 27a841d..c3a0dec 100644
--- a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java
+++ b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/ResourceAdapterConfig.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -17,27 +18,28 @@
package org.glassfish.connectors.config;
import com.sun.enterprise.config.serverbeans.Resource;
-import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
-import org.glassfish.resourcebase.resources.ResourceTypeOrder;
-import org.jvnet.hk2.config.*;
+
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
import java.util.List;
+import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
+import org.glassfish.resourcebase.resources.ResourceTypeOrder;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.admin.RestRedirects;
-import org.glassfish.api.admin.RestRedirect;
+
import static org.glassfish.config.support.Constants.NAME_REGEX;
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.Pattern;
-/**
- *
- */
-
/* @XmlType(name = "", propOrder = {
"property"
}) */
@@ -56,6 +58,8 @@
@ResourceTypeOrder(deploymentOrder= ResourceDeploymentOrder.RESOURCEADAPTERCONFIG_RESOURCE)
public interface ResourceAdapterConfig extends ConfigBeanProxy, Resource, PropertyBag {
+ String PATTERN_RA_NAME = "[^',][^',\\\\]*";
+
/**
* Gets the value of the name property.
*
@@ -63,16 +67,16 @@
* {@link String }
*/
@Attribute
- @Pattern(regexp=NAME_REGEX)
- public String getName();
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+ String getName();
/**
* Sets the value of the name property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
- public void setName(String value) throws PropertyVetoException;
+ void setName(String value) throws PropertyVetoException;
/**
* Gets the value of the threadPoolIds property.
@@ -81,15 +85,15 @@
* {@link String }
*/
@Attribute
- public String getThreadPoolIds();
+ String getThreadPoolIds();
/**
* Sets the value of the threadPoolIds property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
- public void setThreadPoolIds(String value) throws PropertyVetoException;
+ void setThreadPoolIds(String value) throws PropertyVetoException;
/**
* Gets the value of the resourceAdapterName property.
@@ -97,31 +101,34 @@
* @return possible object is
* {@link String }
*/
- @Attribute(key=true)
- @Pattern(regexp="[^',][^',\\\\]*")
- public String getResourceAdapterName();
+ @Attribute(key = true)
+ @Pattern(regexp = PATTERN_RA_NAME, message = "Pattern: " + PATTERN_RA_NAME)
+ String getResourceAdapterName();
/**
* Sets the value of the resourceAdapterName property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
- public void setResourceAdapterName(String value) throws PropertyVetoException;
+ void setResourceAdapterName(String value) throws PropertyVetoException;
/**
- Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
+ * Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
*/
- @ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
- @PropertiesDesc(props={})
+ @Override
+ @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
+ @PropertiesDesc(props = {})
@Element
List<Property> getProperty();
+ @Override
@DuckTyped
String getIdentity();
class Duck {
- public static String getIdentity(ResourceAdapterConfig resource){
+
+ public static String getIdentity(ResourceAdapterConfig resource) {
return resource.getResourceAdapterName();
}
}
diff --git a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java
index f5adfda..99566fe 100644
--- a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java
+++ b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/SecurityMap.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,17 +17,18 @@
package org.glassfish.connectors.config;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
import java.util.List;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
+import static org.glassfish.config.support.Constants.NAME_REGEX;
/**
* Perform mapping from principal received during Servlet/EJB authentication,
@@ -49,18 +51,18 @@
* @return possible object is
* {@link String }
*/
- @Attribute(key=true)
+ @Attribute(key = true)
@NotNull
- @Pattern(regexp=NAME_REGEX)
- public String getName();
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+ String getName();
/**
* Sets the value of the name property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
- public void setName(String value) throws PropertyVetoException;
+ void setName(String value) throws PropertyVetoException;
/**
* Gets the value of the backendPrincipal property.
@@ -68,33 +70,34 @@
* @return possible object is
* {@link BackendPrincipal }
*/
- @Element(required=true)
- public BackendPrincipal getBackendPrincipal();
+ @Element(required = true)
+ BackendPrincipal getBackendPrincipal();
/**
* Sets the value of the backendPrincipal property.
*
* @param value allowed object is
- * {@link BackendPrincipal }
+ * {@link BackendPrincipal }
*/
- public void setBackendPrincipal(BackendPrincipal value) throws PropertyVetoException;
+ void setBackendPrincipal(BackendPrincipal value) throws PropertyVetoException;
/**
* get the list of principals to be mapped to backend-principal
+ *
* @return list of principals
*/
@Element
- public List<String> getPrincipal();
+ List<String> getPrincipal();
void setPrincipal(List<String> principals) throws PropertyVetoException;
-
/**
* get the list of user-groups to be mapped to backend principal
+ *
* @return list of user-groups
*/
@Element
- public List<String> getUserGroup();
+ List<String> getUserGroup();
void setUserGroup(List<String> userGroups) throws PropertyVetoException;
}
diff --git a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java
index 437f5fd..e6fd47f 100644
--- a/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java
+++ b/appserver/connectors/connectors-internal-api/src/main/java/org/glassfish/connectors/config/WorkSecurityMap.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,19 +17,27 @@
package org.glassfish.connectors.config;
-import com.sun.enterprise.config.serverbeans.*;
-import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
-import org.glassfish.resourcebase.resources.ResourceTypeOrder;
-import org.jvnet.hk2.config.*;
+import com.sun.enterprise.config.serverbeans.Resource;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
+
import java.beans.PropertyVetoException;
import java.util.List;
+import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
+import org.glassfish.resourcebase.resources.ResourceTypeOrder;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+
@Configured
-@ResourceTypeOrder(deploymentOrder= ResourceDeploymentOrder.WORKSECURITYMAP_RESOURCE)
-public interface WorkSecurityMap extends /*Named,*/ ConfigBeanProxy, Resource {
+@ResourceTypeOrder(deploymentOrder = ResourceDeploymentOrder.WORKSECURITYMAP_RESOURCE)
+public interface WorkSecurityMap extends ConfigBeanProxy, Resource {
+
+ String PATTERN_RA_NAME = "[^',][^',\\\\]*";
/**
* Gets the value of the enabled property.
@@ -36,14 +45,14 @@
* @return possible object is
* {@link String }
*/
- @Attribute (defaultValue="true",dataType=Boolean.class)
+ @Attribute(defaultValue = "true", dataType = Boolean.class)
String getEnabled();
/**
* Sets the value of the enabled property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
void setEnabled(String value) throws PropertyVetoException;
@@ -60,11 +69,10 @@
* Sets the value of the description property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
void setDescription(String value) throws PropertyVetoException;
-
/**
* Gets the value of the ra name
*
@@ -73,53 +81,55 @@
*/
@Attribute
@NotNull
- @Pattern(regexp="[^',][^',\\\\]*")
- public String getResourceAdapterName();
+ @Pattern(regexp = PATTERN_RA_NAME, message = "Pattern: " + PATTERN_RA_NAME)
+ String getResourceAdapterName();
/**
* Sets the value of the ra name
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
- public void setResourceAdapterName(String value) throws PropertyVetoException;
+ void setResourceAdapterName(String value) throws PropertyVetoException;
/**
* Gets the group map
- * @return group map
*
+ * @return group map
*/
@Element
@NotNull
- public List<GroupMap> getGroupMap();
+ List<GroupMap> getGroupMap();
/**
* gets the principal map
+ *
* @return principal map
*/
@Element
@NotNull
- public List<PrincipalMap> getPrincipalMap();
+ List<PrincipalMap> getPrincipalMap();
/**
- * Name of the configured object
+ * Name of the configured object
*
* @return name of the configured object
*/
- @Attribute(required=true, key=true)
- @Pattern(regexp="[^',][^',\\\\]*")
+ @Attribute(required = true, key = true)
+ @Pattern(regexp = PATTERN_RA_NAME, message = "Pattern: " + PATTERN_RA_NAME)
@NotNull
- public String getName();
+ String getName();
- public void setName(String value) throws PropertyVetoException;
+ void setName(String value) throws PropertyVetoException;
+ @Override
@DuckTyped
String getIdentity();
class Duck {
- public static String getIdentity(WorkSecurityMap wsm){
- return ("resource-adapter : " + wsm.getResourceAdapterName()
- + " : security-map : " + wsm.getName());
+
+ public static String getIdentity(WorkSecurityMap wsm) {
+ return ("resource-adapter : " + wsm.getResourceAdapterName() + " : security-map : " + wsm.getName());
}
}
}
diff --git a/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java b/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java
index 46d1157..e52fdcd 100644
--- a/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java
+++ b/appserver/ejb/ejb-connector/src/main/java/org/glassfish/ejb/config/EjbContainer.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,24 +17,23 @@
package org.glassfish.ejb.config;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
import java.util.List;
+import org.glassfish.api.admin.config.ConfigExtension;
import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.api.admin.config.ConfigExtension;
/**
* Configuration of EJB Container
@@ -46,12 +46,15 @@
@Configured
public interface EjbContainer extends ConfigBeanProxy, PropertyBag, ConfigExtension {
- public static final int DEFAULT_THREAD_CORE_POOL_SIZE = 16;
- public static final int DEFAULT_THREAD_MAX_POOL_SIZE = 32;
- public static final long DEFAULT_THREAD_KEEP_ALIVE_SECONDS = 60;
- public static final int DEFAULT_THREAD_QUEUE_CAPACITY = Integer.MAX_VALUE;
- public static final boolean DEFAULT_ALLOW_CORE_THREAD_TIMEOUT = false;
- public static final boolean DEFAULT_PRESTART_ALL_CORE_THREADS = false;
+
+ String PATTERN_VICTIM_SELECTION_POLICY = "(nru|fifo|lru)";
+
+ int DEFAULT_THREAD_CORE_POOL_SIZE = 16;
+ int DEFAULT_THREAD_MAX_POOL_SIZE = 32;
+ long DEFAULT_THREAD_KEEP_ALIVE_SECONDS = 60;
+ int DEFAULT_THREAD_QUEUE_CAPACITY = Integer.MAX_VALUE;
+ boolean DEFAULT_ALLOW_CORE_THREAD_TIMEOUT = false;
+ boolean DEFAULT_PRESTART_ALL_CORE_THREADS = false;
/**
* Gets the value of the steadyPoolSize property.
@@ -280,8 +283,8 @@
* @return possible object is
* {@link String }
*/
- @Attribute (defaultValue="nru")
- @Pattern(regexp="(nru|fifo|lru)")
+ @Attribute(defaultValue = "nru")
+ @Pattern(regexp = PATTERN_VICTIM_SELECTION_POLICY, message = "Pattern: " + PATTERN_VICTIM_SELECTION_POLICY)
String getVictimSelectionPolicy();
/**
@@ -301,8 +304,8 @@
* @return possible object is
* {@link String }
*/
- @Attribute (defaultValue="B")
- @Pattern(regexp="B|C")
+ @Attribute(defaultValue = "B")
+ @Pattern(regexp = "B|C", message = "B to enable entity bean caching, C to disable.")
String getCommitOption();
/**
@@ -358,6 +361,7 @@
/**
Properties as per {@link PropertyBag}
*/
+ @Override
@ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
@PropertiesDesc(props = {
@PropertyDesc(name = "disable-nonportable-jndi-names",
diff --git a/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java b/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java
index e65526f..ff1784a 100644
--- a/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java
+++ b/appserver/jdbc/jdbc-config/src/main/java/org/glassfish/jdbc/config/JdbcConnectionPool.java
@@ -1,6 +1,6 @@
/*
+ * Copyright (c) 2021-2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -19,6 +19,15 @@
import com.sun.enterprise.config.serverbeans.Resource;
import com.sun.enterprise.config.serverbeans.ResourcePool;
+
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.util.List;
+
+import org.glassfish.admin.cli.resources.UniqueResourceNameConstraint;
import org.glassfish.api.admin.RestRedirect;
import org.glassfish.api.admin.RestRedirects;
import org.glassfish.api.admin.config.PropertiesDesc;
@@ -27,19 +36,16 @@
import org.glassfish.connectors.config.validators.ConnectionPoolErrorMessages;
import org.glassfish.jdbc.config.validators.JdbcConnectionPoolConstraint;
import org.glassfish.jdbc.config.validators.JdbcConnectionPoolConstraints;
-import org.glassfish.admin.cli.resources.UniqueResourceNameConstraint;
import org.glassfish.resourcebase.resources.ResourceDeploymentOrder;
import org.glassfish.resourcebase.resources.ResourceTypeOrder;
-import org.jvnet.hk2.config.*;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import jakarta.validation.constraints.Max;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.util.List;
-
/**
* Defines configuration used to create and manage a pool physical database
* connections. Pool definition is named, and can be referred to by multiple
@@ -69,8 +75,11 @@
})
@ResourceTypeOrder(deploymentOrder=ResourceDeploymentOrder.JDBC_POOL)
@UniqueResourceNameConstraint(message="{resourcename.isnot.unique}", payload=JdbcConnectionPool.class)
-public interface JdbcConnectionPool extends ConfigBeanProxy, Resource, ResourcePool,
- PropertyBag {
+public interface JdbcConnectionPool extends ConfigBeanProxy, Resource, ResourcePool, PropertyBag {
+
+ String CONNECTION_VALIDATION_METHODS = "(auto-commit|meta-data|custom-validation|table)";
+ String ISOLATION_LEVELS = "(read-uncommitted|read-committed|repeatable-read|serializable)";
+ String RESOURCE_TYPES = "(java.sql.Driver|javax.sql.DataSource|javax.sql.XADataSource|javax.sql.ConnectionPoolDataSource)";
/**
*
@@ -131,7 +140,7 @@
* {@link String }
*/
@Attribute
- @Pattern(regexp="(java.sql.Driver|javax.sql.DataSource|javax.sql.XADataSource|javax.sql.ConnectionPoolDataSource)")
+ @Pattern(regexp = RESOURCE_TYPES, message = "Valid values: " + RESOURCE_TYPES)
String getResType();
/**
@@ -274,7 +283,7 @@
* {@link String }
*/
@Attribute
- @Pattern(regexp="(read-uncommitted|read-committed|repeatable-read|serializable)")
+ @Pattern(regexp = ISOLATION_LEVELS, message = "Valid values: " + ISOLATION_LEVELS)
String getTransactionIsolationLevel();
/**
@@ -299,7 +308,7 @@
* @return possible object is
* {@link String }
*/
- @Attribute (defaultValue="true", dataType=Boolean.class)
+ @Attribute(defaultValue = "true", dataType = Boolean.class)
String getIsIsolationLevelGuaranteed();
/**
@@ -348,7 +357,7 @@
* {@link String }
*/
@Attribute (defaultValue="table")
- @Pattern(regexp="(auto-commit|meta-data|custom-validation|table)")
+ @Pattern(regexp = CONNECTION_VALIDATION_METHODS, message = "Valid values: " + CONNECTION_VALIDATION_METHODS)
String getConnectionValidationMethod();
/**
@@ -942,6 +951,7 @@
* deployment descriptors.
*
*/
+@Override
@PropertiesDesc(
props={
@PropertyDesc(name="PortNumber", defaultValue="1527", dataType=Port.class,
@@ -966,6 +976,7 @@
@Element
List<Property> getProperty();
+ @Override
@DuckTyped
String getIdentity();
diff --git a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java
index e76ccfd..4c5577b 100644
--- a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java
+++ b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsAvailability.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -21,7 +22,6 @@
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.types.Property;
import java.beans.PropertyVetoException;
@@ -44,6 +44,9 @@
@Configured
public interface JmsAvailability extends ConfigExtension, PropertyBag, AvailabilityServiceExtension {
+ String PATTERN_BROKER = "(masterbroker|shareddb)";
+ String PATTERN_MESSAGE_STORE_TYPE = "(file|jdbc)";
+
/**
* Gets the value of the availabilityEnabled property.
*
@@ -87,7 +90,7 @@
*/
@Attribute (defaultValue="masterbroker")
- @Pattern(regexp="(masterbroker|shareddb)")
+ @Pattern(regexp = PATTERN_BROKER, message = "Valid values: " + PATTERN_BROKER)
String getConfigStoreType();
@@ -112,8 +115,8 @@
* {@link String }
*/
- @Attribute (defaultValue="file")
- @Pattern(regexp="(file|jdbc)")
+ @Attribute(defaultValue = "file")
+ @Pattern(regexp = PATTERN_MESSAGE_STORE_TYPE, message = "Valid values: " + PATTERN_MESSAGE_STORE_TYPE)
String getMessageStoreType();
@@ -144,29 +147,28 @@
* Sets the value of the DB Vendor property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
void setDbVendor(String value) throws PropertyVetoException;
/**
- * Gets the value of the DB User Name property.
- *
- * This is the DB user Name for the DB used by the MQ broker cluster
- * for use in saving persistent JMS messages and other broker
- * cluster configuration information.
- *
- * @return possible object is
- * {@link String }
- */
+ * Gets the value of the DB User Name property.
+ * This is the DB user Name for the DB used by the MQ broker cluster
+ * for use in saving persistent JMS messages and other broker
+ * cluster configuration information.
+ *
+ * @return possible object is
+ * {@link String }
+ */
@Attribute
String getDbUsername();
- /**
- * Sets the value of the DB UserName property.
- *
- * @param value allowed object is
- * {@link String }
- */
+ /**
+ * Sets the value of the DB UserName property.
+ *
+ * @param value allowed object is
+ * {@link String }
+ */
void setDbUsername(String value) throws PropertyVetoException;
/**
@@ -227,10 +229,12 @@
* {@link String }
*/
void setMqStorePoolName(String value) throws PropertyVetoException;
+
/**
- Properties as per {@link PropertyBag}
+ * Properties as per {@link PropertyBag}
*/
- @ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
+ @Override
+ @ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
@PropertiesDesc(props={})
@Element
List<Property> getProperty();
diff --git a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java
index 060eb39..0195a37 100644
--- a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java
+++ b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsHost.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -20,7 +21,6 @@
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
@@ -34,8 +34,6 @@
import org.glassfish.quality.ToDo;
import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.Payload;
@@ -54,7 +52,7 @@
})
public interface JmsHost extends ConfigExtension, PropertyBag, Payload {
- final static String PORT_PATTERN = "\\$\\{[\\p{L}\\p{N}_][\\p{L}\\p{N}\\-_./;#]*\\}"
+ String PORT_PATTERN = "\\$\\{[\\p{L}\\p{N}_][\\p{L}\\p{N}\\-_./;#]*\\}"
+ "|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]"
+ "|[1-5][0-9][0-9][0-9][0-9]|6[0-4][0-9][0-9][0-9]"
+ "|65[0-4][0-9][0-9]|655[0-2][0-9]|6553[0-5]";
@@ -104,10 +102,8 @@
* @return possible object is
* {@link String }
*/
- @Attribute (defaultValue="7676")
- @Pattern(regexp=PORT_PATTERN,
- message="{port-pattern}",
- payload=JmsHost.class)
+ @Attribute(defaultValue = "7676")
+ @Pattern(regexp = PORT_PATTERN, message = "{port-pattern}", payload = JmsHost.class)
String getPort();
/**
@@ -178,6 +174,7 @@
/**
Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
*/
+ @Override
@ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
@PropertiesDesc(props={})
@Element
diff --git a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java
index 0db3f4f..938db97 100644
--- a/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java
+++ b/appserver/jms/gf-jms-connector/src/main/java/com/sun/enterprise/connectors/jms/config/JmsService.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -18,6 +19,15 @@
import com.sun.enterprise.config.modularity.annotation.CustomConfiguration;
import com.sun.enterprise.config.modularity.annotation.HasCustomizationTokens;
+
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.util.List;
+
import org.glassfish.api.admin.config.ConfigExtension;
import org.glassfish.api.admin.config.Container;
import org.glassfish.api.admin.config.PropertiesDesc;
@@ -28,13 +38,6 @@
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import jakarta.validation.constraints.Max;
-import jakarta.validation.constraints.Min;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.util.List;
-
/**
* The jms-service element specifies information about the bundled/built-in
* JMS service that is managed by Application Server
@@ -50,6 +53,11 @@
@CustomConfiguration(baseConfigurationFileName = "jms-module-conf.xml")
public interface JmsService extends ConfigExtension, PropertyBag, Container {
+ String ADDRESS_LIST_SELECTIONS = "(random|priority)";
+ String SERVICE_TYPES = "(LOCAL|EMBEDDED|REMOTE)";
+ String MQ_SCHEMES = "(mq||http)";
+ String MQ_SERVICES = "(ssljms||jms)";
+
/**
* Gets the value of the initTimeoutInSeconds property.
*
@@ -83,7 +91,7 @@
*/
@Attribute
@NotNull
- @Pattern(regexp="(LOCAL|EMBEDDED|REMOTE)")
+ @Pattern(regexp = SERVICE_TYPES, message = "Valid values: " + SERVICE_TYPES)
String getType();
/**
@@ -134,14 +142,14 @@
*/
void setDefaultJmsHost(String value) throws PropertyVetoException;
- @Attribute
+ @Attribute
String getMasterBroker();
/**
* Sets the value of the MasterBroker property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
void setMasterBroker(String value) throws PropertyVetoException;
@@ -215,8 +223,8 @@
* @return possible object is
* {@link String }
*/
- @Attribute (defaultValue="random")
- @Pattern(regexp="(random|priority)")
+ @Attribute(defaultValue = "random")
+ @Pattern(regexp = ADDRESS_LIST_SELECTIONS, message = "Valid values: " + ADDRESS_LIST_SELECTIONS)
String getAddresslistBehavior();
/**
@@ -259,7 +267,7 @@
* {@link String }
*/
@Attribute
- @Pattern(regexp="(mq||http)")
+ @Pattern(regexp = MQ_SCHEMES, message = "Valid values: " + MQ_SCHEMES)
String getMqScheme();
/**
@@ -281,7 +289,7 @@
* {@link String }
*/
@Attribute
- @Pattern(regexp="(ssljms||jms)")
+ @Pattern(regexp = MQ_SERVICES, message = "Valid values: " + MQ_SERVICES)
String getMqService();
/**
@@ -315,33 +323,44 @@
@Element
List<JmsHost> getJmsHost();
- /**
- Properties.
+ /**
+ * Properties.
*/
-@PropertiesDesc(
- props={
- @PropertyDesc(name="instance-name", defaultValue="imqbroker",
- description="The full Sun GlassFish Message Queue broker instance name"),
+ @Override
+ @PropertiesDesc(
+ props = {
+ @PropertyDesc(
+ name = "instance-name",
+ defaultValue = "imqbroker",
+ description = "The full Sun GlassFish Message Queue broker instance name"),
- @PropertyDesc(name="instance-name-suffix", defaultValue="xxxxxxxxxxxxxxxxxx",
- description="A suffix to add to the full Message Queue broker instance name. The suffix is separated " +
- "from the instance name by an underscore character (_). For example, if the instance name is 'imqbroker', " +
- "appending the suffix 'xyz' changes the instance name to 'imqbroker_xyz'"),
+ @PropertyDesc(
+ name = "instance-name-suffix",
+ defaultValue = "xxxxxxxxxxxxxxxxxx",
+ description = "A suffix to add to the full Message Queue broker instance name. The suffix is separated "
+ + "from the instance name by an underscore character (_). For example, if the instance name is 'imqbroker', "
+ + "appending the suffix 'xyz' changes the instance name to 'imqbroker_xyz'"),
- @PropertyDesc(name="append-version", defaultValue="",
- description="If true, appends the major and minor version numbers, preceded by underscore characters (_), " +
- "to the full Message Queue broker instance name. For example, if the instance name is 'imqbroker', " +
- "appending the version numbers changes the instance name to imqbroker_8_0"),
+ @PropertyDesc(
+ name = "append-version",
+ defaultValue = "",
+ description = "If true, appends the major and minor version numbers, preceded by underscore characters (_), "
+ + "to the full Message Queue broker instance name. For example, if the instance name is 'imqbroker', "
+ + "appending the version numbers changes the instance name to imqbroker_8_0"),
- @PropertyDesc(name="user-name", defaultValue="xxxxxxxxxxxxxxxxxx",
- description="Specifies the user name for creating the JMS connection. Needed only if the default " +
- "username/password of guest/guest is not available in the broker"),
+ @PropertyDesc(
+ name = "user-name",
+ defaultValue = "xxxxxxxxxxxxxxxxxx",
+ description = "Specifies the user name for creating the JMS connection. Needed only if the default "
+ + "username/password of guest/guest is not available in the broker"),
- @PropertyDesc(name="password", defaultValue="xxxxxxxxxxxxxxxxxx",
- description="Specifies the password for creating the JMS connection. Needed only if the default " +
- "username/password of guest/guest is not available in the broker")
- }
- )
+ @PropertyDesc(
+ name = "password",
+ defaultValue = "xxxxxxxxxxxxxxxxxx",
+ description = "Specifies the password for creating the JMS connection. Needed only if the default "
+ + "username/password of guest/guest is not available in the broker")
+ }
+ )
@Element
List<Property> getProperty();
}
diff --git a/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java b/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java
index 357b2aa..17c5efb 100644
--- a/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java
+++ b/appserver/orb/orb-enabler/src/main/java/org/glassfish/orb/admin/config/IiopListener.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,6 +17,10 @@
package org.glassfish.orb.admin.config;
+import jakarta.validation.Payload;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
import java.beans.PropertyVetoException;
import java.util.List;
@@ -31,16 +36,8 @@
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import jakarta.validation.Payload;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-
import static org.glassfish.config.support.Constants.NAME_REGEX;
-/**
- *
- */
-
/* @XmlType(name = "", propOrder = {
"ssl",
"property"
@@ -67,9 +64,9 @@
* @return possible object is
* {@link String }
*/
- @Attribute(key=true)
+ @Attribute(key = true)
@NotNull
- @Pattern(regexp=NAME_REGEX)
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
String getId();
/**
@@ -109,9 +106,7 @@
* {@link String }
*/
@Attribute (defaultValue="1072")
- @Pattern(regexp=PORT_PATTERN,
- message="{port-pattern}",
- payload=IiopListener.class)
+ @Pattern(regexp = PORT_PATTERN, message = "{port-pattern}", payload = IiopListener.class)
String getPort();
/**
diff --git a/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java b/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java
index 9ee64c8..b2e645a 100644
--- a/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java
+++ b/appserver/webservices/connector/src/main/java/org/glassfish/webservices/config/RegistryLocation.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,15 +17,16 @@
package org.glassfish.webservices.config;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+
+import static org.glassfish.config.support.Constants.NAME_REGEX;
/**
* Specifies the registry where web service end point artifacts are published.
@@ -41,17 +43,17 @@
* @return possible object is
* {@link String }
*/
- @Attribute(key=true)
+ @Attribute(key = true)
@NotNull
- @Pattern(regexp=NAME_REGEX)
- public String getConnectorResourceJndiName();
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+ String getConnectorResourceJndiName();
/**
* Sets the value of the connectorResourceJndiName property.
*
* @param value allowed object is
- * {@link String }
+ * {@link String }
*/
- public void setConnectorResourceJndiName(String value) throws PropertyVetoException;
+ void setConnectorResourceJndiName(String value) throws PropertyVetoException;
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java
index 70ee529..dc59d63 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AdminService.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,17 +17,21 @@
package com.sun.enterprise.config.serverbeans;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
import java.beans.PropertyVetoException;
import java.util.List;
import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.quality.ToDo;
-import org.jvnet.hk2.config.*;
-
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
/* @XmlType(name = "", propOrder = {
"jmxConnector",
@@ -40,6 +45,8 @@
@Configured
public interface AdminService extends ConfigBeanProxy, PropertyBag {
+ String PATTERN_TYPE = "(das|das-and-server|server)";
+
/**
* Gets the value of the type property. An instance can either be of type das Domain Administration Server in SE/EE or
* the PE instance das-and-server same as das server Any non-DAS instance in SE/EE. Not valid for PE.
@@ -47,7 +54,7 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "server")
- @Pattern(regexp = "(das|das-and-server|server)")
+ @Pattern(regexp = PATTERN_TYPE, message = "Pattern: " + PATTERN_TYPE)
String getType();
/**
@@ -98,6 +105,7 @@
/**
* Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
*/
+ @Override
@ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
@PropertiesDesc(props = {})
@Element
@@ -150,8 +158,9 @@
SecurityService ss = cfg.getSecurityService();
List<AuthRealm> realms = ss.getAuthRealm();
for (AuthRealm realm : realms) {
- if (rn.equals(realm.getName()))
+ if (rn.equals(realm.getName())) {
return realm;
+ }
}
return null;
}
@@ -167,8 +176,9 @@
boolean usesFR = false;
AuthRealm ar = as.getAssociatedAuthRealm();
//Note: This is type unsafe.
- if (ar != null && "com.sun.enterprise.security.auth.realm.file.FileRealm".equals(ar.getClassname()))
+ if (ar != null && "com.sun.enterprise.security.auth.realm.file.FileRealm".equals(ar.getClassname())) {
usesFR = true;
+ }
return usesFR;
}
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java
index dd22685..82a5fb9 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuditModule.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,27 +17,27 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
+import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
+
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
import java.util.List;
+import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.admin.RestRedirects;
-import org.glassfish.api.admin.RestRedirect;
-import org.glassfish.quality.ToDo;
+
import static org.glassfish.config.support.Constants.NAME_REGEX;
-import jakarta.validation.constraints.Pattern;
-import jakarta.validation.constraints.NotNull;
-
-import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
-
/**
* An audit-module specifies an optional plug-in module which implements audit capabilities.
*/
@@ -57,7 +58,7 @@
*/
@Attribute(key = true)
@NotNull
- @Pattern(regexp = NAME_REGEX)
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
String getName();
/**
@@ -87,6 +88,7 @@
/**
* Properties as per {@link PropertyBag}
*/
+ @Override
@ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
@PropertiesDesc(props = {})
@Element
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java
index ffe4941..cc8127d 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/AuthRealm.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,28 +17,42 @@
package com.sun.enterprise.config.serverbeans;
-import com.sun.enterprise.config.serverbeans.customvalidators.*;
+import com.sun.enterprise.config.serverbeans.customvalidators.FileRealmPropertyCheck;
+import com.sun.enterprise.config.serverbeans.customvalidators.JDBCRealmPropertyCheck;
+import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
+import com.sun.enterprise.config.serverbeans.customvalidators.LDAPRealmPropertyCheck;
+import com.sun.enterprise.config.serverbeans.customvalidators.SolarisRealmPropertyCheck;
+
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.util.List;
+
import org.glassfish.api.admin.RestRedirect;
import org.glassfish.api.admin.RestRedirects;
import org.glassfish.api.admin.config.PropertiesDesc;
import org.glassfish.api.admin.config.PropertyDesc;
-import org.jvnet.hk2.config.*;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.util.List;
+import static org.glassfish.config.support.Constants.NAME_REGEX;
@Configured
@FileRealmPropertyCheck
@LDAPRealmPropertyCheck
@JDBCRealmPropertyCheck
@SolarisRealmPropertyCheck
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-auth-realm"),
- @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-auth-realm") })
+@RestRedirects({
+ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-auth-realm"),
+ @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-auth-realm")
+})
+
/**
* The auth-realm element defines and configures one authentication realm. There must be at least one realm available
* for a server instance; any number can be configured, as desired. Authentication realms need provider-specific
@@ -54,7 +69,7 @@
*/
@Attribute(key = true)
@NotNull
- @Pattern(regexp = NAME_REGEX)
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
String getName();
/**
@@ -87,8 +102,9 @@
class Duck {
public static String getGroupMapping(AuthRealm me) {
Property prop = me.getProperty("group-mapping"); //have to hard-code this, unfortunately :(
- if (prop != null)
+ if (prop != null) {
return prop.getValue();
+ }
return null;
}
}
@@ -96,6 +112,7 @@
/**
* Properties.
*/
+ @Override
@PropertiesDesc(props = {
@PropertyDesc(name = "jaas-context", description = "jaas-contextfile,jdbcSpecifies the JAAS (Java Authentication and Authorization Service) context"),
@PropertyDesc(name = "file", defaultValue = "${com.sun.aas.instanceRoot}/config/keyfile", description = "file realm. Specifies the file that stores user names, passwords, and group names."),
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java
index 1ca80f8..677596d 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/BindableResource.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -17,17 +18,21 @@
package com.sun.enterprise.config.serverbeans;
import com.sun.enterprise.config.serverbeans.customvalidators.ResourceNameConstraint;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.DuckTyped;
-import java.beans.PropertyVetoException;
import jakarta.validation.Payload;
-
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
+import java.beans.PropertyVetoException;
+
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.DuckTyped;
+
@ResourceNameConstraint(message = "{resourcename.invalid.character}", payload = BindableResource.class)
public interface BindableResource extends Resource, Payload {
+
+ String PATTERN_JNDI = "[^',][^',\\\\]*";
+
/**
* Gets the value of the jndiName property.
*
@@ -35,15 +40,15 @@
*/
@Attribute(key = true)
@NotNull
- @Pattern(regexp = "[^',][^',\\\\]*")
- public String getJndiName();
+ @Pattern(regexp = PATTERN_JNDI, message = "Pattern: " + PATTERN_JNDI)
+ String getJndiName();
/**
* Sets the value of the jndiName property.
*
* @param value allowed object is {@link String }
*/
- public void setJndiName(String value) throws PropertyVetoException;
+ void setJndiName(String value) throws PropertyVetoException;
/**
* Gets the value of the enabled property.
@@ -60,6 +65,7 @@
*/
void setEnabled(String value) throws PropertyVetoException;
+ @Override
@DuckTyped
String getIdentity();
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java
index 4bfffa8..7e2df79 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Cluster.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,44 +17,14 @@
package com.sun.enterprise.config.serverbeans;
-import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
-import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefConstraint;
import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefValidator;
+import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
+import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
import com.sun.enterprise.util.LocalStringManagerImpl;
import com.sun.enterprise.util.io.FileUtils;
-import com.sun.logging.LogDomains;
-import java.io.*;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.I18n;
-import org.glassfish.api.Param;
-import org.glassfish.api.admin.*;
-import org.glassfish.config.support.*;
-import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
-
-import org.jvnet.hk2.annotations.Service;
-import org.glassfish.hk2.api.PerLookup;
-import org.glassfish.hk2.api.ServiceLocator;
-import org.jvnet.hk2.config.*;
-import org.glassfish.api.admin.config.Named;
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.api.admin.config.ReferenceContainer;
-// import org.glassfish.virtualization.util.RuntimeContext;
-
-import java.beans.PropertyVetoException;
-import java.util.List;
-import java.util.ArrayList;
-import java.security.SecureRandom;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.glassfish.api.admin.config.PropertiesDesc;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
-
-import org.glassfish.quality.ToDo;
import jakarta.inject.Inject;
import jakarta.validation.Payload;
@@ -62,12 +33,51 @@
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
+import java.beans.PropertyVetoException;
+import java.io.File;
+import java.security.SecureRandom;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.I18n;
+import org.glassfish.api.Param;
+import org.glassfish.api.admin.AdminCommand;
+import org.glassfish.api.admin.AdminCommandContext;
+import org.glassfish.api.admin.CommandRunner;
+import org.glassfish.api.admin.ServerEnvironment;
+import org.glassfish.api.admin.config.Named;
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.glassfish.api.admin.config.ReferenceContainer;
+import org.glassfish.config.support.CreationDecorator;
+import org.glassfish.config.support.DeletionDecorator;
+import org.glassfish.hk2.api.PerLookup;
+import org.glassfish.hk2.api.ServiceLocator;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.annotations.Service;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Dom;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.Transaction;
+import org.jvnet.hk2.config.TransactionFailure;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
+
/**
* A cluster defines a homogeneous set of server instances that share the same applications, resources, and
* configuration.
*/
@Configured
-@SuppressWarnings("unused")
@ConfigRefConstraint(message = "{configref.invalid}", payload = ConfigRefValidator.class)
@NotDuplicateTargetName(message = "{cluster.duplicate.name}", payload = Cluster.class)
@ReferenceConstraint(skipDuringCreation = true, payload = Cluster.class)
@@ -80,13 +90,11 @@
* @throws PropertyVetoException if a listener vetoes the change
*/
@Param(name = "name", primary = true)
- @Override
- public void setName(String value) throws PropertyVetoException;
+ @Override void setName(String value) throws PropertyVetoException;
@NotTargetKeyword(message = "{cluster.reserved.name}", payload = Cluster.class)
@Pattern(regexp = NAME_SERVER_REGEX, message = "{cluster.invalid.name}", payload = Cluster.class)
- @Override
- public String getName();
+ @Override String getName();
/**
* points to a named config. All server instances in the cluster will share this config.
@@ -95,7 +103,7 @@
*/
@Attribute
@NotNull
- @Pattern(regexp = NAME_SERVER_REGEX)
+ @Pattern(regexp = NAME_SERVER_REGEX, message = "{config.invalid.name}")
@ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.configref}", type = Config.class)
String getConfigRef();
@@ -334,8 +342,7 @@
@DuckTyped
List<Server> getInstances();
- @DuckTyped
- public ServerRef getServerRefByRef(String ref);
+ @DuckTyped ServerRef getServerRefByRef(String ref);
// four trivial methods that ReferenceContainer's need to implement
@DuckTyped
@@ -408,7 +415,7 @@
Dom clusterDom = Dom.unwrap(cluster);
Domain domain = clusterDom.getHabitat().getService(Domain.class);
- ArrayList<Server> instances = new ArrayList<Server>();
+ ArrayList<Server> instances = new ArrayList<>();
for (ServerRef sRef : cluster.getServerRef()) {
Server svr = domain.getServerNamed(sRef.getRef());
// the instance's domain.xml only has its own server
@@ -456,6 +463,7 @@
if (ref != null) {
ConfigSupport.apply(new SingleConfigCode<Cluster>() {
+ @Override
public Object run(Cluster param) {
return param.getResourceRef().remove(ref);
}
@@ -467,6 +475,7 @@
ConfigSupport.apply(new SingleConfigCode<Cluster>() {
+ @Override
public Object run(Cluster param) throws PropertyVetoException, TransactionFailure {
ResourceRef newResourceRef = param.createChild(ResourceRef.class);
@@ -479,7 +488,7 @@
}
public static <T extends ClusterExtension> List<T> getExtensionsByType(Cluster cluster, Class<T> type) {
- List<T> extensions = new ArrayList<T>();
+ List<T> extensions = new ArrayList<>();
for (ClusterExtension ce : cluster.getExtensions()) {
try {
type.cast(ce);
@@ -829,8 +838,9 @@
// check if the config is null or still in use by some other
// ReferenceContainer or is not <cluster-name>-config -- if so just return...
- if (config == null || domain.getReferenceContainersOf(config).size() > 1 || !instanceConfig.equals(child.getName() + "-config"))
+ if (config == null || domain.getReferenceContainersOf(config).size() > 1 || !instanceConfig.equals(child.getName() + "-config")) {
return;
+ }
try {
File configConfigDir = new File(env.getConfigDirPath(), config.getName());
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java
index 588aa7a..de372c6 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ClusterRef.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -17,18 +18,22 @@
package com.sun.enterprise.config.serverbeans;
import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
+
import jakarta.validation.Payload;
-import org.jvnet.hk2.config.*;
-import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
-
-import java.beans.PropertyVetoException;
-
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
+import java.beans.PropertyVetoException;
+
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
+
/**
* Element relating a reference to a cluster to be load balanced to an (optional) health-checker
- *
*/
/* @XmlType(name = "", propOrder = {
@@ -47,17 +52,16 @@
@Override
@Attribute(key = true)
@NotNull
- @Pattern(regexp = NAME_SERVER_REGEX)
+ @Pattern(regexp = NAME_SERVER_REGEX, message = "{config.invalid.name}")
@ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.cluster-ref}", type = Cluster.class)
- public String getRef();
+ String getRef();
/**
* Sets the value of the ref property.
*
* @param value allowed object is {@link String }
*/
- @Override
- public void setRef(String value) throws PropertyVetoException;
+ @Override void setRef(String value) throws PropertyVetoException;
/**
* Gets the value of the lbPolicy property.
@@ -70,14 +74,14 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "round-robin")
- public String getLbPolicy();
+ String getLbPolicy();
/**
* Sets the value of the lbPolicy property.
*
* @param value allowed object is {@link String }
*/
- public void setLbPolicy(String value) throws PropertyVetoException;
+ void setLbPolicy(String value) throws PropertyVetoException;
/**
* Gets the value of the lbPolicyModule property.
@@ -89,14 +93,14 @@
* @return possible object is {@link String }
*/
@Attribute
- public String getLbPolicyModule();
+ String getLbPolicyModule();
/**
* Sets the value of the lbPolicyModule property.
*
* @param value allowed object is {@link String }
*/
- public void setLbPolicyModule(String value) throws PropertyVetoException;
+ void setLbPolicyModule(String value) throws PropertyVetoException;
/**
* Gets the value of the healthChecker property.
@@ -106,12 +110,12 @@
* @return possible object is {@link HealthChecker }
*/
@Element
- public HealthChecker getHealthChecker();
+ HealthChecker getHealthChecker();
/**
* Sets the value of the healthChecker property.
*
* @param value allowed object is {@link HealthChecker }
*/
- public void setHealthChecker(HealthChecker value) throws PropertyVetoException;
+ void setHealthChecker(HealthChecker value) throws PropertyVetoException;
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java
index a48383a..a01b3b5 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Config.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -17,10 +18,21 @@
package com.sun.enterprise.config.serverbeans;
import com.sun.common.util.logging.LoggingConfigImpl;
-import com.sun.enterprise.config.modularity.parser.ModuleConfigurationLoader;
import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
import com.sun.enterprise.config.util.ServerHelper;
+
+import jakarta.validation.Payload;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+import java.io.IOException;
+import java.lang.reflect.Proxy;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.glassfish.api.admin.config.ConfigExtension;
import org.glassfish.api.admin.config.Container;
import org.glassfish.api.admin.config.Named;
@@ -29,26 +41,25 @@
import org.glassfish.config.support.datatypes.Port;
import org.glassfish.grizzly.config.dom.NetworkConfig;
import org.glassfish.grizzly.config.dom.NetworkListener;
-import org.glassfish.hk2.api.ActiveDescriptor;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.utilities.BuilderHelper;
import org.glassfish.hk2.utilities.ServiceLocatorUtilities;
import org.glassfish.quality.ToDo;
import org.glassfish.server.ServerEnvironmentImpl;
-import org.jvnet.hk2.config.*;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBean;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigExtensionMethod;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.ConfigView;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.TransactionFailure;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import jakarta.validation.Payload;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-import java.io.IOException;
-import java.lang.reflect.Proxy;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
/**
@@ -373,8 +384,9 @@
try {
String type = c.getAdminService().getType();
- if (type != null && (type.equals("das") || type.equals("das-and-server")))
+ if (type != null && (type.equals("das") || type.equals("das-and-server"))) {
return true;
+ }
} catch (Exception e) {
// fall through
}
@@ -401,7 +413,7 @@
LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());
- Map<String, String> map = new HashMap<String, String>();
+ Map<String, String> map = new HashMap<>();
try {
map = loggingConfig.getLoggingProperties();
} catch (IOException ex) {
@@ -415,7 +427,7 @@
LoggingConfigImpl loggingConfig = new LoggingConfigImpl();
loggingConfig.setupConfigDir(env.getConfigDirPath(), env.getLibPath());
- Map<String, String> map = new HashMap<String, String>();
+ Map<String, String> map = new HashMap<>();
try {
map = loggingConfig.updateLoggingProperties(properties);
} catch (IOException ex) {
@@ -463,6 +475,7 @@
public static void createResourceRef(Config config, final String enabled, final String refName) throws TransactionFailure {
ConfigSupport.apply(new SingleConfigCode<Config>() {
+ @Override
public Object run(Config param) throws PropertyVetoException, TransactionFailure {
ResourceRef newResourceRef = param.createChild(ResourceRef.class);
@@ -492,6 +505,7 @@
if (ref != null) {
ConfigSupport.apply(new SingleConfigCode<Config>() {
+ @Override
public Object run(Config param) {
return param.getResourceRef().remove(ref);
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java
index f5eedd5..8e6a5fe 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Domain.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,9 +17,20 @@
package com.sun.enterprise.config.serverbeans;
-import com.sun.enterprise.config.modularity.parser.ModuleConfigurationLoader;
import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
import com.sun.enterprise.util.StringUtils;
+
+import jakarta.validation.constraints.NotNull;
+
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import org.glassfish.api.admin.config.ApplicationName;
import org.glassfish.api.admin.config.PropertiesDesc;
import org.glassfish.api.admin.config.PropertyDesc;
@@ -30,20 +42,9 @@
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.DuckTyped;
import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.TransactionFailure;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import jakarta.validation.constraints.NotNull;
-import java.beans.PropertyVetoException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
@Configured
/**
* Top level Domain Element that includes applications, resources, configs, servers, clusters and node-agents, load
@@ -52,7 +53,7 @@
*/
public interface Domain extends ConfigBeanProxy, PropertyBag, SystemPropertyBag, ConfigLoader {
- public static final String DOMAIN_NAME_PROPERTY = "administrative.domain.name";
+ String DOMAIN_NAME_PROPERTY = "administrative.domain.name";
/**
* Gets the value of the applicationRoot property.
@@ -269,6 +270,7 @@
* <p/>
* Objects of the following type(s) are allowed in the list {@link SystemProperty }
*/
+ @Override
@ToDo(priority = ToDo.Priority.IMPORTANT, details = "Any more legal system properties?")
@PropertiesDesc(systemProperties = true, props = {
@PropertyDesc(name = "com.sun.aas.installRoot", description = "Operating system dependent. Path to the directory where the server is installed"),
@@ -294,6 +296,7 @@
/**
* Properties as per {@link PropertyBag}
*/
+ @Override
@ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
@PropertiesDesc(props = {})
@Element
@@ -376,8 +379,7 @@
@DuckTyped
List<String> getAllTargets();
- @DuckTyped
- public List<String> getTargets(final String tgt);
+ @DuckTyped List<String> getTargets(final String tgt);
@DuckTyped
List<Application> getApplicationsInTarget(String target);
@@ -428,16 +430,18 @@
* or if no matches
*/
public static List<Server> getInstancesOnNode(Domain domain, String nodeName) {
- List<Server> ret = new LinkedList<Server>();
+ List<Server> ret = new LinkedList<>();
try {
- if (!StringUtils.ok(nodeName))
+ if (!StringUtils.ok(nodeName)) {
return ret;
+ }
List<Server> servers = domain.getServers().getServer();
for (Server server : servers) {
- if (nodeName.equals(server.getNodeRef()))
+ if (nodeName.equals(server.getNodeRef())) {
ret.add(server);
+ }
}
} catch (Exception e) {
logger.log(Level.WARNING, ConfigApiLoggerInfo.errorGettingServers, e.getLocalizedMessage());
@@ -450,7 +454,7 @@
*/
public static List<Cluster> getClustersOnNode(Domain domain, String nodeName) {
- HashMap<String, Cluster> clMap = new HashMap<String, Cluster>();
+ HashMap<String, Cluster> clMap = new HashMap<>();
List<Server> serverList = getInstancesOnNode(domain, nodeName);
try {
@@ -468,12 +472,13 @@
}
public static List<Application> getAllDefinedSystemApplications(Domain me) {
- List<Application> allSysApps = new ArrayList<Application>();
+ List<Application> allSysApps = new ArrayList<>();
SystemApplications sa = me.getSystemApplications();
if (sa != null) {
for (ApplicationName m : sa.getModules()) {
- if (m instanceof Application)
+ if (m instanceof Application) {
allSysApps.add((Application) m);
+ }
}
}
return Collections.unmodifiableList(allSysApps);
@@ -512,14 +517,17 @@
}
public static List<Application> getSystemApplicationsReferencedFrom(Domain d, String sn) {
- if (d == null || sn == null)
+ if (d == null || sn == null) {
throw new IllegalArgumentException("Null argument");
+ }
List<Application> allApps = d.getAllDefinedSystemApplications();
if (allApps.isEmpty())
+ {
return allApps; //if there are no sys-apps, none can reference one :)
+ }
//allApps now contains ALL the system applications
Server s = getServerNamed(d, sn);
- List<Application> referencedApps = new ArrayList<Application>();
+ List<Application> referencedApps = new ArrayList<>();
List<ApplicationRef> appsReferenced = s.getApplicationRef();
for (ApplicationRef ref : appsReferenced) {
for (Application app : allApps) {
@@ -545,15 +553,17 @@
public static boolean isNamedSystemApplicationReferencedFrom(Domain d, String appName, String serverName) {
List<Application> referencedApps = getSystemApplicationsReferencedFrom(d, serverName);
for (Application app : referencedApps) {
- if (app.getName().equals(appName))
+ if (app.getName().equals(appName)) {
return true;
+ }
}
return false;
}
public static Server getServerNamed(Domain d, String name) {
- if (d.getServers() == null || name == null)
+ if (d.getServers() == null || name == null) {
throw new IllegalArgumentException("no <servers> element");
+ }
List<Server> servers = d.getServers().getServer();
for (Server s : servers) {
if (name.equals(s.getName().trim())) {
@@ -564,8 +574,9 @@
}
public static Config getConfigNamed(Domain d, String name) {
- if (d.getConfigs() == null || name == null)
+ if (d.getConfigs() == null || name == null) {
throw new IllegalArgumentException("no <config> element");
+ }
List<Config> configs = d.getConfigs().getConfig();
for (Config c : configs) {
if (name.equals(c.getName().trim())) {
@@ -608,7 +619,7 @@
return false;
}
- List<String> targets = new ArrayList<String>();
+ List<String> targets = new ArrayList<>();
if (!target.equals("domain")) {
targets.add(target);
} else {
@@ -639,7 +650,7 @@
}
public static List<Server> getServersInTarget(Domain me, String target) {
- List<Server> servers = new ArrayList<Server>();
+ List<Server> servers = new ArrayList<>();
Server server = me.getServerNamed(target);
if (server != null) {
servers.add(server);
@@ -657,7 +668,7 @@
}
public static List<String> getTargets(final Domain me, final String tgt) {
- List<String> targets = new ArrayList<String>();
+ List<String> targets = new ArrayList<>();
if (!tgt.equals("domain")) {
targets.add(tgt);
} else {
@@ -668,7 +679,7 @@
public static List<ApplicationRef> getApplicationRefsInTarget(Domain me, String tgt, boolean includeInstances) {
List<String> targets = getTargets(me, tgt);
- List<ApplicationRef> allAppRefs = new ArrayList<ApplicationRef>();
+ List<ApplicationRef> allAppRefs = new ArrayList<>();
for (String target : targets) {
Server server = me.getServerNamed(target);
@@ -731,7 +742,7 @@
public static boolean isAppEnabledInTarget(Domain me, String appName, String target) {
Application application = me.getApplications().getApplication(appName);
if (application != null && Boolean.valueOf(application.getEnabled())) {
- List<String> targets = new ArrayList<String>();
+ List<String> targets = new ArrayList<>();
if (!target.equals("domain")) {
targets.add(target);
} else {
@@ -748,7 +759,7 @@
}
public static List<String> getAllTargets(Domain d) {
- List<String> targets = new ArrayList<String>();
+ List<String> targets = new ArrayList<>();
// only add non-clustered servers as the cluster
// targets will be separately added
for (Server server : d.getServers().getServer()) {
@@ -765,7 +776,7 @@
}
public static List<String> getAllReferencedTargetsForApplication(Domain me, String appName) {
- List<String> referencedTargets = new ArrayList<String>();
+ List<String> referencedTargets = new ArrayList<>();
for (String target : me.getAllTargets()) {
if (me.getApplicationRefInTarget(appName, target) != null) {
referencedTargets.add(target);
@@ -793,7 +804,7 @@
return me.getApplications().getApplications();
}
- List<Application> apps = new ArrayList<Application>();
+ List<Application> apps = new ArrayList<>();
List<ApplicationRef> applicationRefs = me.getApplicationRefsInTarget(target);
for (ApplicationRef ref : applicationRefs) {
@@ -827,36 +838,40 @@
// Clusters and Servers are ReferenceContainers
Cluster c = getClusterNamed(d, name);
- if (c != null)
+ if (c != null) {
return c;
+ }
return getServerNamed(d, name);
}
public static List<ReferenceContainer> getReferenceContainersOf(Domain d, Config config) {
// Clusters and Servers are ReferenceContainers
- List<ReferenceContainer> sub = new LinkedList<ReferenceContainer>();
+ List<ReferenceContainer> sub = new LinkedList<>();
// both the config and its name need to be sanity-checked
String name = null;
- if (config != null)
+ if (config != null) {
name = config.getName();
+ }
- if (!StringUtils.ok(name)) // we choose to make this not an error
- return sub;
+ if (!StringUtils.ok(name)) { // we choose to make this not an error
+ return sub;
+ }
List<ReferenceContainer> all = getAllReferenceContainers(d);
for (ReferenceContainer rc : all) {
- if (name.equals(rc.getReference()))
+ if (name.equals(rc.getReference())) {
sub.add(rc);
+ }
}
return sub;
}
public static List<ReferenceContainer> getAllReferenceContainers(Domain d) {
- List<ReferenceContainer> ReferenceContainers = new LinkedList<ReferenceContainer>();
+ List<ReferenceContainer> ReferenceContainers = new LinkedList<>();
ReferenceContainers.addAll(d.getServers().getServer());
if (d.getClusters() != null) {
ReferenceContainers.addAll(d.getClusters().getCluster());
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java
index d4a6eb8..af5eb5f 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/HttpService.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,23 +17,33 @@
package com.sun.enterprise.config.serverbeans;
-import java.beans.PropertyVetoException;
-import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
-import org.glassfish.api.admin.config.ConfigExtension;
-import org.jvnet.hk2.config.*;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.admin.config.PropertiesDesc;
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.config.support.datatypes.NonNegativeInteger;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.api.admin.config.ConfigExtension;
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.glassfish.config.support.datatypes.NonNegativeInteger;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.TransactionFailure;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
@Configured
public interface HttpService extends ConfigBeanProxy, PropertyBag, ConfigExtension {
@@ -81,7 +92,7 @@
List<String> getNonAdminVirtualServerList();
@Attribute(defaultValue = "false")
- @Pattern(regexp = "(false|true|on|off)")
+ @Pattern(regexp = "(false|true|on|off)", message = "Valid values: true|false")
String getAccessLoggingEnabled();
void setAccessLoggingEnabled(String enabled);
@@ -96,7 +107,7 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "false")
- @Pattern(regexp = "(true|false|on|off)")
+ @Pattern(regexp = "(true|false|on|off)", message = "Valid values: true|false")
String getSsoEnabled();
/**
@@ -119,7 +130,7 @@
}
public static List<String> getNonAdminVirtualServerList(HttpService target) {
- List<String> nonAdminVSList = new ArrayList<String>();
+ List<String> nonAdminVSList = new ArrayList<>();
for (VirtualServer v : target.getVirtualServer()) {
if (!v.getId().equals("__asadmin")) {
nonAdminVSList.add(v.getId());
@@ -162,6 +173,7 @@
}
}
+ @Override
@PropertiesDesc(props = {
@PropertyDesc(name = "monitoring-cache-enabled", defaultValue = "true", dataType = Boolean.class, description = "Enables the monitoring cache"),
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java
index 908b8aa..7525eb9 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/MessageSecurityConfig.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,20 +17,19 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-import java.io.Serializable;
-import java.util.List;
-
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
-import org.glassfish.api.admin.RestRedirects;
+import java.beans.PropertyVetoException;
+import java.util.List;
+
import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
import static org.glassfish.config.support.Constants.NAME_REGEX;
/**
@@ -43,8 +43,10 @@
}) */
@Configured
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-message-security-provider"),
- @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-message-security-provider") })
+@RestRedirects({
+ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-message-security-provider"),
+ @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-message-security-provider")
+})
public interface MessageSecurityConfig extends ConfigBeanProxy {
/**
@@ -57,14 +59,14 @@
*/
@Attribute(key = true)
@NotNull
- public String getAuthLayer();
+ String getAuthLayer();
/**
* Sets the value of the authLayer property.
*
* @param value allowed object is {@link String }
*/
- public void setAuthLayer(String value) throws PropertyVetoException;
+ void setAuthLayer(String value) throws PropertyVetoException;
/**
* Gets the value of the defaultProvider property.
@@ -78,15 +80,15 @@
* @return possible object is {@link String }
*/
@Attribute
- @Pattern(regexp = NAME_REGEX)
- public String getDefaultProvider();
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+ String getDefaultProvider();
/**
* Sets the value of the defaultProvider property.
*
* @param value allowed object is {@link String }
*/
- public void setDefaultProvider(String value) throws PropertyVetoException;
+ void setDefaultProvider(String value) throws PropertyVetoException;
/**
* Gets the value of the defaultClientProvider property.
@@ -97,15 +99,15 @@
* @return possible object is {@link String }
*/
@Attribute
- @Pattern(regexp = NAME_REGEX)
- public String getDefaultClientProvider();
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+ String getDefaultClientProvider();
/**
* Sets the value of the defaultClientProvider property.
*
* @param value allowed object is {@link String }
*/
- public void setDefaultClientProvider(String value) throws PropertyVetoException;
+ void setDefaultClientProvider(String value) throws PropertyVetoException;
/**
* Gets the value of the providerConfig property.
@@ -127,5 +129,5 @@
* Objects of the following type(s) are allowed in the list {@link ProviderConfig }
*/
@Element(required = true)
- public List<ProviderConfig> getProviderConfig();
+ List<ProviderConfig> getProviderConfig();
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java
index 12506c9..e3a96fc 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ModuleMonitoringLevels.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,22 +17,20 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
import java.util.List;
import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.Pattern;
-
/**
*
*/
@@ -43,59 +42,59 @@
@Configured
public interface ModuleMonitoringLevels extends ConfigBeanProxy, PropertyBag {
+ String MONITORING_LEVELS = "(OFF|LOW|HIGH)";
+ String MONITORING_LEVELS_MSG = "Valid values: " + MONITORING_LEVELS;
+
/**
* Gets the value of the threadPool property.
- *
* All the thread-pools used by the run time
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getThreadPool();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getThreadPool();
/**
* Sets the value of the threadPool property.
*
* @param value allowed object is {@link String }
*/
- public void setThreadPool(String value) throws PropertyVetoException;
+ void setThreadPool(String value) throws PropertyVetoException;
/**
* Gets the value of the orb property.
- *
* Specifies the level for connection managers of the orb, which apply to connections to the orb
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getOrb();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getOrb();
/**
* Sets the value of the orb property.
*
* @param value allowed object is {@link String }
*/
- public void setOrb(String value) throws PropertyVetoException;
+ void setOrb(String value) throws PropertyVetoException;
/**
* Gets the value of the ejbContainer property.
- *
* Various ejbs deployed to the server, ejb-pools, ejb-caches & ejb-methods
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getEjbContainer();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getEjbContainer();
/**
* Sets the value of the ejbContainer property.
*
* @param value allowed object is {@link String }
*/
- public void setEjbContainer(String value) throws PropertyVetoException;
+ void setEjbContainer(String value) throws PropertyVetoException;
/**
* Gets the value of the webContainer property.
@@ -103,15 +102,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getWebContainer();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getWebContainer();
/**
* Sets the value of the webContainer property.
*
* @param value allowed object is {@link String }
*/
- public void setWebContainer(String value) throws PropertyVetoException;
+ void setWebContainer(String value) throws PropertyVetoException;
/**
* Gets the value of the deployment property.
@@ -119,87 +118,83 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getDeployment();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getDeployment();
/**
* Sets the value of the webContainer property.
*
* @param value allowed object is {@link String }
*/
- public void setDeployment(String value) throws PropertyVetoException;
+ void setDeployment(String value) throws PropertyVetoException;
/**
* Gets the value of the transactionService property.
- *
* Transaction subsystem
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getTransactionService();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getTransactionService();
/**
* Sets the value of the transactionService property.
*
* @param value allowed object is {@link String }
*/
- public void setTransactionService(String value) throws PropertyVetoException;
+ void setTransactionService(String value) throws PropertyVetoException;
/**
* Gets the value of the httpService property.
- *
* http engine and the http listeners therein.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getHttpService();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getHttpService();
/**
* Sets the value of the httpService property.
*
* @param value allowed object is {@link String }
*/
- public void setHttpService(String value) throws PropertyVetoException;
+ void setHttpService(String value) throws PropertyVetoException;
/**
* Gets the value of the jdbcConnectionPool property.
- *
* Monitoring level for all the jdbc-connection-pools used by the runtime.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getJdbcConnectionPool();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getJdbcConnectionPool();
/**
* Sets the value of the jdbcConnectionPool property.
*
* @param value allowed object is {@link String }
*/
- public void setJdbcConnectionPool(String value) throws PropertyVetoException;
+ void setJdbcConnectionPool(String value) throws PropertyVetoException;
/**
* Gets the value of the connectorConnectionPool property.
- *
* Monitoring level for all the connector-connection-pools used by runtime.
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getConnectorConnectionPool();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getConnectorConnectionPool();
/**
* Sets the value of the connectorConnectionPool property.
*
* @param value allowed object is {@link String }
*/
- public void setConnectorConnectionPool(String value) throws PropertyVetoException;
+ void setConnectorConnectionPool(String value) throws PropertyVetoException;
/**
* Gets the value of the connectorService property.
@@ -207,15 +202,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getConnectorService();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getConnectorService();
/**
* Sets the value of the connectorService property.
*
* @param value allowed object is {@link String }
*/
- public void setConnectorService(String value) throws PropertyVetoException;
+ void setConnectorService(String value) throws PropertyVetoException;
/**
* Gets the value of the jmsService property.
@@ -223,15 +218,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getJmsService();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getJmsService();
/**
* Sets the value of the jmsService property.
*
* @param value allowed object is {@link String }
*/
- public void setJmsService(String value) throws PropertyVetoException;
+ void setJmsService(String value) throws PropertyVetoException;
/**
* Gets the value of the jvm property.
@@ -239,15 +234,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getJvm();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getJvm();
/**
* Sets the value of the jvm property.
*
* @param value allowed object is {@link String }
*/
- public void setJvm(String value) throws PropertyVetoException;
+ void setJvm(String value) throws PropertyVetoException;
/**
* Gets the value of the security property.
@@ -255,15 +250,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getSecurity();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getSecurity();
/**
* Sets the value of the security property.
*
* @param value allowed object is {@link String }
*/
- public void setSecurity(String value) throws PropertyVetoException;
+ void setSecurity(String value) throws PropertyVetoException;
/**
* Gets the value of the web-service-container property.
@@ -271,15 +266,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getWebServicesContainer();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getWebServicesContainer();
/**
* Sets the value of the web-service-container property.
*
* @param value allowed object is {@link String }
*/
- public void setWebServicesContainer(String value) throws PropertyVetoException;
+ void setWebServicesContainer(String value) throws PropertyVetoException;
/**
* Gets the value of the jpa property.
@@ -287,15 +282,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getJpa();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getJpa();
/**
* Sets the value of the jpa property.
*
* @param value allowed object is {@link String }
*/
- public void setJpa(String value) throws PropertyVetoException;
+ void setJpa(String value) throws PropertyVetoException;
/**
* Gets the value of the jax-ra property.
@@ -303,15 +298,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getJersey();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getJersey();
/**
* Sets the value of the jax-ra property.
*
* @param value allowed object is {@link String }
*/
- public void setJersey(String value) throws PropertyVetoException;
+ void setJersey(String value) throws PropertyVetoException;
/**
* Gets the value of the cloudTenantManager property.
@@ -319,15 +314,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getCloudTenantManager();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getCloudTenantManager();
/**
* Sets the value of the cloudTenantManager property.
*
* @param value allowed object is {@link String }
*/
- public void setCloudTenantManager(String value) throws PropertyVetoException;
+ void setCloudTenantManager(String value) throws PropertyVetoException;
/**
* Gets the value of the cloud property.
@@ -335,15 +330,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getCloud();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getCloud();
/**
* Sets the value of the cloud property.
*
* @param value allowed object is {@link String }
*/
- public void setCloud(String value) throws PropertyVetoException;
+ void setCloud(String value) throws PropertyVetoException;
/**
* Gets the value of the cloud Orchestrator property.
@@ -351,15 +346,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getCloudOrchestrator();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getCloudOrchestrator();
/**
* Sets the value of the cloud Orchestrator property.
*
* @param value allowed object is {@link String }
*/
- public void setCloudOrchestrator(String value) throws PropertyVetoException;
+ void setCloudOrchestrator(String value) throws PropertyVetoException;
/**
* Gets the value of the cloud Elasticity property.
@@ -367,19 +362,15 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getCloudElasticity();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getCloudElasticity();
/**
* Sets the value of the cloud elasticity property.
*
* @param value allowed object is {@link String }
*/
- public void setCloudElasticity(String value) throws PropertyVetoException;
-
- /**
- * Properties as per {@link PropertyBag}
- */
+ void setCloudElasticity(String value) throws PropertyVetoException;
/**
* Gets the value of the cloud IMS property.
@@ -387,20 +378,20 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "OFF")
- @Pattern(regexp = "(OFF|LOW|HIGH)")
- public String getCloudVirtAssemblyService();
+ @Pattern(regexp = MONITORING_LEVELS, message = MONITORING_LEVELS_MSG)
+ String getCloudVirtAssemblyService();
/**
* Sets the value of the cloud IMS property.
*
* @param value allowed object is {@link String }
*/
- public void setCloudVirtAssemblyService(String value) throws PropertyVetoException;
+ void setCloudVirtAssemblyService(String value) throws PropertyVetoException;
/**
* Properties as per {@link PropertyBag}
*/
-
+ @Override
@ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
@PropertiesDesc(props = {})
@Element
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java
index b6a33ba..83bec43 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Profiler.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,23 +17,22 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
import java.util.List;
import org.glassfish.api.admin.config.PropertiesDesc;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
import org.jvnet.hk2.config.types.Property;
import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.quality.ToDo;
-
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
+import static org.glassfish.config.support.Constants.NAME_REGEX;
/**
*
@@ -59,15 +59,15 @@
*/
@Attribute(key = false) // bizarre case of having a name, but it's not a key; it's a singleton
@NotNull
- @Pattern(regexp = NAME_REGEX)
- public String getName();
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+ String getName();
/**
* Sets the value of the name property.
*
* @param value allowed object is {@link String }
*/
- public void setName(String value) throws PropertyVetoException;
+ void setName(String value) throws PropertyVetoException;
/**
* Gets the value of the classpath property.
@@ -75,14 +75,14 @@
* @return possible object is {@link String }
*/
@Attribute
- public String getClasspath();
+ String getClasspath();
/**
* Sets the value of the classpath property.
*
* @param value allowed object is {@link String }
*/
- public void setClasspath(String value) throws PropertyVetoException;
+ void setClasspath(String value) throws PropertyVetoException;
/**
* Gets the value of the nativeLibraryPath property.
@@ -90,14 +90,14 @@
* @return possible object is {@link String }
*/
@Attribute
- public String getNativeLibraryPath();
+ String getNativeLibraryPath();
/**
* Sets the value of the nativeLibraryPath property.
*
* @param value allowed object is {@link String }
*/
- public void setNativeLibraryPath(String value) throws PropertyVetoException;
+ void setNativeLibraryPath(String value) throws PropertyVetoException;
/**
* Gets the value of the enabled property.
@@ -105,18 +105,19 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "true", dataType = Boolean.class)
- public String getEnabled();
+ String getEnabled();
/**
* Sets the value of the enabled property.
*
* @param value allowed object is {@link String }
*/
- public void setEnabled(String value) throws PropertyVetoException;
+ void setEnabled(String value) throws PropertyVetoException;
/**
* Properties as per {@link org.jvnet.hk2.config.types.PropertyBag}
*/
+ @Override
@ToDo(priority = ToDo.Priority.IMPORTANT, details = "Provide PropertyDesc for legal props")
@PropertiesDesc(props = {})
@Element
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java
index 2d4e93d..d3ace24 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ProviderConfig.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,24 +17,24 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-import java.util.List;
-
-import org.glassfish.api.admin.config.PropertyDesc;
-import org.glassfish.api.admin.config.PropertiesDesc;
-import static org.glassfish.config.support.Constants.NAME_REGEX;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
+import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
-import com.sun.enterprise.config.serverbeans.customvalidators.JavaClassName;
+import java.beans.PropertyVetoException;
+import java.util.List;
+
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.PropertyDesc;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
+import static org.glassfish.config.support.Constants.NAME_REGEX;
/**
* The provider-config element defines the configuration of an authentication provider
@@ -52,120 +53,141 @@
@Configured
public interface ProviderConfig extends ConfigBeanProxy, PropertyBag {
+ String PROVIDER_TYPES = "(client|server|client-server)";
+
/**
* Gets the value of the providerId property.
- *
* Identifier used to uniquely identify this provider-config element
*
* @return possible object is {@link String }
*/
@Attribute(key = true)
- @Pattern(regexp = NAME_REGEX)
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
@NotNull
- public String getProviderId();
+ String getProviderId();
/**
* Sets the value of the providerId property.
*
* @param value allowed object is {@link String }
*/
- public void setProviderId(String value) throws PropertyVetoException;
+ void setProviderId(String value) throws PropertyVetoException;
/**
* Gets the value of the providerType property.
- *
- * Defines whether the provider is a client authentication provider or a server authentication provider.
+ * Defines whether the provider is a client authentication provider or a server authentication
+ * provider.
*
* @return possible object is {@link String }
*/
@Attribute
@NotNull
- @Pattern(regexp = "(client|server|client-server)")
- public String getProviderType();
+ @Pattern(regexp = PROVIDER_TYPES, message = "Valid values: " + PROVIDER_TYPES)
+ String getProviderType();
/**
* Sets the value of the providerType property.
*
* @param value allowed object is {@link String }
*/
- public void setProviderType(String value) throws PropertyVetoException;
+ void setProviderType(String value) throws PropertyVetoException;
/**
* Gets the value of the className property.
- *
* Defines the java implementation class of the provider.
- *
- * Client authentication providers must implement the com.sun.enterprise.security.jauth.ClientAuthModule interface.
- *
- * Server-side providers must implement the com.sun.enterprise.security.jauth.ServerAuthModule interface.
- *
- * A provider may implement both interfaces, but it must implement the interface corresponding to its provider type.
+ * Client authentication providers must implement the
+ * com.sun.enterprise.security.jauth.ClientAuthModule interface.
+ * Server-side providers must implement the com.sun.enterprise.security.jauth.ServerAuthModule
+ * interface.
+ * A provider may implement both interfaces, but it must implement the interface corresponding
+ * to its provider type.
*
* @return possible object is {@link String }
*/
@Attribute
@NotNull
@JavaClassName
- public String getClassName();
+ String getClassName();
/**
* Sets the value of the className property.
*
* @param value allowed object is {@link String }
*/
- public void setClassName(String value) throws PropertyVetoException;
+ void setClassName(String value) throws PropertyVetoException;
/**
* Gets the value of the requestPolicy property.
- *
- * Defines the authentication policy requirements associated with request processing performed by the authentication
+ * Defines the authentication policy requirements associated with request processing performed
+ * by the authentication
* provider
*
* @return possible object is {@link RequestPolicy }
*/
@Element
- public RequestPolicy getRequestPolicy();
+ RequestPolicy getRequestPolicy();
/**
* Sets the value of the requestPolicy property.
*
* @param value allowed object is {@link RequestPolicy }
*/
- public void setRequestPolicy(RequestPolicy value) throws PropertyVetoException;
+ void setRequestPolicy(RequestPolicy value) throws PropertyVetoException;
/**
* Gets the value of the responsePolicy property.
- *
- * Defines the authentication policy requirements associated with the response processing performed by the
+ * Defines the authentication policy requirements associated with the response processing
+ * performed by the
* authentication provider.
*
* @return possible object is {@link ResponsePolicy }
*/
@Element
- public ResponsePolicy getResponsePolicy();
+ ResponsePolicy getResponsePolicy();
/**
* Sets the value of the responsePolicy property.
*
* @param value allowed object is {@link ResponsePolicy }
*/
- public void setResponsePolicy(ResponsePolicy value) throws PropertyVetoException;
+ void setResponsePolicy(ResponsePolicy value) throws PropertyVetoException;
/**
* Properties.
*/
- @PropertiesDesc(props = {
- @PropertyDesc(name = "security.config", defaultValue = "${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml", description = "Specifies the location of the message security configuration file"),
+ @Override
+ @PropertiesDesc(
+ props = {
+ @PropertyDesc(
+ name = "security.config",
+ defaultValue = "${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml",
+ description = "Specifies the location of the message security configuration file"),
- @PropertyDesc(name = "debug", defaultValue = "false", dataType = Boolean.class, description = "Enables dumping of server provider debug messages to the server log"),
+ @PropertyDesc(
+ name = "debug",
+ defaultValue = "false",
+ dataType = Boolean.class,
+ description = "Enables dumping of server provider debug messages to the server log"),
- @PropertyDesc(name = "dynamic.username.password", defaultValue = "false", dataType = Boolean.class, description = "Signals the provider runtime to collect the user name and password from the "
+ @PropertyDesc(
+ name = "dynamic.username.password",
+ defaultValue = "false",
+ dataType = Boolean.class,
+ description = "Signals the provider runtime to collect the user name and password from the "
+ "CallbackHandler for each request. If false, the user name and password for wsse:UsernameToken(s) is "
+ "collected once, during module initialization. Applicable only for a ClientAuthModule"),
- @PropertyDesc(name = "encryption.key.alias", defaultValue = "s1as", description = "Specifies the encryption key used by the provider. The key is identified by its keystore alias"),
+ @PropertyDesc(
+ name = "encryption.key.alias",
+ defaultValue = "s1as",
+ description = "Specifies the encryption key used by the provider. The key is identified by its keystore alias"),
- @PropertyDesc(name = "signature.key.alias", defaultValue = "s1as", description = "Specifies the signature key used by the provider. The key is identified by its keystore alias") })
+ @PropertyDesc(
+ name = "signature.key.alias",
+ defaultValue = "s1as",
+ description = "Specifies the signature key used by the provider. The key is identified by its keystore alias")
+ }
+ )
@Element
List<Property> getProperty();
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java
index 874fc34..38b3207 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/RequestPolicy.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,18 +17,19 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-import java.io.Serializable;
-
import jakarta.validation.constraints.Pattern;
+import java.beans.PropertyVetoException;
+
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+
/**
- * Used to define the authentication policy requirements associated with the request processing performed by an
- * authentication provider (i.e. when a client provider's ClientAuthModule.initiateRequest() method is called or when a
+ * Used to define the authentication policy requirements associated with the request processing
+ * performed by an
+ * authentication provider (i.e. when a client provider's ClientAuthModule.initiateRequest() method
+ * is called or when a
* server provider's ServerAuthModule.validateRequest() method is called)
*/
@@ -36,46 +38,49 @@
@Configured
public interface RequestPolicy extends ConfigBeanProxy {
+ String AUTH_RECIPIENT_TIMINGS = "(before-content|after-content)";
+ String AUTH_SOURCES = "(sender|content|username-password)";
+
/**
* Gets the value of the authSource property.
- *
- * Defines a requirement for message layer sender authentication (e.g. username password) or content authentication
+ * Defines a requirement for message layer sender authentication (e.g. username password) or
+ * content authentication
* (e.g. digital signature)
*
* @return possible object is {@link String }
*/
@Attribute
- @Pattern(regexp = "(sender|content|username-password)")
- public String getAuthSource();
+ @Pattern(regexp = AUTH_SOURCES, message = "Valid values: " + AUTH_SOURCES)
+ String getAuthSource();
/**
* Sets the value of the authSource property.
*
* @param value allowed object is {@link String }
*/
- public void setAuthSource(String value) throws PropertyVetoException;
+ void setAuthSource(String value) throws PropertyVetoException;
/**
- * Specifies whether recipient authentication occurs before or after content authentication. Allowed values are
- * 'before-content' and 'after-content'.
- *
- * Defines a requirement for message layer authentication of the reciever of a message to its sender (e.g. by XML
- * encryption). before-content indicates that recipient authentication (e.g. encryption) is to occur before any content
- * authentication (e.g. encrypt then sign) with respect to the target of the containing auth-policy. after-content
- * indicates that recipient authentication (e.g. encryption) is to occur after any content authentication (e.g. sign
+ * Specifies whether recipient authentication occurs before or after content authentication.
+ * Allowed values are 'before-content' and 'after-content'.
+ * Defines a requirement for message layer authentication of the reciever of a message to its
+ * sender (e.g. by XML encryption). before-content indicates that recipient authentication
+ * (e.g. encryption) is to occur before any content authentication (e.g. encrypt then sign) with
+ * respect to the target of the containing auth-policy. after-content indicates that recipient
+ * authentication (e.g. encryption) is to occur after any content authentication (e.g. sign
* then encrypt) with respect to the target of the containing auth-policy
*
* @return possible object is {@link String }
*/
@Attribute
- @Pattern(regexp = "(before-content|after-content)")
- public String getAuthRecipient();
+ @Pattern(regexp = AUTH_RECIPIENT_TIMINGS, message = "Valid values: " + AUTH_RECIPIENT_TIMINGS)
+ String getAuthRecipient();
/**
* Sets the value of the authRecipient property.
*
* @param value allowed object is {@link String }
*/
- public void setAuthRecipient(String value) throws PropertyVetoException;
+ void setAuthRecipient(String value) throws PropertyVetoException;
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java
index e71f755..683e899 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Resource.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,14 +17,15 @@
package com.sun.enterprise.config.serverbeans;
+import jakarta.validation.constraints.Pattern;
+
+import java.beans.PropertyVetoException;
+
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.Configured;
import org.jvnet.hk2.config.DuckTyped;
-import jakarta.validation.constraints.Pattern;
-import java.beans.PropertyVetoException;
-
/**
* Tag interface for all types of resource.
*
@@ -32,6 +34,8 @@
@Configured
public interface Resource extends ConfigBeanProxy {
+ String OBJECT_TYPES = "(system-all|system-all-req|system-admin|system-instance|user)";
+
/**
* Gets the value of the objectType property. where object-type defines the type of the resource. It can be: system-all
* - These are system resources for all instances and DAS system-all-req - These are system-all resources that are
@@ -42,7 +46,7 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "user")
- @Pattern(regexp = "(system-all|system-all-req|system-admin|system-instance|user)")
+ @Pattern(regexp = OBJECT_TYPES, message = "Valid values: " + OBJECT_TYPES)
String getObjectType();
/**
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java
index c333b8c..b21745b 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResourceRef.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,21 +17,16 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import org.jvnet.hk2.config.Configured;
-
-import java.beans.PropertyVetoException;
-
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
-import org.glassfish.api.admin.RestRedirects;
-import org.glassfish.api.admin.RestRedirect;
+import java.beans.PropertyVetoException;
-/**
- *
- */
+import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
/* @XmlType(name = "") */
@@ -39,6 +35,8 @@
@RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-resource-ref") })
public interface ResourceRef extends ConfigBeanProxy {
+ String PATTERN_REF = "[^':,][^':,]*";
+
/**
* Determines whether the resource is active or ignored.
*
@@ -55,14 +53,15 @@
void setEnabled(String value) throws PropertyVetoException;
/**
- * References the name attribute of a resources, such as an {@link org.glassfish.connectors.config.JdbcResource} or
+ * References the name attribute of a resources, such as an
+ * {@link org.glassfish.connectors.config.JdbcResource} or
* {@link org.glassfish.connectors.config.JdbcConnectionPool}.
*
* @return possible object is {@link String }
*/
@Attribute(key = true)
@NotNull
- @Pattern(regexp = "[^':,][^':,]*")
+ @Pattern(regexp = PATTERN_REF, message = "Pattern: " + PATTERN_REF)
String getRef();
/**
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java
index f28877c..7b5a216 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ResponsePolicy.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,14 +17,13 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
+import jakarta.validation.constraints.Pattern;
import java.beans.PropertyVetoException;
-import java.io.Serializable;
-import jakarta.validation.constraints.Pattern;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
/**
* Used to define the authentication policy requirements associated with the response processing performed by an
@@ -36,25 +36,27 @@
@Configured
public interface ResponsePolicy extends ConfigBeanProxy {
+ String AUTH_RECIPIENT_TIMINGS = "(before-content|after-content)";
+ String AUTH_SOURCES = "(sender|content|username-password)";
+
/**
- * Specifies the type of required authentication, either "sender" (user name and password) or "content" (digital
- * signature).
- *
- * Defines a requirement for message layer sender authentication (e.g. username password) or content authentication
- * (e.g. digital signature)
+ * Specifies the type of required authentication, either "sender" (user name and password) or
+ * "content" (digital signature).
+ * Defines a requirement for message layer sender authentication (e.g. username password) or
+ * content authentication (e.g. digital signature)
*
* @return possible object is {@link String }
*/
@Attribute
- @Pattern(regexp = "(sender|content|username-password)")
- public String getAuthSource();
+ @Pattern(regexp = AUTH_SOURCES, message = "Valid values: " + AUTH_SOURCES)
+ String getAuthSource();
/**
* Sets the value of the authSource property.
*
* @param value allowed object is {@link String }
*/
- public void setAuthSource(String value) throws PropertyVetoException;
+ void setAuthSource(String value) throws PropertyVetoException;
/**
* Specifies whether recipient authentication occurs before or after content authentication. Allowed values are
@@ -70,14 +72,14 @@
* @return possible object is {@link String }
*/
@Attribute
- @Pattern(regexp = "(before-content|after-content)")
- public String getAuthRecipient();
+ @Pattern(regexp = AUTH_RECIPIENT_TIMINGS, message = "Valid values: " + AUTH_RECIPIENT_TIMINGS)
+ String getAuthRecipient();
/**
* Sets the value of the authRecipient property.
*
* @param value allowed object is {@link String }
*/
- public void setAuthRecipient(String value) throws PropertyVetoException;
+ void setAuthRecipient(String value) throws PropertyVetoException;
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java
index da76d3c..dc1385a 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/Server.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,60 +17,74 @@
package com.sun.enterprise.config.serverbeans;
-import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
-import com.sun.enterprise.config.util.InstanceRegisterInstanceCommandParameters;
-import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.*;
import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefConstraint;
import com.sun.enterprise.config.serverbeans.customvalidators.ConfigRefValidator;
-import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
import com.sun.enterprise.config.serverbeans.customvalidators.NotDuplicateTargetName;
-import com.sun.enterprise.config.util.ServerHelper;
+import com.sun.enterprise.config.serverbeans.customvalidators.NotTargetKeyword;
+import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
+import com.sun.enterprise.config.util.ConfigApiLoggerInfo;
+import com.sun.enterprise.config.util.InstanceRegisterInstanceCommandParameters;
import com.sun.enterprise.config.util.PortBaseHelper;
import com.sun.enterprise.config.util.PortManager;
+import com.sun.enterprise.config.util.ServerHelper;
import com.sun.enterprise.util.LocalStringManagerImpl;
import com.sun.enterprise.util.io.FileUtils;
import com.sun.enterprise.util.net.NetUtils;
-import java.io.*;
-import org.glassfish.api.Param;
-import org.glassfish.api.admin.AdminCommandContext;
-import org.glassfish.config.support.*;
-import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
-import org.jvnet.hk2.annotations.Service;
-import org.glassfish.hk2.api.PerLookup;
-import org.jvnet.hk2.config.*;
-import org.jvnet.hk2.config.types.Property;
-import org.jvnet.hk2.config.types.PropertyBag;
-import org.glassfish.api.ActionReport;
-import org.glassfish.api.admin.config.Named;
-import org.glassfish.api.admin.config.PropertiesDesc;
-import org.glassfish.api.admin.config.ReferenceContainer;
-import org.glassfish.quality.ToDo;
-import static org.glassfish.config.support.Constants.*;
-
-import java.beans.PropertyVetoException;
-import java.util.List;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import jakarta.inject.Inject;
import jakarta.validation.Payload;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
-import org.glassfish.api.admin.ServerEnvironment;
+import java.beans.PropertyVetoException;
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.glassfish.api.ActionReport;
+import org.glassfish.api.Param;
+import org.glassfish.api.admin.AdminCommandContext;
import org.glassfish.api.admin.CommandRunner;
+import org.glassfish.api.admin.ServerEnvironment;
+import org.glassfish.api.admin.config.Named;
+import org.glassfish.api.admin.config.PropertiesDesc;
+import org.glassfish.api.admin.config.ReferenceContainer;
import org.glassfish.api.logging.LogHelper;
+import org.glassfish.config.support.CreationDecorator;
+import org.glassfish.config.support.DeletionDecorator;
+import org.glassfish.hk2.api.PerLookup;
+import org.glassfish.quality.ToDo;
+import org.jvnet.hk2.annotations.Service;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.ConfigSupport;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Dom;
+import org.jvnet.hk2.config.DuckTyped;
+import org.jvnet.hk2.config.Element;
+import org.jvnet.hk2.config.SingleConfigCode;
+import org.jvnet.hk2.config.Transaction;
+import org.jvnet.hk2.config.TransactionFailure;
+import org.jvnet.hk2.config.types.Property;
+import org.jvnet.hk2.config.types.PropertyBag;
+
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.OPERAND_NAME;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_CHECKPORTS;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_CLUSTER;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_CONFIG;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_LBENABLED;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_NODE;
+import static com.sun.enterprise.config.util.RegisterInstanceCommandParameters.ParameterNames.PARAM_PORTBASE;
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
/**
- *
- * Java EE Application Server Configuration
- *
- * Each Application Server instance is a Java EE compliant container. One server instance is specially designated as the
- * Administration Server in SE/EE
- *
+ * Jakarta EE Application Server Configuration
+ * Each Application Server instance is a Jakarta EE compliant container.
+ * One server instance is specially designated as the Administration Server in SE/EE
* User applications cannot be deployed to an Administration Server instance
*/
@Configured
@@ -77,31 +92,31 @@
@SuppressWarnings("unused")
@NotDuplicateTargetName(message = "{server.duplicate.name}", payload = Server.class)
@ReferenceConstraint(skipDuringCreation = true, payload = Server.class)
-public interface Server extends ConfigBeanProxy, PropertyBag, Named, SystemPropertyBag, ReferenceContainer, RefContainer, Payload {
+public interface Server
+ extends ConfigBeanProxy, PropertyBag, Named, SystemPropertyBag, ReferenceContainer, RefContainer, Payload {
String lbEnabledSystemProperty = "org.glassfish.lb-enabled-default";
@Param(name = OPERAND_NAME, primary = true)
@Override
- public void setName(String value) throws PropertyVetoException;
+ void setName(String value) throws PropertyVetoException;
@NotTargetKeyword(message = "{server.reserved.name}", payload = Server.class)
@Pattern(regexp = NAME_SERVER_REGEX, message = "{server.invalid.name}", payload = Server.class)
@Override
- public String getName();
+ String getName();
/**
* Gets the value of the configRef property.
- *
- * Points to a named config. Needed for stand-alone servers. If server instance is part of a cluster, then it points to
- * the cluster config
+ * Points to a named config. Needed for stand-alone servers.
+ * If server instance is part of a cluster, then it points to the cluster config
*
* @return possible object is {@link String }
*/
@Attribute
@NotNull
@NotTargetKeyword(message = "{server.reserved.name}", payload = Server.class)
- @Pattern(regexp = NAME_SERVER_REGEX)
+ @Pattern(regexp = NAME_SERVER_REGEX, message = "Pattern: " + NAME_SERVER_REGEX)
@ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.configref}", type = Config.class)
String getConfigRef();
@@ -359,8 +374,9 @@
public static Config getConfig(Server server) {
try {
- if (server == null)
+ if (server == null) {
return null;
+ }
Dom serverDom = Dom.unwrap(server);
Configs configs = serverDom.getHabitat().getService(Configs.class);
@@ -763,8 +779,9 @@
// bnevins September 30, 2010
// don't delete the config if it wasn't auto-generated.
final String autoGeneratedName = child.getName() + "-config";
- if (!autoGeneratedName.equals(instanceConfig))
+ if (!autoGeneratedName.equals(instanceConfig)) {
return;
+ }
try {
if (config != null) {
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java
index cd0b236..52cf090 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/ServerRef.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -17,32 +18,35 @@
package com.sun.enterprise.config.serverbeans;
import com.sun.enterprise.config.serverbeans.customvalidators.ReferenceConstraint;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.Element;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
-import java.beans.PropertyVetoException;
import jakarta.validation.Payload;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
-/**
- *
- */
+import java.beans.PropertyVetoException;
-/* @XmlType(name = "", propOrder = {
- "healthChecker"
-}) */
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+import org.jvnet.hk2.config.Element;
+
+import static org.glassfish.config.support.Constants.NAME_SERVER_REGEX;
+
+/*
+ * @XmlType(name = "", propOrder = {
+ * "healthChecker"
+ * })
+ */
@Configured
@ReferenceConstraint(skipDuringCreation = true, payload = ServerRef.class)
public interface ServerRef extends ConfigBeanProxy, Ref, Payload {
+ // defines the default value for lb-enabled attribute
+ String LBENABLED_DEFAULT_VALUE = "true";
+
/**
* Gets the value of the ref property.
- *
* A reference to the name of a server defined elsewhere
*
* @return possible object is {@link String }
@@ -52,7 +56,7 @@
@NotNull
@Pattern(regexp = NAME_SERVER_REGEX, message = "{server.invalid.name}", payload = ServerRef.class)
@ReferenceConstraint.RemoteKey(message = "{resourceref.invalid.server-ref}", type = Server.class)
- public String getRef();
+ String getRef();
/**
* Sets the value of the ref property.
@@ -60,59 +64,58 @@
* @param value allowed object is {@link String }
*/
@Override
- public void setRef(String value) throws PropertyVetoException;
+ void setRef(String value) throws PropertyVetoException;
/**
* Gets the value of the disableTimeoutInMinutes property.
- *
- * The time, in minutes, that it takes this server to reach a quiescent state after having been disabled
+ * The time, in minutes, that it takes this server to reach a quiescent state after having been
+ * disabled
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "30")
- public String getDisableTimeoutInMinutes();
+ String getDisableTimeoutInMinutes();
/**
* Sets the value of the disableTimeoutInMinutes property.
*
* @param value allowed object is {@link String }
*/
- public void setDisableTimeoutInMinutes(String value) throws PropertyVetoException;
+ void setDisableTimeoutInMinutes(String value) throws PropertyVetoException;
/**
* Gets the value of the lbEnabled property.
- *
- * Causes any and all load-balancers using this server to consider this server available to them. Defaults to
- * available(true)
+ * Causes any and all load-balancers using this server to consider this server available to
+ * them. Defaults to available(true)
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = LBENABLED_DEFAULT_VALUE, dataType = Boolean.class)
- public String getLbEnabled();
+ String getLbEnabled();
/**
* Sets the value of the lbEnabled property.
*
* @param value allowed object is {@link String }
*/
- public void setLbEnabled(String value) throws PropertyVetoException;
+ void setLbEnabled(String value) throws PropertyVetoException;
/**
* Gets the value of the enabled property.
- *
- * A boolean flag that causes the server to be enabled to serve end-users, or not. Default is to be enabled (true)
+ * A boolean flag that causes the server to be enabled to serve end-users, or not.
+ * Default is to be enabled (true)
*
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "true", dataType = Boolean.class)
- public String getEnabled();
+ String getEnabled();
/**
* Sets the value of the enabled property.
*
* @param value allowed object is {@link String }
*/
- public void setEnabled(String value) throws PropertyVetoException;
+ void setEnabled(String value) throws PropertyVetoException;
/**
* Gets the value of the healthChecker property.
@@ -120,16 +123,12 @@
* @return possible object is {@link HealthChecker }
*/
@Element("health-checker")
- public HealthChecker getHealthChecker();
+ HealthChecker getHealthChecker();
/**
* Sets the value of the healthChecker property.
*
* @param value allowed object is {@link HealthChecker }
*/
- public void setHealthChecker(HealthChecker value) throws PropertyVetoException;
-
- //defines the default value for lb-enabled attribute
- public String LBENABLED_DEFAULT_VALUE = "true";
-
+ void setHealthChecker(HealthChecker value) throws PropertyVetoException;
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java
index 226ae49..651954b 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/SystemProperty.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,17 +17,17 @@
package com.sun.enterprise.config.serverbeans;
-import org.jvnet.hk2.config.Attribute;
-import org.jvnet.hk2.config.Configured;
-import org.jvnet.hk2.config.ConfigBeanProxy;
-
-import java.beans.PropertyVetoException;
-
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
-import org.glassfish.api.admin.RestRedirects;
+import java.beans.PropertyVetoException;
+
import org.glassfish.api.admin.RestRedirect;
+import org.glassfish.api.admin.RestRedirects;
+import org.jvnet.hk2.config.Attribute;
+import org.jvnet.hk2.config.ConfigBeanProxy;
+import org.jvnet.hk2.config.Configured;
+
import static org.glassfish.config.support.Constants.NAME_REGEX;
/**
@@ -38,8 +39,10 @@
}) */
@Configured
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-system-properties"),
- @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-system-property") })
+@RestRedirects({
+ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-system-properties"),
+ @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-system-property")
+})
public interface SystemProperty extends ConfigBeanProxy {
/**
@@ -49,15 +52,15 @@
*/
@Attribute(key = true)
@NotNull
- @Pattern(regexp = NAME_REGEX)
- public String getName();
+ @Pattern(regexp = NAME_REGEX, message = "Pattern: " + NAME_REGEX)
+ String getName();
/**
* Sets the value of the name property.
*
* @param value allowed object is {@link String }
*/
- public void setName(String value) throws PropertyVetoException;
+ void setName(String value) throws PropertyVetoException;
/**
* Gets the value of the value property.
@@ -66,14 +69,14 @@
*/
@Attribute
@NotNull
- public String getValue();
+ String getValue();
/**
* Sets the value of the value property.
*
* @param value allowed object is {@link String }
*/
- public void setValue(String value) throws PropertyVetoException;
+ void setValue(String value) throws PropertyVetoException;
/**
* Gets the value of the description property.
@@ -81,13 +84,13 @@
* @return possible object is {@link String }
*/
@Attribute
- public String getDescription();
+ String getDescription();
/**
* Sets the value of the description property.
*
* @param value allowed object is {@link String }
*/
- public void setDescription(String value) throws PropertyVetoException;
+ void setDescription(String value) throws PropertyVetoException;
}
diff --git a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java
index 52356ba..2fd876d 100644
--- a/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java
+++ b/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/serverbeans/VirtualServer.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,21 +17,22 @@
package com.sun.enterprise.config.serverbeans;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+
import java.beans.PropertyVetoException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
-import org.glassfish.grizzly.config.dom.NetworkConfig;
-import org.glassfish.grizzly.config.dom.NetworkListener;
import org.glassfish.api.admin.RestRedirect;
import org.glassfish.api.admin.RestRedirects;
import org.glassfish.api.admin.config.PropertiesDesc;
import org.glassfish.api.admin.config.PropertyDesc;
import org.glassfish.config.support.datatypes.PositiveInteger;
+import org.glassfish.grizzly.config.dom.NetworkConfig;
+import org.glassfish.grizzly.config.dom.NetworkListener;
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.Configured;
@@ -44,15 +46,23 @@
*
* Virtualization in Application Server allows multiple URL domains to be served by the same HTTP server process, which
* is listening on multiple host addresses If an application is available at two virtual servers, they still share same
- * physical resource pools, such as JDBC connection pools. Sun ONE Application Server allows a list of virtual servers,
- * to be specified along with web-module and j2ee-application elements. This establishes an association between URL
+ * physical resource pools, such as JDBC connection pools. GlassFish allows a list of virtual servers,
+ * to be specified along with web-module and Jakarta EE application elements. This establishes an association between URL
* domains, represented by the virtual server and the web modules (standalone web modules or web modules inside the ear
* file)
*/
@Configured
-@RestRedirects({ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-virtual-server"),
- @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-virtual-server") })
+@RestRedirects({
+ @RestRedirect(opType = RestRedirect.OpType.POST, commandName = "create-virtual-server"),
+ @RestRedirect(opType = RestRedirect.OpType.DELETE, commandName = "delete-virtual-server"
+)})
public interface VirtualServer extends ConfigBeanProxy, PropertyBag {
+
+ String VALUES_ACCESS_LOG_ENABLED = "(true|on|false|off|inherit)";
+ String VALUES_SSO_ENABLED = "(true|on|false|off|inherit)";
+ String VALUES_SSO_COOKIE_ENABLED = "(true|false|dynamic)";
+ String VALUES_STATE = "(on|off|disabled)";
+
/**
* Gets the value of the id property.
*
@@ -154,7 +164,7 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "on")
- @Pattern(regexp = "(on|off|disabled)")
+ @Pattern(regexp = VALUES_STATE, message = "Valid values: " + VALUES_STATE)
String getState();
/**
@@ -202,7 +212,7 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "inherit")
- @Pattern(regexp = "(true|on|false|off|inherit)")
+ @Pattern(regexp = VALUES_SSO_ENABLED, message = "Valid values: " + VALUES_SSO_ENABLED)
String getSsoEnabled();
/**
@@ -218,7 +228,7 @@
* @return possible object is {@link String }
*/
@Attribute(defaultValue = "inherit")
- @Pattern(regexp = "(true|on|false|off|inherit)")
+ @Pattern(regexp = VALUES_ACCESS_LOG_ENABLED, message = "Valid values: " + VALUES_ACCESS_LOG_ENABLED)
String getAccessLoggingEnabled();
/**
@@ -268,7 +278,7 @@
* "dynamic"
*/
@Attribute(defaultValue = "dynamic")
- @Pattern(regexp = "(true|false|dynamic)")
+ @Pattern(regexp = VALUES_SSO_COOKIE_ENABLED, message = "Valid values: " + VALUES_SSO_COOKIE_ENABLED)
String getSsoCookieSecure();
void setSsoCookieSecure(String value);
@@ -294,7 +304,7 @@
public static void addNetworkListener(VirtualServer server, String name) throws PropertyVetoException {
final String listeners = server.getNetworkListeners();
final String[] strings = listeners == null ? new String[0] : listeners.split(",");
- final Set<String> set = new TreeSet<String>();
+ final Set<String> set = new TreeSet<>();
for (String string : strings) {
set.add(string.trim());
}
@@ -305,7 +315,7 @@
public static void removeNetworkListener(VirtualServer server, String name) throws PropertyVetoException {
final String listeners = server.getNetworkListeners();
final String[] strings = listeners == null ? new String[0] : listeners.split(",");
- final Set<String> set = new TreeSet<String>();
+ final Set<String> set = new TreeSet<>();
for (String string : strings) {
set.add(string.trim());
}
@@ -327,7 +337,7 @@
final String listeners = server.getNetworkListeners();
final String[] strings = listeners == null ? new String[0] : listeners.split(",");
final NetworkConfig config = server.getParent().getParent(Config.class).getNetworkConfig();
- List<NetworkListener> list = new ArrayList<NetworkListener>();
+ List<NetworkListener> list = new ArrayList<>();
for (String s : strings) {
final String name = s.trim();
final NetworkListener networkListener = config.getNetworkListener(name);
@@ -342,46 +352,90 @@
/**
* Properties.
*/
- @PropertiesDesc(props = {
- @PropertyDesc(name = "sso-max-inactive-seconds", defaultValue = "300", dataType = PositiveInteger.class, description = "The time after which a user's single sign-on record becomes eligible for purging if "
- + "no client activity is received. Since single sign-on applies across several applications on the same virtual server, "
- + "access to any of the applications keeps the single sign-on record active. Higher values provide longer "
- + "single sign-on persistence for the users at the expense of more memory use on the server"),
- @PropertyDesc(name = "sso-reap-interval-seconds", defaultValue = "60", dataType = PositiveInteger.class, description = "Interval between purges of expired single sign-on records"),
- @PropertyDesc(name = "setCacheControl", description = "Comma-separated list of Cache-Control response directives. For a list of valid directives, "
+ @Override
+ @PropertiesDesc(
+ props = {@PropertyDesc(
+ name = "sso-max-inactive-seconds",
+ defaultValue = "300",
+ dataType = PositiveInteger.class,
+ description = "The time after which a user's single sign-on record becomes eligible for purging if "
+ + "no client activity is received. Since single sign-on applies across several applications on the same virtual server, "
+ + "access to any of the applications keeps the single sign-on record active. Higher values provide longer "
+ + "single sign-on persistence for the users at the expense of more memory use on the server"),
+ @PropertyDesc(
+ name = "sso-reap-interval-seconds",
+ defaultValue = "60",
+ dataType = PositiveInteger.class,
+ description = "Interval between purges of expired single sign-on records"),
+ @PropertyDesc(
+ name = "setCacheControl",
+ description = "Comma-separated list of Cache-Control response directives. For a list of valid directives, "
+ "see section 14.9 of the document at http://www.ietf.org/rfc/rfc2616.txt"),
- @PropertyDesc(name = "accessLoggingEnabled", defaultValue = "false", dataType = Boolean.class, description = "Enables access logging for this virtual server only"),
- @PropertyDesc(name = "accessLogBufferSize", defaultValue = "32768", dataType = PositiveInteger.class, description = "Size in bytes of the buffer where access log calls are stored. If the value is "
+ @PropertyDesc(
+ name = "accessLoggingEnabled",
+ defaultValue = "false",
+ dataType = Boolean.class,
+ description = "Enables access logging for this virtual server only"),
+ @PropertyDesc(
+ name = "accessLogBufferSize",
+ defaultValue = "32768",
+ dataType = PositiveInteger.class,
+ description = "Size in bytes of the buffer where access log calls are stored. If the value is "
+ "less than 5120, a warning message is issued, and the value is set to 5120. To set this "
+ "property for all virtual servers, set it as a property of the parent http-service"),
- @PropertyDesc(name = "accessLogWriteInterval", defaultValue = "300", dataType = PositiveInteger.class, description = "Number of seconds before the log is written to the disk. The access log is written when "
+ @PropertyDesc(
+ name = "accessLogWriteInterval",
+ defaultValue = "300",
+ dataType = PositiveInteger.class,
+ description = "Number of seconds before the log is written to the disk. The access log is written when "
+ "the buffer is full or when the interval expires. If the value is 0, the buffer is always written even if "
+ "it is not full. This means that each time the server is accessed, the log message is stored directly to the file. "
+ "To set this property for all virtual servers, set it as a property of the parent http-service"),
- @PropertyDesc(name = "allowRemoteAddress", description = "Comma-separated list of regular expression patterns that the remote client's IP address is "
+ @PropertyDesc(
+ name = "allowRemoteAddress",
+ description = "Comma-separated list of regular expression patterns that the remote client's IP address is "
+ "compared to. If this property is specified, the remote address must match for this request to be accepted. "
+ "If this property is not specified, all requests are accepted unless the remote address matches a 'denyRemoteAddress' pattern"),
- @PropertyDesc(name = "denyRemoteAddress", description = "Comma-separated list of regular expression patterns that the remote client's "
+ @PropertyDesc(
+ name = "denyRemoteAddress",
+ description = "Comma-separated list of regular expression patterns that the remote client's "
+ "IP address is compared to. If this property is specified, the remote address must not "
+ "match for this request to be accepted. If this property is not specified, request "
+ "acceptance is governed solely by the 'allowRemoteAddress' property"),
- @PropertyDesc(name = "allowRemoteHost", description = "Comma-separated list of regular expression patterns that the remote client's "
+ @PropertyDesc(
+ name = "allowRemoteHost",
+ description = "Comma-separated list of regular expression patterns that the remote client's "
+ "hostname (as returned by java.net.Socket.getInetAddress().getHostName()) is compared to. "
+ "If this property is specified, the remote hostname must match for the request to be accepted. "
+ "If this property is not specified, all requests are accepted unless the remote hostname matches a 'denyRemoteHost' pattern"),
- @PropertyDesc(name = "denyRemoteHost", description = "Specifies a comma-separated list of regular expression patterns that the remote client's "
+ @PropertyDesc(
+ name = "denyRemoteHost",
+ description = "Specifies a comma-separated list of regular expression patterns that the remote client's "
+ "hostname (as returned by java.net.Socket.getInetAddress().getHostName()) is compared to. "
+ "If this property is specified, the remote hostname must not match for this request to be accepted. "
+ "If this property is not specified, request acceptance is governed solely by the 'allowRemoteHost' property"),
- @PropertyDesc(name = "authRealm", description = "Specifies the name attribute of an “auth-realm�? on page 23 element, which overrides "
+ @PropertyDesc(
+ name = "authRealm",
+ description = "Specifies the name attribute of an “auth-realm“ on page 23 element, which overrides "
+ "the server instance's default realm for stand-alone web applications deployed to this virtual server. "
+ "A realm defined in a stand-alone web application's web.xml file overrides the virtual server's realm"),
- @PropertyDesc(name = "securePagesWithPragma", defaultValue = "true", dataType = Boolean.class, description = "Set this property to false to ensure that for all web applications on this virtual server "
+ @PropertyDesc(
+ name = "securePagesWithPragma",
+ defaultValue = "true",
+ dataType = Boolean.class,
+ description = "Set this property to false to ensure that for all web applications on this virtual server "
+ "file downloads using SSL work properly in Internet Explorer. You can set this property for a specific web application."),
- @PropertyDesc(name = "contextXmlDefault", description = "The location, relative to domain-dir, of the context.xml file for this virtual server, if one is used"),
- @PropertyDesc(name = "allowLinking", defaultValue = "false", dataType = Boolean.class, description = "If true, resources that are symbolic links in web applications on this virtual server are served. "
+ @PropertyDesc(
+ name = "contextXmlDefault",
+ description = "The location, relative to domain-dir, of the context.xml file for this virtual server, if one is used"),
+ @PropertyDesc(
+ name = "allowLinking",
+ defaultValue = "false",
+ dataType = Boolean.class,
+ description = "If true, resources that are symbolic links in web applications on this virtual server are served. "
+ "The value of this property in the sun-web.xml file takes precedence if defined. "
+ "Caution: setting this property to true on Windows systems exposes JSP source code."),
+
/**
* Specifies an alternate document root (docroot), where n is a positive integer that allows specification of more than
* one. Alternate docroots allow web applications to serve requests for certain resources from outside their own
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java
index 6278b83..6b68d3f 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Http.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -113,7 +114,7 @@
void setCompressableMimeType(String type);
@Attribute(defaultValue = COMPRESSION, dataType = String.class)
- @Pattern(regexp = COMPRESSION_PATTERN)
+ @Pattern(regexp = COMPRESSION_PATTERN, message = "Pattern: " + COMPRESSION_PATTERN)
String getCompression();
void setCompression(String compression);
@@ -470,6 +471,7 @@
void setHttp2Enabled(boolean http2Enabled);
+ @Override
@DuckTyped
Protocol getParent();
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java
index 5847047..c661fd1 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/NetworkListener.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,13 +17,13 @@
package org.glassfish.grizzly.config.dom;
+import jakarta.validation.constraints.Pattern;
+
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import jakarta.validation.constraints.Pattern;
-
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.ConfigBeanProxy;
import org.jvnet.hk2.config.Configured;
@@ -39,7 +40,7 @@
boolean JK_ENABLED = false;
String DEFAULT_ADDRESS = "0.0.0.0";
String DEFAULT_CONFIGURATION_FILE = "${com.sun.aas.instanceRoot}/config/glassfish-jk.properties";
- String TYPE_PATTERN = "(standard|proxy)";
+ String LISTENER_TYPES = "(standard|proxy)";
String DEFAULT_TYPE = "standard";
@@ -85,7 +86,7 @@
* Network-listener name, which could be used as reference
*/
@Attribute(required = true, dataType = String.class, defaultValue = DEFAULT_TYPE)
- @Pattern(regexp = TYPE_PATTERN)
+ @Pattern(regexp = LISTENER_TYPES, message = "Valid values: " + LISTENER_TYPES)
String getType();
void setType(String type);
@@ -138,6 +139,7 @@
@DuckTyped
Transport findTransport();
+ @Override
@DuckTyped
NetworkListeners getParent();
@@ -204,7 +206,7 @@
final ConfigBeanProxy parent = listener.getParent().getParent().getParent();
final Dom proxy = Dom.unwrap(parent).element("thread-pools");
final List<Dom> domList = proxy.nodeElements("thread-pool");
- list = new ArrayList<ThreadPool>(domList.size());
+ list = new ArrayList<>(domList.size());
for (Dom dom : domList) {
list.add(dom.<ThreadPool>createProxy());
}
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java
index 1672f06..9f4c8cd 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/ProtocolChain.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -46,7 +47,7 @@
* Protocol chain type. Could be STATEFUL or STATELESS
*/
@Attribute(defaultValue = TYPE)
- @Pattern(regexp = TYPE_PATTERN)
+ @Pattern(regexp = TYPE_PATTERN, message = "Valid values: " + TYPE_PATTERN)
String getType();
void setType(String value);
@@ -59,6 +60,7 @@
void setProtocolFilter(List<ProtocolFilter> list);
+ @Override
@DuckTyped
Protocol getParent();
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java
index e74b3f6..a1054cc 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Ssl.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -57,8 +58,8 @@
void setCertNickname(String value);
/**
- * Determines whether SSL3 client authentication is performed on every request, independent of ACL-based access
- * control.
+ * Determines whether SSL3 client authentication is performed on every request,
+ * independent of ACL-based access control.
*/
@Attribute(defaultValue = "" + CLIENT_AUTH_ENABLED, dataType = Boolean.class)
String getClientAuthEnabled();
@@ -66,11 +67,11 @@
void setClientAuthEnabled(String value);
/**
- * Determines if if the engine will request (want) or require (need) client authentication. Valid values: want,
- * need, or left blank
+ * Determines if if the engine will request (want) or require (need) client authentication.
+ * Valid values: want, need, or left blank
*/
@Attribute(dataType = String.class, defaultValue = "")
- @Pattern(regexp = CLIENT_AUTH_PATTERN)
+ @Pattern(regexp = CLIENT_AUTH_PATTERN, message = "Valid values: " + CLIENT_AUTH_PATTERN)
String getClientAuth();
void setClientAuth(String value);
@@ -89,7 +90,7 @@
* type of the keystore file
*/
@Attribute(dataType = String.class)
- @Pattern(regexp = STORE_TYPE_PATTERN)
+ @Pattern(regexp = STORE_TYPE_PATTERN, message = "Valid values: " + STORE_TYPE_PATTERN)
String getKeyStoreType();
void setKeyStoreType(String type);
@@ -126,7 +127,7 @@
* ciphers are assumed to be enabled. NOT Used in PE
*/
@Attribute
- @Pattern(regexp = SSL2_CIPHERS_PATTERN)
+ @Pattern(regexp = SSL2_CIPHERS_PATTERN, message = "Valid values: " + SSL2_CIPHERS_PATTERN)
String getSsl2Ciphers();
void setSsl2Ciphers(String value);
@@ -221,7 +222,7 @@
* type of the truststore file
*/
@Attribute(dataType = String.class)
- @Pattern(regexp = STORE_TYPE_PATTERN)
+ @Pattern(regexp = STORE_TYPE_PATTERN, message = "Valid values: " + STORE_TYPE_PATTERN)
String getTrustStoreType();
void setTrustStoreType(String type);
diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
index a13648b..4df3edd 100644
--- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
+++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/dom/Transport.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2009, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -33,6 +34,7 @@
@Configured
public interface Transport extends ConfigBeanProxy, PropertyBag {
+ String BYTE_BUFFER_TYPES = "heap|direct";
boolean DISPLAY_CONFIGURATION = false;
boolean ENABLE_SNOOP = false;
boolean TCP_NO_DELAY = true;
@@ -89,7 +91,11 @@
* Type of ByteBuffer, which will be used with transport. Possible values are: HEAP and DIRECT
*/
@Attribute(defaultValue = BYTE_BUFFER_TYPE, dataType = String.class)
- @Pattern(regexp = "heap|direct", flags = Pattern.Flag.CASE_INSENSITIVE)
+ @Pattern(
+ regexp = BYTE_BUFFER_TYPES,
+ message = "Valid values: " + BYTE_BUFFER_TYPES,
+ flags = Pattern.Flag.CASE_INSENSITIVE
+ )
String getByteBufferType();
void setByteBufferType(String value);
@@ -208,6 +214,7 @@
@DuckTyped
List<NetworkListener> findNetworkListeners();
+ @Override
@DuckTyped
Transports getParent();
@@ -215,7 +222,7 @@
static public List<NetworkListener> findNetworkListeners(Transport transport) {
NetworkListeners networkListeners =
transport.getParent().getParent().getNetworkListeners();
- List<NetworkListener> refs = new ArrayList<NetworkListener>();
+ List<NetworkListener> refs = new ArrayList<>();
for (NetworkListener listener : networkListeners.getNetworkListener()) {
if (listener.getTransport().equals(transport.getName())) {
refs.add(listener);