
public interface HttpScope
Different scopes may be available to share Objects e.g. Application, Session, Connection.
| Modifier and Type | Method and Description |
|---|---|
default boolean |
changeID()
Change the ID of this scope.
|
default boolean |
create()
Create this scope.
|
default boolean |
exists()
Tests whether this scope exists.
|
default Object |
getAttachment(String key)
Get the attachment previously associated with the key specified on this scope.
|
default <T> T |
getAttachment(String key,
Class<T> type)
Get the attachment previously associated with the key specified on this scope and cast it to the type specified.
|
default String |
getID()
Get the ID of this scope or (@code null} if IDs are not supported for this scope or the scope doesn't currently exist.
|
default InputStream |
getResource(String path)
Get the resource associated with the path specified.
|
default boolean |
invalidate()
Invalidate this scope.
|
default void |
registerForNotification(Consumer<HttpScopeNotification> notificationConsumer)
Register a notification consumer to receive notifications from this scope.
|
default void |
setAttachment(String key,
Object value)
Set the named attribute on this scope, setting to
null will clear any value previously set for this key. |
default boolean |
supportsAttachments()
Tests whether this scope support attachments.
|
default boolean |
supportsChangeID()
Is changing the ID of the scope supported?
|
default boolean |
supportsInvalidation()
Is invalidation supported for this scope?
|
default boolean |
supportsNotifications()
Tests whether this scope support registration to receive notifications.
|
default boolean |
supportsResources()
Tests whether this scope support access to scope specific resources.
|
default String getID()
default boolean exists()
true if this scope exists. Otherwise, falsedefault boolean create()
true if the scope was created. Otherwise, false indicating that this scope was already created or that creation is not support.default boolean supportsAttachments()
true if this scope supports attachments, false otherwisedefault void setAttachment(String key, Object value)
null will clear any value previously set for this key.key - the key to use to store the attachment.value - the value to store with the key or null to clear any previously stored attachment.UnsupportedOperationException - if attachments are not supported.default Object getAttachment(String key)
key - the key used to store the attachment on this scope.null if no association exists.UnsupportedOperationException - if attachments are not supported.default <T> T getAttachment(String key, Class<T> type)
null.key - the key used to store the attachment on this scope.type - the desired type of the attachment.null if no association exists or if it could not be converted to
the requested type.UnsupportedOperationException - if attachments are not supported.default boolean supportsInvalidation()
true if this scope supports invalidation, false otherwise.default boolean invalidate()
true if invalidation was successful, false otherwise.default boolean supportsChangeID()
true if this scope supports changing the ID, false otherwise.default boolean changeID()
true if the change was successful, false otherwise.default boolean supportsResources()
true if this scope supports access to scope specific resources, false otherwise.default InputStream getResource(String path)
path - the path to the resource.InputStream of the resource or null if resources is not supported or the specified resource is not found.default boolean supportsNotifications()
true if this scope supports registration for notifications, false otherwise.default void registerForNotification(Consumer<HttpScopeNotification> notificationConsumer)
notificationConsumer - the consumer to receive notifications from this scope.Copyright © 2020 JBoss by Red Hat. All rights reserved.