fulmine.context
Interface IPermissionProfile

All Known Implementing Classes:
DefaultPermissionProfile

public interface IPermissionProfile

Represents the permission profile for the IFulmineContext. Permissions govern the visibility of published data by subscribers. A publisher of data will assign permission rights to its data. Subscribers of the data must have appropriate permission rights to view the data.

Permission tokens are attached to IFields of an IContainer. When reading its state from a wire frame, a field will check its permission token against that of the context. If the permissions 'match' then the field will read its state from the wire frame and application code will be able to view the state of the field. If the permission tokens do not match then application code will have access to the field but its value will be blank (or null). A similar strategy is applied when a remote context attempts to update a local container's fields; if the permissions do not match, the operation is not permitted.

A permission token for a field is composed of two segments; an application code and a permission code. This provides the ability for a single application to expose multiple permissions (e.g. level1, level2 permissions). The application is essentially hosted by the context and the fields published by the application will be tagged with a permission token. A subscribing application (hosted by another context) may have many permission tokens that allow it to view the fields of many other applications.

The definition of a permission match is performed by implementations of this interface.

Author:
Ramon Servadei

Field Summary
static byte DEFAULT_APPLICATION
          Represents a default application
static short DEFAULT_PERMISSION
          Represents the default permission code
 
Method Summary
 boolean contains(byte application, short permission)
          Determine if the application and permission arguments are contained by this permission profile.
 byte getApplicationCode()
          Get the application code of this profile
 short getPermissionCode()
          Get the permission code of this profile
 boolean matches(byte receivedApplication, short receivedPermission, byte matchWithApplication, short matchWithPermission)
          Determine if the received application and permission codes are matched with a set of application and permission codes.
 

Field Detail

DEFAULT_APPLICATION

static final byte DEFAULT_APPLICATION
Represents a default application

See Also:
Constant Field Values

DEFAULT_PERMISSION

static final short DEFAULT_PERMISSION
Represents the default permission code

See Also:
Constant Field Values
Method Detail

contains

boolean contains(byte application,
                 short permission)
Determine if the application and permission arguments are contained by this permission profile.

This is generally used when reading the wire-state of an IField and determines if the data is de-serialised into the remote instance; basically prevents data from being read in a context that does not have permission to do so.

Parameters:
application - the application code
permission - the permission code
Returns:
true if the application and permission codes are contained by (matched by) this profile, false otherwise

matches

boolean matches(byte receivedApplication,
                short receivedPermission,
                byte matchWithApplication,
                short matchWithPermission)
Determine if the received application and permission codes are matched with a set of application and permission codes.

This is generally used when handling RPC operations received from a remote context to update a local container. The permission attributes of the remote context need to be compared with those of the target IField in the local container to determine if the operation should proceed.

Parameters:
receivedApplication - the received application code (generally the application code of a remote context)
receivedPermission - the received permission code (generally the permission code of a remote context)
matchWithApplication - the application code to match with the received one (generally the application code of the field being updated)
matchWithPermission - the permission code to match with the received one (generally the permission code of the field being updated)
Returns:
true if the received application and permission codes are matched by the application and permission codes to compare with, false otherwise
See Also:
IRemoteUpdateHandler

getApplicationCode

byte getApplicationCode()
Get the application code of this profile

Returns:
the application code of this profile

getPermissionCode

short getPermissionCode()
Get the permission code of this profile

Returns:
the permission code of this profile


Copyright © 2007-2009. All Rights Reserved.