public class SecurityFilter extends Object implements ISpaceFilter
Constructor and Description |
---|
SecurityFilter() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this filter, enabling the developer to clean open resources.
|
List<RoleDetails> |
getCustomRoleAuthority() |
List<UserDetails> |
getCustomUserAuthority() |
void |
init(IJSpace space,
String filterId,
String url,
int priority)
Initializes this filter.
|
void |
process(SpaceContext context,
ISpaceFilterEntry[] entries,
int operationCode)
This method is called by the engine when an event matching this filter's operation code
occurs in the engine.
|
void |
process(SpaceContext context,
ISpaceFilterEntry entry,
int operationCode)
This method is called by the engine when an event matching this filter's
operation code occurs in the space engine.
|
void |
setCustomRoleAuthority(List<RoleDetails> customRoleAuthority) |
void |
setCustomUserAuthority(List<UserDetails> customUserAuthority) |
public List<UserDetails> getCustomUserAuthority()
public void setCustomUserAuthority(List<UserDetails> customUserAuthority)
public List<RoleDetails> getCustomRoleAuthority()
public void setCustomRoleAuthority(List<RoleDetails> customRoleAuthority)
public void init(IJSpace space, String filterId, String url, int priority) throws RuntimeException
ISpaceFilter
init
in interface ISpaceFilter
space
- an embedded proxy to the space that contain this filter.filterId
- the name of this filter.url
- The URL that was passed when this filter was created.priority
- defines the order in which filters are activated.RuntimeException
- if this exception is raised, the filter will be discarded
by the engine for the current engine execution ,unless
defined otherwise in space configuration.public void process(SpaceContext context, ISpaceFilterEntry entry, int operationCode) throws RuntimeException
ISpaceFilter
This method is called by the engine when an event matching this filter's operation code occurs in the space engine. Only for SecurityFilter implementation: On SET_SECURITY operation code call SpaceContext.setSecurityContext().
process
in interface ISpaceFilter
context
- the Context passed by the caller, contains security context. some of the
filters (like ON_INIT) will always receive a null context.entry
- the event that occurred.operationCode
- the operation that defines when this filter is activated. The operation
codes are defined in FilterOperationCodes
.RuntimeException
- if this exception is raised for BEFORE filters, it aborts
the execution of the operation.public void process(SpaceContext context, ISpaceFilterEntry[] entries, int operationCode) throws RuntimeException
ISpaceFilter
Notice: This is a special case that is called only on update()
only on AFTER_UPDATE
.
Also on
BEFORE_NOTIFY_TRIGGER
and AFTER_NOTIFY_TRIGGER
.
process
in interface ISpaceFilter
context
- the Context passed by the caller, contains security context. some of the
filters (like ON_INIT) will always receive a null context.entries
- an array of two elements: On AFTER_UPDATE
: the first element represents the old entry while the
second is the new entry.
On BEFORE_NOTIFY_TRIGGER
and AFTER_NOTIFY_TRIGGER
: the first element represents the entry while the
second is the template.
operationCode
- the operation that defines when this filter is activated. The operation
codes are defined in FilterOperationCodes
.RuntimeException
- if this exception is raised for BEFORE filters,public void close() throws RuntimeException
ISpaceFilter
close
in interface ISpaceFilter
RuntimeException
- if this exception is raised it will be logged. This should
be used as away to report a filter internal error.Copyright © GigaSpaces.