Package org.forgerock.opendj.setup.model
Class Profile.HostPortParameter
- java.lang.Object
-
- org.forgerock.opendj.setup.model.Profile.Parameter<Profile.HostPortParameter,CharSequence>
-
- org.forgerock.opendj.setup.model.Profile.HostPortParameter
-
- Enclosing class:
- Profile
public final class Profile.HostPortParameter extends Profile.Parameter<Profile.HostPortParameter,CharSequence>
Represents a parameter whose value is a remote server host and port.Note: Usage of
CharSequenceinstead of string is a hack to avoid the following compilation error: Methods defaultValue(T) from Profile.Parameter and defaultValue(String) from Parameter are inherited with the same signature.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P,E extends Exception>
Raccept(Profile.ParameterVisitor<R,P,E> visitor, P p)Applies aProfile.ParameterVisitorto thisProfile.Parameter.LocalizableMessagegetHostPromptMsg()Returns the user message used for prompting user for the remote server hostname.LocalizableMessagegetPortPromptMsg()Returns the user message used for prompting user for the remote server port.Profile.HostPortParameterhostPrompt(String... hostPromptMsg)Sets the message used for prompting user for the remote server host in interactive mode.CharSequenceparseStringValue(String strValue)Parses provided string value into this parameter type and returns the typed value.Profile.HostPortParameterportPrompt(String... portPromptMsg)Sets the prompt message used for prompting user for the remote server port in interactive mode.-
Methods inherited from class org.forgerock.opendj.setup.model.Profile.Parameter
advanced, defaultValue, defaultValue, defaultValueCanBeDerivedAtSetup, defaultValueFromSetupTool, description, descriptionIfNoValueSet, equals, expressionAllowed, getAddAnotherValueMsg, getDefaultValue, getDescriptionIfNoValueSetMsg, getDescriptionMsg, getHelpMsg, getOptionalPromptMsg, getPromptForValueMsg, getSyntax, getSyntaxWithoutExpression, getValue, getValueOrExpression, getVariableName, hashCode, help, isAdvanced, isMultivalued, isOptional, multivalued, multivalued, optional, optional, prompt, property, toString
-
-
-
-
Method Detail
-
hostPrompt
public Profile.HostPortParameter hostPrompt(String... hostPromptMsg)
Sets the message used for prompting user for the remote server host in interactive mode.If this method is not called before parameter resolution, a generic message will be used.
- Parameters:
hostPromptMsg- Strings representing the paragraphs of the message to ask the user for the remote server host- Returns:
- This
remote server profile parameter
-
portPrompt
public Profile.HostPortParameter portPrompt(String... portPromptMsg)
Sets the prompt message used for prompting user for the remote server port in interactive mode.If this method is not called before parameter resolution, a generic message will be used.
- Parameters:
portPromptMsg- Strings representing the paragraphs of the message to ask the user for the remote server port- Returns:
- This
remote server profile parameter
-
parseStringValue
public CharSequence parseStringValue(String strValue) throws com.forgerock.opendj.cli.ArgumentException
Description copied from class:Profile.ParameterParses provided string value into this parameter type and returns the typed value.- Specified by:
parseStringValuein classProfile.Parameter<Profile.HostPortParameter,CharSequence>- Parameters:
strValue- A string representing the parameter value to be parsed- Returns:
- The typed value associated to provided string
- Throws:
com.forgerock.opendj.cli.ArgumentException- If an error occurred while parsing provided string value
-
getHostPromptMsg
public LocalizableMessage getHostPromptMsg()
Returns the user message used for prompting user for the remote server hostname.- Returns:
- The message used for prompting the user for the remote server hostname
-
getPortPromptMsg
public LocalizableMessage getPortPromptMsg()
Returns the user message used for prompting user for the remote server port.- Returns:
- The message used for prompting the user for the remote server port
-
accept
public <R,P,E extends Exception> R accept(Profile.ParameterVisitor<R,P,E> visitor, P p) throws E extends Exception
Description copied from class:Profile.ParameterApplies aProfile.ParameterVisitorto thisProfile.Parameter.- Specified by:
acceptin classProfile.Parameter<Profile.HostPortParameter,CharSequence>- Type Parameters:
R- The return type of the visitor's methodsP- The type of the additional parameter to this visitor's methods. UseVoidfor visitors that do not need an additional parameterE- The type of the exception thrown by the visitor method if it fails, orNeverThrowsExceptionif the visitor cannot fail- Parameters:
visitor- The parameter visitorp- Optional additional visitor parameter- Returns:
- A result as specified by the visitor
- Throws:
E- If the visitor failedE extends Exception
-
-