Class ConfigServiceForTests
java.lang.Object
org.epics.archiverappliance.config.DefaultConfigService
org.epics.archiverappliance.config.ConfigServiceForTests
- All Implemented Interfaces:
ConfigService
-
Nested Class Summary
Nested classes/interfaces inherited from class org.epics.archiverappliance.config.DefaultConfigService
DefaultConfigService.Tuple<T>Nested classes/interfaces inherited from interface org.epics.archiverappliance.config.ConfigService
ConfigService.EAABulkOperation<T>, ConfigService.STARTUP_SEQUENCE, ConfigService.WAR_FILE -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAll unit test PV names are expected to begin with this.static final Stringstatic final intprotected static final Stringprotected static final StringA folder which is used to store the data for the unit tests...static final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intTomcat is launched listening to this port when running the unit testsstatic final Stringstatic final StringFields inherited from class org.epics.archiverappliance.config.DefaultConfigService
aliasNamesToRealNames, applianceAggregateInfo, appliances, appliancesConfigLoaded, appliancesInCluster, ARCHAPPL_NAME, archapplproperties, archivePVRequests, channelArchiverDataServers, CLUSTER_INET_2_APPLIANCE_IDENTITY, clusterInet2ApplianceIdentity, engineContext, etlPVLookup, eventBus, failoverPVs, LOCAL_HOST_ADDRESS, LOGGING_TYPE, mgmtRuntime, myApplianceInfo, myIdentity, namedFlags, parts2PVNamesForThisAppliance, persistanceLayer, processMetrics, pubSub, pv2appliancemapping, pv2ChannelArchiverDataServer, pvName2KeyConverter, retrievalState, shutdownHooks, SITE_FOR_UNIT_TESTS_NAME, SITE_FOR_UNIT_TESTS_VALUE, startupExecutor, startupState, TYPEINFO, typeInfos, warFileFields inherited from interface org.epics.archiverappliance.config.ConfigService
ARCHAPPL_APPLIANCES, ARCHAPPL_CONFIGSERVICE_IMPL, ARCHAPPL_MYIDENTITY, ARCHAPPL_NAMEDFLAGS_PROPERTIES_FILE_PROPERTY, ARCHAPPL_PERSISTENCE_LAYER, ARCHAPPL_POLICIES, ARCHAPPL_PROPERTIES_FILENAME, ARCHAPPL_SITEID, CONFIG_SERVICE_NAME, DEFAULT_ARCHAPPL_PROPERTIES_FILENAME -
Constructor Summary
ConstructorsConstructorDescriptionSpecial Constructor for Integration tests Do not use in unit tests.ConfigServiceForTests(int jcaCommandThreadCount) ConfigServiceForTests(File WebInfClassesFolder, int jcaCommandThreadCount) -
Method Summary
Modifier and TypeMethodDescriptiongetApplianceForPV(String pvName) Given a PV, get us the appliance that is responsible for archiving it.static Stringstatic StringintIn clustered environments, to give capacity planning a chance to work correctly, we want to kick off the archive PV workflow only after all the machines have started.Get the root folder for the PB storage pluginReturn the text of the policy for this installation.getTypeInfoForPV(String pvName) Gets information about a PV's type, i.e its DBR type, graphic limits etc.We expect to live within a servlet container.voidinitialize(javax.servlet.ServletContext sce) If you have a null constructor and need a ServletContext, implement this method.voidregisterPVToAppliance(String pvName, ApplianceInfo applianceInfo, PVRegistrationType registrationType) Register the pv to the appliance Note this restarts any ETL JOBs in unit tests, so you'll need to call manualControlForUnitTests(); again if they should be stopped.voidsetPBRootFolder(String rootFolder) This should only be called in the unit tests....Methods inherited from class org.epics.archiverappliance.config.DefaultConfigService
addAlias, addExternalArchiverDataServer, addShutdownHook, addToArchiveRequests, archiveRequestWorkflowCompleted, breakDownPVsByAppliance, computePolicyForPV, doesPVHaveArchiveRequestInWorkflow, executeClusterWide, executeOnAppliance, getAggregatedApplianceInfo, getAliasesForRealName, getAllAliases, getAllExpandedNames, getAllPVs, getAppliance, getAppliancesInCluster, getArchiveRequestsCurrentlyInWorkflow, getArchiverTypeSystem, getChannelArchiverDataServers, getEngineContext, getETLLookup, getEventBus, getExternalArchiverDataServers, getExtraFields, getFailoverApplianceURL, getFailoverServerURLs, getFieldsArchivedAsPartOfStream, getInstallationProperties, getMgmtRuntimeState, getMyApplianceInfo, getNamedFlag, getNamedFlagNames, getPausedPVsInThisAppliance, getPoliciesInInstallation, getProcessMetrics, getPVNameToKeyConverter, getPVsForAppliance, getPVsForApplianceMatchingRegex, getPVsForThisAppliance, getRealNameForAlias, getRetrievalRuntimeState, getRuntimeFields, getStartupState, getTimeOfAppserverStartup, getUserSpecifiedSamplingParams, getWarFile, hasClusterFinishedInitialization, isShuttingDown, isStartupComplete, postStartup, publishEventIntoCluster, queryPVTypeInfos, refreshPVDataFromChannelArchiverDataServers, removeAlias, removeExternalArchiverDataServer, removePVFromCluster, resetFailoverCaches, setNamedFlag, shutdownNow, updateArchiveRequest, updatePVSForThisAppliance, updateTypeInfoForPVMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.epics.archiverappliance.config.ConfigService
registerPVToAppliance
-
Field Details
-
TESTAPPLIANCE0
- See Also:
-
DEFAULT_MGMT_PORT
public static final int DEFAULT_MGMT_PORT- See Also:
-
RETRIEVAL_TEST_PORT
public static final int RETRIEVAL_TEST_PORTTomcat is launched listening to this port when running the unit tests- See Also:
-
ARCH_UNIT_TEST_PVNAME_PREFIX
All unit test PV names are expected to begin with this. This name is supposed to be something that we will not encounter in the field.- See Also:
-
HTTP_LOCALHOST
- See Also:
-
DATA_RETRIEVAL_URL
- See Also:
-
MGMT_BPL
- See Also:
-
MGMT_URL
- See Also:
-
MGMT_UI_URL
- See Also:
-
MGMT_INDEX_URL
- See Also:
-
ENGINE_BPL
- See Also:
-
ENGINE_URL
- See Also:
-
RETRIEVAL_BPL
- See Also:
-
RETRIEVAL_URL
- See Also:
-
RETRIEVAL_DATA
- See Also:
-
RAW_RETRIEVAL_URL
- See Also:
-
GETDATAATTIME_DATA
- See Also:
-
GETDATAATTIME_URL
- See Also:
-
ETL_BPL
- See Also:
-
ETL_URL
- See Also:
-
DEFAULT_PB_SHORT_TERM_TEST_DATA_FOLDER
-
DEFAULT_PB_TEST_DATA_FOLDER
A folder which is used to store the data for the unit tests... -
defaultSecondsDisconnect
public static final int defaultSecondsDisconnect- See Also:
-
defaultMinutesDisconnect
public static final int defaultMinutesDisconnect- See Also:
-
-
Constructor Details
-
ConfigServiceForTests
Special Constructor for Integration tests Do not use in unit tests.- Throws:
ConfigException
-
ConfigServiceForTests
- Throws:
ConfigException
-
ConfigServiceForTests
public ConfigServiceForTests(File WebInfClassesFolder, int jcaCommandThreadCount) throws ConfigException - Throws:
ConfigException
-
-
Method Details
-
getDefaultPBTestFolder
-
getDefaultShortTermFolder
-
initialize
Description copied from interface:ConfigServiceIf you have a null constructor and need a ServletContext, implement this method.- Specified by:
initializein interfaceConfigService- Overrides:
initializein classDefaultConfigService- Parameters:
sce- ServletContext- Throws:
ConfigException-
-
getApplianceForPV
Description copied from interface:ConfigServiceGiven a PV, get us the appliance that is responsible for archiving it. Note that this may be null as the assignment of PV's to appliances can take some time.- Specified by:
getApplianceForPVin interfaceConfigService- Overrides:
getApplianceForPVin classDefaultConfigService- Parameters:
pvName- The name of PV.- Returns:
- ApplianceInfo
-
registerPVToAppliance
public void registerPVToAppliance(String pvName, ApplianceInfo applianceInfo, PVRegistrationType registrationType) throws AlreadyRegisteredException Register the pv to the appliance Note this restarts any ETL JOBs in unit tests, so you'll need to call manualControlForUnitTests(); again if they should be stopped.- Specified by:
registerPVToAppliancein interfaceConfigService- Overrides:
registerPVToAppliancein classDefaultConfigService- Parameters:
pvName- The name of PV.applianceInfo- ApplianceInforegistrationType- If reassigning; then an AlreadyRegisteredException is not raised- Throws:
AlreadyRegisteredException- pv already registered.
-
getPolicyText
Description copied from interface:ConfigServiceReturn the text of the policy for this installation. Gets you an InputStream; remember to close it.- Specified by:
getPolicyTextin interfaceConfigService- Overrides:
getPolicyTextin classDefaultConfigService- Returns:
- InputStream
- Throws:
IOException-
-
getTypeInfoForPV
Description copied from interface:ConfigServiceGets information about a PV's type, i.e its DBR type, graphic limits etc. This information is assumed to be somewhat static and is expected to come from a cache if possible as it is used in data retrieval.- Specified by:
getTypeInfoForPVin interfaceConfigService- Overrides:
getTypeInfoForPVin classDefaultConfigService- Parameters:
pvName- The name of PV.- Returns:
- PVTypeInfo
-
getPBRootFolder
Get the root folder for the PB storage plugin- Returns:
-
setPBRootFolder
This should only be called in the unit tests....- Parameters:
rootFolder-
-
getWebInfFolder
Description copied from interface:ConfigServiceWe expect to live within a servlet container. This call returns the full path to the WEB-INF folder of the webapp as it is deployed in the container. Is typically a call to theservletContext.getRealPath("WEB-INF/")- Specified by:
getWebInfFolderin interfaceConfigService- Overrides:
getWebInfFolderin classDefaultConfigService- Returns:
- String WebInfFolder
-
getInitialDelayBeforeStartingArchiveRequestWorkflow
public int getInitialDelayBeforeStartingArchiveRequestWorkflow()Description copied from interface:ConfigServiceIn clustered environments, to give capacity planning a chance to work correctly, we want to kick off the archive PV workflow only after all the machines have started. This is an approximation for that metric; though not a very satisfactory approximation. TODO -- Think thru implications of making the appliances.xml strict...- Specified by:
getInitialDelayBeforeStartingArchiveRequestWorkflowin interfaceConfigService- Overrides:
getInitialDelayBeforeStartingArchiveRequestWorkflowin classDefaultConfigService- Returns:
- - Initial delay in seconds.
-