Class FilesApplicationPackage
java.lang.Object
com.yahoo.config.model.application.AbstractApplicationPackage
com.yahoo.config.model.application.provider.FilesApplicationPackage
- All Implemented Interfaces:
com.yahoo.config.application.api.ApplicationPackage
Application package derived from local files, i.e. during deploy.
Construct using
fromFile(java.io.File) or
fromFileWithDeployData(java.io.File, DeployData).- Author:
- Vegard Havdal
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder forFilesApplicationPackage.static classRepresents a component in the application package. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the subdirectory (below the original application package root) where a preprocessed version of this application package is stored.Fields inherited from interface com.yahoo.config.application.api.ApplicationPackage
COMPONENT_DIR, CONFIG_DEFINITIONS_DIR, CONSTANTS_DIR, DEPLOYMENT_FILE, DOCPROCCHAINS_DIR, EXT_DIR, HOSTS, MODELS_DIR, MODELS_GENERATED_DIR, MODELS_GENERATED_REPLICATED_DIR, PAGE_TEMPLATES_DIR, PROCESSORCHAINS_DIR, QUERY_PROFILE_TYPES_DIR, QUERY_PROFILES_DIR, RANKEXPRESSION_NAME_SUFFIX, RANKPROFILE_NAME_SUFFIX, ROUTINGTABLES_DIR, RULES_DIR, RULES_NAME_SUFFIX, SCHEMAS_DIR, SD_NAME_SUFFIX, SEARCH_DEFINITIONS_DIR, SEARCHCHAINS_DIR, SECURITY_DIR, SERVICES, VALIDATION_OVERRIDES -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic FilesApplicationPackageCreates from a directory with source files includedstatic FilesApplicationPackageReturns an application package object based on the given application dirstatic FilesApplicationPackagefromFileWithDeployData(File appDir, DeployData deployData) Creates package from a local directory, typically deploy appstatic FilesApplicationPackagefromFileWithDeployData(File appDir, DeployData deployData, boolean includeSourceFiles) Creates package from a local directory, typically deploy appMap<com.yahoo.vespa.config.ConfigDefinitionKey,com.yahoo.config.application.api.UnparsedConfigDefinition> com.yahoo.config.provision.ApplicationIdReturns a list of all components in this package.getComponents(File appDir) List<com.yahoo.config.application.api.ComponentInfo>getComponentsInfo(com.yahoo.component.Version vespaVersion) com.yahoo.config.application.api.DeploymentSpeccom.yahoo.config.application.api.ApplicationFilegetFile(com.yahoo.path.Path path) getFileReference(com.yahoo.path.Path pathRelativeToAppDir) List<com.yahoo.io.reader.NamedReader>getHosts()com.yahoo.config.application.api.ApplicationMetaDatagetRankingExpression(String name) Reads a ranking expression from file to a string and returns it.Collection<com.yahoo.io.reader.NamedReader>com.yahoo.config.application.api.ApplicationPackagepreprocess(com.yahoo.config.provision.Zone zone, com.yahoo.config.application.api.DeployLogger logger) voidvoidvalidateIncludeDir(String dirName) voidvoidvalidateXMLFor(Optional<com.yahoo.component.Version> vespaVersion) voidMethods inherited from class com.yahoo.config.model.application.AbstractApplicationPackage
legacyOverrides, validSchemaFilenameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.yahoo.config.application.api.ApplicationPackage
getAllocatedHosts, getClientSecurityFile, getFileRegistries, getFiles, getMajorVersion, getPageTemplateFiles, getQueryProfileFiles, getQueryProfileTypeFiles, parseDeploymentSpec
-
Field Details
-
preprocessed
The name of the subdirectory (below the original application package root) where a preprocessed version of this application package is stored. As it happens, the config model is first created with an application package in this subdirectory, and later backed by an application package which is not in this subdirectory. To enable model code to correct for this, this constant must be publicly known. All of this stuff is Very Unfortunate and should be fixed. -Jon- See Also:
-
-
Method Details
-
fromFile
Creates from a directory with source files included -
fromFile
Returns an application package object based on the given application dir- Parameters:
appDir- application package directoryincludeSourceFiles- read files from source directories /src/main and src/test in addition to the application package location. This is useful during development to be able to run tests without a complete build first.- Returns:
- an Application package instance
-
fromFileWithDeployData
Creates package from a local directory, typically deploy app -
fromFileWithDeployData
public static FilesApplicationPackage fromFileWithDeployData(File appDir, DeployData deployData, boolean includeSourceFiles) Creates package from a local directory, typically deploy app -
getApplicationId
public com.yahoo.config.provision.ApplicationId getApplicationId() -
getFiles
-
getFile
public com.yahoo.config.application.api.ApplicationFile getFile(com.yahoo.path.Path path) -
getMetaData
public com.yahoo.config.application.api.ApplicationMetaData getMetaData() -
getHosts
-
getHostSource
-
getServicesSource
-
getDeployment
-
getValidationOverrides
-
getUserIncludeDirs
-
addUserIncludeDirs
public void addUserIncludeDirs() -
validateIncludeDir
-
getSchemas
-
getAllExistingConfigDefs
public Map<com.yahoo.vespa.config.ConfigDefinitionKey,com.yahoo.config.application.api.UnparsedConfigDefinition> getAllExistingConfigDefs() -
getServices
-
getSearchDefinitionFiles
-
getComponents
-
getComponentsInfo
public List<com.yahoo.config.application.api.ComponentInfo> getComponentsInfo(com.yahoo.component.Version vespaVersion) -
getComponents
Returns a list of all components in this package.- Returns:
- A list of components.
-
getAppDir
- Throws:
IOException
-
getRankingExpression
Reads a ranking expression from file to a string and returns it.- Parameters:
name- the name of the file to return, relative to the search definition directory in the application package- Returns:
- the content of a ranking expression file
- Throws:
IllegalArgumentException- if the file was not found or could not be read
-
getFileReference
-
validateXML
- Throws:
IOException
-
validateXMLFor
- Throws:
IOException
-
writeMetaData
public void writeMetaData() -
getDeploymentSpec
public com.yahoo.config.application.api.DeploymentSpec getDeploymentSpec() -
preprocess
public com.yahoo.config.application.api.ApplicationPackage preprocess(com.yahoo.config.provision.Zone zone, com.yahoo.config.application.api.DeployLogger logger) throws IOException - Throws:
IOException
-
validateFileExtensions
public void validateFileExtensions()
-