fulmine.context
Class DefaultPermissionProfile

java.lang.Object
  extended by fulmine.context.DefaultPermissionProfile
All Implemented Interfaces:
IPermissionProfile

public class DefaultPermissionProfile
extends Object
implements IPermissionProfile

A permission profile that has permission only for the default application and default permission code. This means that, by default, this profile can view all IFields that are created with no application or permission details.

When application code provides a permission profile via IFulmineContext.setPermissionProfile(IPermissionProfile), the application profile is merged with the default profile; this allows the application's context to still view fields that have no permission (they use the default application and permission).

Author:
Ramon Servadei

Field Summary
 
Fields inherited from interface fulmine.context.IPermissionProfile
DEFAULT_APPLICATION, DEFAULT_PERMISSION
 
Constructor Summary
DefaultPermissionProfile()
           
 
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
 IPermissionProfile getApplicationPermissions()
          Get the application permissions
 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.
 void setApplicationPermissions(IPermissionProfile applicationPermissions)
          Set the application permissions
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultPermissionProfile

public DefaultPermissionProfile()
Method Detail

contains

public boolean contains(byte application,
                        short permission)
Description copied from interface: IPermissionProfile
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.

Specified by:
contains in interface IPermissionProfile
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

public boolean matches(byte receivedApplication,
                       short receivedPermission,
                       byte matchWithApplication,
                       short matchWithPermission)
Description copied from interface: IPermissionProfile
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.

Specified by:
matches in interface IPermissionProfile
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

getApplicationPermissions

public IPermissionProfile getApplicationPermissions()
Get the application permissions

Returns:
the permissions set by the application
See Also:
IFulmineContext.setPermissionProfile(IPermissionProfile)

setApplicationPermissions

public void setApplicationPermissions(IPermissionProfile applicationPermissions)
Set the application permissions

Parameters:
applicationPermissions - the permissions for the application
See Also:
IFulmineContext.setPermissionProfile(IPermissionProfile)

getApplicationCode

public byte getApplicationCode()
Description copied from interface: IPermissionProfile
Get the application code of this profile

Specified by:
getApplicationCode in interface IPermissionProfile
Returns:
the application code of this profile

getPermissionCode

public short getPermissionCode()
Description copied from interface: IPermissionProfile
Get the permission code of this profile

Specified by:
getPermissionCode in interface IPermissionProfile
Returns:
the permission code of this profile

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2009. All Rights Reserved.