Package org.opendaylight.aaa.web
Class WebContext.Builder
java.lang.Object
org.opendaylight.aaa.web.WebContext.Builder
- Enclosing interface:
- WebContext
Builds instances of type
WebContext. Initialize attributes and then invoke the
build() method to create an immutable instance.
WebContext.Builder is not thread-safe and generally should not be stored in a field or
collection, but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescription@NonNull WebContext.BuilderaddFilter(FilterDetails filter) Adds one element tofilterslist.@NonNull WebContext.BuilderaddListener(javax.servlet.ServletContextListener listener) Adds one element tolistenerslist.@NonNull WebContext.BuilderaddResource(ResourceDetails resource) Adds one element toresourceslist.@NonNull WebContext.BuilderaddServlet(ServletDetails servlet) Adds one element toservletslist.@NonNull WebContextbuild()Builds a newWebContext.@NonNull WebContext.BuildercontextPath(String contextPath) Initializes the value for thecontextPathattribute.@NonNull WebContext.BuilderInitializes the value for thenameattribute.@NonNull WebContext.BuilderputContextParam(String key, String value) Put one entry to thecontextParamsmap.supportsSessions(boolean supportsSessions) Initializes the value for thesupportsSessionsattribute.
-
Method Details
-
name
Initializes the value for thenameattribute.- Parameters:
name- A descriptive name- Returns:
thisbuilder for use in a chained invocation- Throws:
IllegalArgumentException- ifcontextPathdoes not meet specification criteriaNullPointerException- if {code contextPath} isnull
-
contextPath
Initializes the value for thecontextPathattribute. As per Servlet specification.- Parameters:
contextPath- The value for contextPath- Returns:
thisbuilder for use in a chained invocation- Throws:
IllegalArgumentException- ifcontextPathdoes not meet specification criteriaNullPointerException- if {code contextPath} isnull
-
addServlet
Adds one element toservletslist.- Parameters:
servlet- A servlets element- Returns:
thisbuilder for use in a chained invocation- Throws:
NullPointerException- if {code servlet} isnull
-
addFilter
Adds one element tofilterslist.- Parameters:
filter- A filters element- Returns:
thisbuilder for use in a chained invocation- Throws:
NullPointerException- if {code filter} isnull
-
addListener
Adds one element tolistenerslist.- Parameters:
listener- A listeners element- Returns:
thisbuilder for use in a chained invocation- Throws:
NullPointerException- if {code listener} isnull
-
addResource
Adds one element toresourceslist.- Parameters:
resource- A resources element- Returns:
thisbuilder for use in a chained invocation- Throws:
NullPointerException- if {code resource} isnull
-
putContextParam
Put one entry to thecontextParamsmap.- Parameters:
key- The key in the contextParams mapvalue- The associated value in the contextParams map- Returns:
thisbuilder for use in a chained invocation- Throws:
NullPointerException- if any argument isnull
-
supportsSessions
Initializes the value for thesupportsSessionsattribute.If not set, this attribute will have a default value of
true.- Parameters:
supportsSessions- The value for supportsSessions- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newWebContext.- Returns:
- An immutable instance of WebContext
- Throws:
IllegalStateException- if any required attributes are missing
-