Class PortEarlyPropertyChecker
- java.lang.Object
-
- org.alfresco.repo.management.subsystems.PortEarlyPropertyChecker
-
- All Implemented Interfaces:
SubsystemEarlyPropertyChecker
public class PortEarlyPropertyChecker extends Object implements SubsystemEarlyPropertyChecker
"Early" checker for Port property value (checks for "null/empty", "out-of-bounds", "unable-to-parse", "already-in-use" problems). Also see the implemented interfaceSubsystemEarlyPropertyChecker- Author:
- abalmus
-
-
Constructor Summary
Constructors Constructor Description PortEarlyPropertyChecker(String subsystemName, boolean hasMultiplePorts, boolean shouldCheckForBlockedPort)Create a newPortEarlyPropertyCheckerw/o a paired property name.PortEarlyPropertyChecker(String subsystemName, String requiredPairedPropertyName, boolean hasMultiplePorts, boolean shouldCheckForBlockedPort)Create a newPortEarlyPropertyChecker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckPort(int portNumber, String host)voidcheckPropertyValue(String propertyName, String propertyValue, String pairedPropertyValue)Implementation of checkPropertyValue() method for port checking.StringgetPairedPropertyName()Get the (optional) paired property name (e.g., if we want to check a port number we might want to do that together with a specific local address).
-
-
-
Constructor Detail
-
PortEarlyPropertyChecker
public PortEarlyPropertyChecker(String subsystemName, boolean hasMultiplePorts, boolean shouldCheckForBlockedPort)
Create a newPortEarlyPropertyCheckerw/o a paired property name.- Parameters:
subsystemName- Name of the subsystem; used for custom error messages.hasMultiplePorts- Specify if the property value that will be checked is a list of ports (they must be separated by ",").shouldCheckForBlockedPort- Enable/disable checking for port-already-in-use (i.e.: disable this for remote ports).
-
PortEarlyPropertyChecker
public PortEarlyPropertyChecker(String subsystemName, String requiredPairedPropertyName, boolean hasMultiplePorts, boolean shouldCheckForBlockedPort)
Create a newPortEarlyPropertyChecker.- Parameters:
subsystemName- Name of the subsystem; used for custom error messages.requiredPairedPropertyName- Name of the required paired property (seeSubsystemEarlyPropertyChecker.getPairedPropertyName()).hasMultiplePorts- Specify if the property value that will be checked is a list of ports (they must be separated by ",").shouldCheckForBlockedPort- Enable/disable checking for port-already-in-use (i.e.: disable this for remote ports).
-
-
Method Detail
-
checkPropertyValue
public void checkPropertyValue(String propertyName, String propertyValue, String pairedPropertyValue) throws InvalidPropertyValueException
Implementation of checkPropertyValue() method for port checking.- Specified by:
checkPropertyValuein interfaceSubsystemEarlyPropertyChecker- Parameters:
propertyName- Name of the property.propertyValue- Port value; if this contains multiple ports they must be separated by ",".pairedPropertyValue- - Value of the paired property- Throws:
InvalidPropertyValueException- Raised if any of the checks fail.
-
checkPort
protected void checkPort(int portNumber, String host) throws IOException- Throws:
IOException
-
getPairedPropertyName
public String getPairedPropertyName()
Description copied from interface:SubsystemEarlyPropertyCheckerGet the (optional) paired property name (e.g., if we want to check a port number we might want to do that together with a specific local address).- Specified by:
getPairedPropertyNamein interfaceSubsystemEarlyPropertyChecker- Returns:
- The paired property name.
-
-