@Beta public static class Application.Builder extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Application.Builder.Container |
Modifier and Type | Field and Description |
---|---|
private Map<String,Application.Builder.Container> |
containers |
private static String |
DEFAULT_CHAIN |
private Networking |
networking |
private Path |
path |
private static ThreadLocal<Random> |
random |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
private Application |
build() |
Application.Builder |
container(String id,
Application.Builder.Container container) |
private void |
createFile(Path path,
String content) |
Application.Builder |
documentType(String name,
String searchDefinition) |
Application.Builder |
expressionInclude(String name,
String searchDefinition) |
private void |
generateXml() |
private static int |
getRandomPort() |
private static String |
getResourceFile(String resource)
Get the file name (path) of a resource or fail if it can not be found
|
private static File |
getTempDir()
Get the temporary directory
|
private static File |
makeTempDir(String prefix,
String suffix)
Create a temporary directory using @{link File.createTempFile()}, but creating
a directory instead of a file.
|
private Path |
nestedResource(com.yahoo.path.Path nestedPath,
String name,
String fileType) |
Application.Builder |
networking(Networking networking) |
Application.Builder |
queryProfile(String name,
String queryProfile) |
Application.Builder |
queryProfileType(String name,
String queryProfileType) |
Application.Builder |
rankExpression(String name,
String rankExpressionContent) |
private static final ThreadLocal<Random> random
private static final String DEFAULT_CHAIN
private final Map<String,Application.Builder.Container> containers
private final Path path
private Networking networking
public Builder() throws IOException
IOException
public Application.Builder container(String id, Application.Builder.Container container)
private static File makeTempDir(String prefix, String suffix) throws IOException
prefix
- directory prefixsuffix
- directory suffixIOException
- if the temporary directory could not be createdprivate static File getTempDir()
private static String getResourceFile(String resource)
resource
- Name of desired resourceprivate void createFile(Path path, String content) throws IOException
IOException
private static int getRandomPort()
public Application.Builder documentType(String name, String searchDefinition) throws IOException
name
- name of document type (search definition)searchDefinition
- add this search definition to the applicationIOException
- e.g.if file not foundpublic Application.Builder expressionInclude(String name, String searchDefinition) throws IOException
IOException
public Application.Builder rankExpression(String name, String rankExpressionContent) throws IOException
name
- name of rank expressionrankExpressionContent
- add this rank expression to the applicationIOException
- e.g.if file not foundpublic Application.Builder queryProfile(String name, String queryProfile) throws IOException
name
- name of query profilequeryProfile
- add this queyr profile to the applicationIOException
- e.g.if file not foundpublic Application.Builder queryProfileType(String name, String queryProfileType) throws IOException
name
- name of query profile typequeryProfileType
- add this query profile type to the applicationIOException
- e.g.if file not foundprivate Path nestedResource(com.yahoo.path.Path nestedPath, String name, String fileType)
public Application.Builder networking(Networking networking)
networking
- enable or disable networking (disabled by default)private Application build() throws Exception
Exception
Copyright © 2017. All rights reserved.