Package uk.num.numlib.internal.ctx
Class NumAPIContextBase
- java.lang.Object
-
- uk.num.numlib.internal.ctx.NumAPIContextBase
-
- All Implemented Interfaces:
NumAPIContext
public class NumAPIContextBase extends java.lang.Object implements NumAPIContext
A base class implementation of NumAPIContext.
-
-
Constructor Summary
Constructors Constructor Description NumAPIContextBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetRecordLocation()Get the query location based on the current location that is being tried.UserVariable[]getRequiredUserVariables()Modules can have required user variables that must be supplied before the NUM record csn be retrieved.voidhandleQueryRedirect(AppContext appContext, NonBlankString redirect, NumAPIContextBase context)Update the relevant query for the supplied redirectvoidsetRequiredUserVariables(UserVariable[] userVariables)Update the required user variables with values obtained from the client.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.num.numlib.api.NumAPIContext
setLocation
-
-
-
-
Method Detail
-
getRequiredUserVariables
public UserVariable[] getRequiredUserVariables()
Modules can have required user variables that must be supplied before the NUM record csn be retrieved.- Specified by:
getRequiredUserVariablesin interfaceNumAPIContext- Returns:
- An array of objects.
-
setRequiredUserVariables
public void setRequiredUserVariables(UserVariable[] userVariables) throws NumUserVariablesException
Update the required user variables with values obtained from the client.- Specified by:
setRequiredUserVariablesin interfaceNumAPIContext- Parameters:
userVariables- The RequiredUserVariable array with the value fields populated.- Throws:
NumUserVariablesException- on error
-
getRecordLocation
public java.lang.String getRecordLocation()
Get the query location based on the current location that is being tried.- Returns:
- a DNS query string for the current location.
-
handleQueryRedirect
public void handleQueryRedirect(AppContext appContext, NonBlankString redirect, NumAPIContextBase context) throws NumBadURLException, NumInvalidRedirectException, NumInvalidParameterException, NumMaximumRedirectsExceededException
Update the relevant query for the supplied redirect- Parameters:
appContext- the AppContextredirect- the supplied redirectcontext- the NumAPIContextBase- Throws:
NumBadURLException- on errorNumInvalidRedirectException- on errorNumInvalidParameterException- on errorNumMaximumRedirectsExceededException- on Error
-
-