Class PortEarlyPropertyChecker
- java.lang.Object
-
- org.alfresco.repo.management.subsystems.PortEarlyPropertyChecker
-
- All Implemented Interfaces:
SubsystemEarlyPropertyChecker
public class PortEarlyPropertyChecker extends java.lang.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(java.lang.String subsystemName, boolean hasMultiplePorts, boolean shouldCheckForBlockedPort)Create a newPortEarlyPropertyCheckerw/o a paired property name.PortEarlyPropertyChecker(java.lang.String subsystemName, java.lang.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, java.lang.String host)voidcheckPropertyValue(java.lang.String propertyName, java.lang.String propertyValue, java.lang.String pairedPropertyValue)Implementation of checkPropertyValue() method for port checking.java.lang.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(java.lang.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(java.lang.String subsystemName, java.lang.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(java.lang.String propertyName, java.lang.String propertyValue, java.lang.String pairedPropertyValue) throws InvalidPropertyValueExceptionImplementation 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, java.lang.String host) throws java.io.IOException- Throws:
java.io.IOException
-
getPairedPropertyName
public java.lang.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.
-
-