jet.server.api.custom.security
Interface SecurityListener


public interface SecurityListener

The listener interface for receiving security info changed event from customer's external security system. A SecurityListener is implememented by JReport server, and is added to customer's implementation of JReport security API by invoking AuthenticationProvider.addSecurityListener(). If any security info in customer's external security system is changed, but the change is not performed by customer's implementation of JReport security API, in this case a security changed event should be fire to security listener which has added into customer's implementation of JReport security API. JReport server will refresh security system base on the external security changed event.

Since:
version 8

Field Summary
static int PRINCIPAL_TYPE_GROUP
          PRINCIPAL_TYPE_GROUP Int identifier for principal type: group, value: 3.
static int PRINCIPAL_TYPE_ROLE
          PRINCIPAL_TYPE_ROLE Int identifier for principal type: role, value: 2.
static int PRINCIPAL_TYPE_USER
          PRINCIPAL_TYPE_USER Int identifier for principal type: user, value: 1.
 
Method Summary
 void addPrincipal(java.lang.String realm, java.lang.String principal, int principalType)
          Inform JReport server that a principal is added into customer's external security system, JReport server should update relevant info about this principal in security system in future.
 void addRelation(java.lang.String realm, java.lang.String parentPrincipal, int parentPrincipalType, java.lang.String subPrincipal, int subPrincipalType)
          Inform JReport server that a relation is created between 2 principals in customer's external secuirty system, JReport server should update relevant info about the new relation in security system in future.
 void removePrincipal(java.lang.String realm, java.lang.String principal, int principalType)
          Inform JReport server that a principal is removed from customer's external security system, JReport server should update relevant info about this principal in security system in future.
 void removeRelation(java.lang.String realm, java.lang.String parentPrincipal, int parentPrincipalType, java.lang.String subPrincipal, int subPrincipalType)
          Inform JReport server that a relation between 2 principals is removed in customer's external secuirty system, JReport server should update relevant info about the removed relation in security system in future.
 void updateAll(java.lang.String realmName)
          Inform JReport server that all security info referred to specified realm in JReport server should be updated according to customer's external security system.
 void updatePermissons(java.lang.String realm, java.lang.String resourcePath, int versionNumber)
          Inform JReport server that permission setting of a specified resource/version is updated in customer's external security system.
 void updatePrivileges(java.lang.String realm, java.lang.String principal, int principalType)
          Inform JReport server that privileges of a specified principal is updated in customer's external security system.
 

Field Detail

PRINCIPAL_TYPE_USER

static final int PRINCIPAL_TYPE_USER
PRINCIPAL_TYPE_USER Int identifier for principal type: user, value: 1.

See Also:
Constant Field Values

PRINCIPAL_TYPE_ROLE

static final int PRINCIPAL_TYPE_ROLE
PRINCIPAL_TYPE_ROLE Int identifier for principal type: role, value: 2.

See Also:
Constant Field Values

PRINCIPAL_TYPE_GROUP

static final int PRINCIPAL_TYPE_GROUP
PRINCIPAL_TYPE_GROUP Int identifier for principal type: group, value: 3.

See Also:
Constant Field Values
Method Detail

updateAll

void updateAll(java.lang.String realmName)
Inform JReport server that all security info referred to specified realm in JReport server should be updated according to customer's external security system.

Parameters:
realmName - the realm name

addPrincipal

void addPrincipal(java.lang.String realm,
                  java.lang.String principal,
                  int principalType)
Inform JReport server that a principal is added into customer's external security system, JReport server should update relevant info about this principal in security system in future.

Parameters:
realm - the realm naem
principal - principal name
principalType - the pricinpal type, value scope: SecurityListener.PRINCIPAL_TYPE_USER, SecurityListener.PRINCIPAL_TYPE_GROUP, SecurityListener.PRINCIPAL_TYPE_ROLE.

removePrincipal

void removePrincipal(java.lang.String realm,
                     java.lang.String principal,
                     int principalType)
Inform JReport server that a principal is removed from customer's external security system, JReport server should update relevant info about this principal in security system in future.

Parameters:
realm - the realm naem
principal - principal name
principalType - the pricinpal type, value scope: SecurityListener.PRINCIPAL_TYPE_USER, SecurityListener.PRINCIPAL_TYPE_GROUP, SecurityListener.PRINCIPAL_TYPE_ROLE.

addRelation

void addRelation(java.lang.String realm,
                 java.lang.String parentPrincipal,
                 int parentPrincipalType,
                 java.lang.String subPrincipal,
                 int subPrincipalType)
Inform JReport server that a relation is created between 2 principals in customer's external secuirty system, JReport server should update relevant info about the new relation in security system in future.

Parameters:
realm - the realm name
parentPrincipal - the parent principal name
parentPrincipalType - the parent principal type, value scope: SecurityListener.PRINCIPAL_TYPE_USER, SecurityListener.PRINCIPAL_TYPE_GROUP, SecurityListener.PRINCIPAL_TYPE_ROLE.
subPrincipal - the sub-principal name
subPrincipalType - the sub-principal type, value scope: SecurityListener.PRINCIPAL_TYPE_USER, SecurityListener.PRINCIPAL_TYPE_GROUP, SecurityListener.PRINCIPAL_TYPE_ROLE.

removeRelation

void removeRelation(java.lang.String realm,
                    java.lang.String parentPrincipal,
                    int parentPrincipalType,
                    java.lang.String subPrincipal,
                    int subPrincipalType)
Inform JReport server that a relation between 2 principals is removed in customer's external secuirty system, JReport server should update relevant info about the removed relation in security system in future.

Parameters:
realm - the realm name
parentPrincipal - the parent principal name
parentPrincipalType - the parent principal type, value scope: SecurityListener.PRINCIPAL_TYPE_USER, SecurityListener.PRINCIPAL_TYPE_GROUP, SecurityListener.PRINCIPAL_TYPE_ROLE.
subPrincipal - the sub-principal name
subPrincipalType - the sub-principal type, value scope: SecurityListener.PRINCIPAL_TYPE_USER, SecurityListener.PRINCIPAL_TYPE_GROUP, SecurityListener.PRINCIPAL_TYPE_ROLE.

updatePermissons

void updatePermissons(java.lang.String realm,
                      java.lang.String resourcePath,
                      int versionNumber)
Inform JReport server that permission setting of a specified resource/version is updated in customer's external security system. JReport server should update permission setting of this resource/version in security system in future.

Parameters:
realm - the realm name
resourcePath - the resource path to specify a resource
versionNumber - version number of the resource, a valid version number should be a positive integer, if versionNumber less than 1, it means permission setting of the resouce which specified by resourcePath is updated.

updatePrivileges

void updatePrivileges(java.lang.String realm,
                      java.lang.String principal,
                      int principalType)
Inform JReport server that privileges of a specified principal is updated in customer's external security system. JReport server should update this principal's privileges in security system in future.

Parameters:
realm - the realm name
principal - principal name, whose privileges have updated
principalType - the pricinpal type, value scope: SecurityListener.PRINCIPAL_TYPE_USER, SecurityListener.PRINCIPAL_TYPE_GROUP, SecurityListener.PRINCIPAL_TYPE_ROLE.