Class ContainerConfiguration
- java.lang.Object
-
- org.gcube.smartgears.configuration.container.ContainerConfiguration
-
public class ContainerConfiguration extends Object
The configuration of the container.- Author:
- Fabio Simeoni, Luca Frosini (ISTI - CNR)
-
-
Constructor Summary
Constructors Constructor Description ContainerConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>allowedContexts()voidallowedContexts(Set<String> allowedContexts)ApplicationConfigurationapp(String context)Returns the configuration of an application with a given context path.ContainerConfigurationapp(ApplicationConfiguration app)Adds the configuration of an application to this configuration.List<ApplicationConfiguration>apps()Returns the application configurations included in this configuration.StringauthenticationEnpoint()ContainerConfigurationauthenticationEnpoint(String endpoint)booleanauthorizeChildrenContext()ContainerConfigurationauthorizeChildrenContext(boolean authorizeChildrenContext)booleanequals(Object obj)inthashCode()Stringhostname()Returns the host name of the container.ContainerConfigurationhostname(String name)Sets the host name of the container.Stringinfrastructure()Returns the infrastructure in which the container is running.ContainerConfigurationinfrastructure(String infrastructure)Sets the infrastructure in which the container is running.Modemode()Returns the management mode for the container.ContainerConfigurationmode(Mode mode)Sets the management mode for the container.Persistencepersistence()Returns the persistence manager of the container.ContainerConfigurationpersistence(Persistence manager)Sets the persistence manager of the container.intport()Returns the port at which the container is listening for requests.ContainerConfigurationport(int port)Sets the port at which the container is listening for requests.Map<String,String>properties()Returns the configuration properties of the container.ContainerConfigurationproperty(String name, String value)Adds a configuration property to the container.Stringprotocol()Returns the port at which the container is listening for requests.ContainerConfigurationprotocol(String protocol)longpublicationFrequency()Returns the publication frequency for the container's profile.ContainerConfigurationpublicationFrequency(long frequency)Sets the publication frequency for the container's profile.Sitesite()Returns the geographical site of the container.ContainerConfigurationsite(Site site)Sets the geographical site of the container.List<String>startTokens()Returns the VOs in which the container initially operates.ContainerConfigurationstartTokens(List<String> tokens)Sets the VOs in which the container initially operates.StringtoString()voidvalidate()Validates this configuration
-
-
-
Method Detail
-
mode
public Mode mode()
Returns the management mode for the container.- Returns:
- the management mode
-
mode
public ContainerConfiguration mode(Mode mode)
Sets the management mode for the container.- Parameters:
mode- the management mode- Returns:
- this configuration
-
apps
public List<ApplicationConfiguration> apps()
Returns the application configurations included in this configuration.- Returns:
- the application configurations
-
app
public ApplicationConfiguration app(String context)
Returns the configuration of an application with a given context path.- Parameters:
context- the context path- Returns:
- the application configuration
-
app
public ContainerConfiguration app(ApplicationConfiguration app)
Adds the configuration of an application to this configuration.- Parameters:
app- the application configuration- Returns:
- this configuration
-
site
public Site site()
Returns the geographical site of the container.- Returns:
- the site
-
site
public ContainerConfiguration site(Site site)
Sets the geographical site of the container.- Parameters:
site- the site- Returns:
- this configuration
-
infrastructure
public String infrastructure()
Returns the infrastructure in which the container is running.- Returns:
- the infrastructure
-
infrastructure
public ContainerConfiguration infrastructure(String infrastructure)
Sets the infrastructure in which the container is running.- Parameters:
infrastructure- the infrastructure- Returns:
- this configuration
-
hostname
public String hostname()
Returns the host name of the container.- Returns:
- the host name;
-
hostname
public ContainerConfiguration hostname(String name)
Sets the host name of the container.- Parameters:
name- the host name- Returns:
- this configuration
-
port
public int port()
Returns the port at which the container is listening for requests.- Returns:
- the port
-
protocol
public String protocol()
Returns the port at which the container is listening for requests.- Returns:
- the port
-
authenticationEnpoint
public String authenticationEnpoint()
-
authenticationEnpoint
public ContainerConfiguration authenticationEnpoint(String endpoint)
-
port
public ContainerConfiguration port(int port)
Sets the port at which the container is listening for requests.- Parameters:
port- the port- Returns:
- this configuration
-
protocol
public ContainerConfiguration protocol(String protocol)
-
authorizeChildrenContext
public boolean authorizeChildrenContext()
-
authorizeChildrenContext
public ContainerConfiguration authorizeChildrenContext(boolean authorizeChildrenContext)
-
startTokens
public List<String> startTokens()
Returns the VOs in which the container initially operates.- Returns:
- the VOs
-
startTokens
public ContainerConfiguration startTokens(List<String> tokens)
Sets the VOs in which the container initially operates.- Parameters:
vos- the VOs- Returns:
- this configuration
-
persistence
public Persistence persistence()
Returns the persistence manager of the container.- Returns:
- the manager
-
persistence
public ContainerConfiguration persistence(Persistence manager)
Sets the persistence manager of the container.- Parameters:
manager- the manager- Returns:
- this configuration
-
properties
public Map<String,String> properties()
Returns the configuration properties of the container.- Returns:
- the properties
-
property
public ContainerConfiguration property(String name, String value)
Adds a configuration property to the container.- Parameters:
the- name of the propertythe- value of the property- Returns:
- this configuration
-
publicationFrequency
public long publicationFrequency()
Returns the publication frequency for the container's profile.- Returns:
- the frquency;
-
publicationFrequency
public ContainerConfiguration publicationFrequency(long frequency)
Sets the publication frequency for the container's profile.- Parameters:
frequency- the frequency- Returns:
- this configuration
-
validate
public void validate()
Validates this configuration- Throws:
IllegalStateException- if the configuration is invalid
-
-