WebObjects 5.2

com.webobjects.eodistribution
Interface EODistributionContext.Delegate

Enclosing class:
EODistributionContext

public static interface EODistributionContext.Delegate

This interface defines the methods that can be implemented by the delegate of EODistributionContexts -- mostly to control security. The delegate does not have to actually implement the interface and all methods of it; it is sufficient to implement just the methods needed, but by implementing the interface the compiler helps to find problems with wrong method signatures.


Method Summary
 NSData distributionContextDidReceiveData(EODistributionContext distributionContext, NSData data)
          Gives the delegate an opportunity to decrypt data sent from the client.
 boolean distributionContextShouldAllowAccessToClassDescription(EODistributionContext distributionContext, EOClassDescription classDescription)
          Returns whether the client application of this distribution context should have access to a class description or not.
 boolean distributionContextShouldAllowInvocation(EODistributionContext distributionContext, Object object, NSSelector selector, Object[] arguments)
          Returns whether a remote method invocation to object should be allowed for the client application of this distribution context or not.
 boolean distributionContextShouldFetchObjectsWithFetchSpecification(EODistributionContext distributionContext, EOFetchSpecification fetchSpecification)
          Returns whether the client application of this distribution context should be permitted to execute a fetch with a fetch specification.
 boolean distributionContextShouldFetchObjectWithGlobalID(EODistributionContext distributionContext, EOGlobalID globalID, EOClassDescription classDescription)
          Returns whether the client application of this distribution context should be permitted to fire a fault for a global ID.
 boolean distributionContextShouldFollowKeyPath(EODistributionContext distributionContext, String keyPath)
          Returns whether a remote method invocation to the object identified by keyPath (which is relative to the invocation target of the distribution context) should be allowed for the client application of this distribution context or not.
 boolean distributionContextShouldSave(EODistributionContext distributionContext, EOEditingContext editingContext)
          Returns whether the client application of this distribution context should be permitted to save the state of the editing context editingContext (which is the editing context of the distribution context).
 NSData distributionContextWillSendData(EODistributionContext distributionContext, NSData data)
          Gives the delegate an opportunity to encrypt data sent to the client.
 

Method Detail

distributionContextDidReceiveData

public NSData distributionContextDidReceiveData(EODistributionContext distributionContext,
                                                NSData data)
Gives the delegate an opportunity to decrypt data sent from the client. Note that the client side has to encrypt the data with the help of the distribution channel delegate.
Parameters:
distributionContext - the distribution context
data - the data received from the client
Returns:
the encrypted data

distributionContextShouldAllowAccessToClassDescription

public boolean distributionContextShouldAllowAccessToClassDescription(EODistributionContext distributionContext,
                                                                      EOClassDescription classDescription)
Returns whether the client application of this distribution context should have access to a class description or not. This method allows you to completely prevent a client from accessing a class description, independent of the client-side class property settings for the corresponding entity.
Parameters:
distributionContext - the distribution context
classDescription - the class description to test
Returns:
true if the access to the class description should be permitted; false otherwise.

distributionContextShouldAllowInvocation

public boolean distributionContextShouldAllowInvocation(EODistributionContext distributionContext,
                                                        Object object,
                                                        NSSelector selector,
                                                        Object[] arguments)
Returns whether a remote method invocation to object should be allowed for the client application of this distribution context or not. If the delegate returns false, an exception is raised and sent to the client, so the method invocation is forbidden.
Parameters:
distributionContext - the distribution context
object - the remote method receiver
selector - the selector identifying the method to be invoked
arguments - the arguments to be passed to the method
Returns:
true if the remote method invocation should be permitted; false otherwise

distributionContextShouldFetchObjectWithGlobalID

public boolean distributionContextShouldFetchObjectWithGlobalID(EODistributionContext distributionContext,
                                                                EOGlobalID globalID,
                                                                EOClassDescription classDescription)
Returns whether the client application of this distribution context should be permitted to fire a fault for a global ID. This method allows you to control in great detail which objects can be fetched or not. Note that not all objects are fetched through firing faults, though. The client can create fetch specifications and fetch objects through them. To control which fetch specifications can be executed, use the distributionContextShouldFetchObjectsWithFetchSpecification method (in addition to this method). If the delegate returns false, an exception is raised and sent to the client, so the fetch is forbidden.
Parameters:
distributionContext - the distribution context
globalID - the global ID to test
classDescription - the class description for the object identified by the global ID.
Returns:
true if the fetch should be permitted; false otherwise
See Also:
distributionContextShouldFetchObjectsWithFetchSpecification(EODistributionContext, EOFetchSpecification)

distributionContextShouldFetchObjectsWithFetchSpecification

public boolean distributionContextShouldFetchObjectsWithFetchSpecification(EODistributionContext distributionContext,
                                                                           EOFetchSpecification fetchSpecification)
Returns whether the client application of this distribution context should be permitted to execute a fetch with a fetch specification. This method allows you to control in great detail which objects can be fetched or not. Note that not all objects are fetched through fetch specifications, though. The client can create fault objects with the help of global IDs and simply fire these faults. To control which faults can be fired, use the distributionContextShouldFetchObjectWithGlobalID method (in addition to this method). If the delegate returns false, an exception is raised and sent to the client, so the fetch is forbidden.
Parameters:
distributionContext - the distribution context
fetchSpecification - the fetch specification to test
Returns:
true if the fetch should be permitted; false otherwise
See Also:
distributionContextShouldFetchObjectWithGlobalID(EODistributionContext, EOGlobalID, EOClassDescription)

distributionContextShouldFollowKeyPath

public boolean distributionContextShouldFollowKeyPath(EODistributionContext distributionContext,
                                                      String keyPath)
Returns whether a remote method invocation to the object identified by keyPath (which is relative to the invocation target of the distribution context) should be allowed for the client application of this distribution context or not. If the delegate returns false, an exception is raised and sent to the client, so the method invocation is forbidden.
Parameters:
distributionContext - the distribution context
keyPath - the key path identifying the remote method target
Returns:
true if the remote method invocation should be permitted; false otherwise

distributionContextShouldSave

public boolean distributionContextShouldSave(EODistributionContext distributionContext,
                                             EOEditingContext editingContext)
Returns whether the client application of this distribution context should be permitted to save the state of the editing context editingContext (which is the editing context of the distribution context). This method allows you to control in great detail which changes a client can make. The delegate can examine the state of the object graph in the editing context and if it returns false, an exception is raised and sent to the client, so the save is forbidden.
Parameters:
distributionContext - the distribution context
editingContext - the editing context to be saved
Returns:
true if the save should be permitted; false otherwise

distributionContextWillSendData

public NSData distributionContextWillSendData(EODistributionContext distributionContext,
                                              NSData data)
Gives the delegate an opportunity to encrypt data sent to the client. Note that the client side has to decrypt the data with the help of the distribution channel delegate.
Parameters:
distributionContext - the distribution context
data - the data to be sent to the client
Returns:
the encrypted data

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.