Package foolscap :: Module constraint :: Class IRemoteMethodConstraint
[hide private]
[frames] | no frames]

Class IRemoteMethodConstraint

source code

zope.interface.Interface --+    
                           |    
                 IConstraint --+
                               |
                              IRemoteMethodConstraint

Instance Methods [hide private]
 
getPositionalArgConstraint(argnum)
Return the constraint for posargs[argnum].
source code
 
getKeywordArgConstraint(argname, num_posargs=0, previous_kwargs=[])
Return the constraint for kwargs[argname].
source code
 
checkAllArgs(args, kwargs, inbound)
Submit all argument values for checking.
source code
 
getResponseConstraint()
Return an IConstraint-providing object to enforce the response constraint.
source code
 
checkResults(results, inbound)
Inspect the results of invoking a method call.
source code
Class Variables [hide private]
  _InterfaceClass__attrs = {'checkAllArgs': <zope.interface.inte...
  __bases__ = (<InterfaceClass foolscap.constraint.IConstraint>)
  __identifier__ = 'foolscap.constraint.IRemoteMethodConstraint'
  __iro__ = (<InterfaceClass foolscap.constraint.IRemoteMethodCo...
  __name__ = 'IRemoteMethodConstraint'
  __sro__ = (<InterfaceClass foolscap.constraint.IRemoteMethodCo...
  _implied = {<InterfaceClass foolscap.constraint.IConstraint>: ...
  dependents = <WeakKeyDictionary at 142176524>

Inherited from zope.interface.Interface (private): _Element__tagged_values

Method Details [hide private]

getPositionalArgConstraint(argnum)

source code 

Return the constraint for posargs[argnum]. This is called on inbound methods when receiving positional arguments. This returns a tuple of (accept, constraint), where accept=False means the argument should be rejected immediately, regardless of what type it might be.

getKeywordArgConstraint(argname, num_posargs=0, previous_kwargs=[])

source code 

Return the constraint for kwargs[argname]. The other arguments are used to handle mixed positional and keyword arguments. Returns a tuple of (accept, constraint).

checkAllArgs(args, kwargs, inbound)

source code 

Submit all argument values for checking. When inbound=True, this is called after the arguments have been deserialized, but before the method is invoked. When inbound=False, this is called just inside callRemote(), as soon as the target object (and hence the remote method constraint) is located.

This should either raise Violation or return None.

getResponseConstraint()

source code 

Return an IConstraint-providing object to enforce the response constraint. This is called on outbound method calls so that when the response starts to come back, we can start enforcing the appropriate constraint right away.

checkResults(results, inbound)

source code 

Inspect the results of invoking a method call. inbound=False is used on the side that hosts the Referenceable, just after the target method has provided a value. inbound=True is used on the RemoteReference side, just after it has finished deserializing the response.

This should either raise Violation or return None.


Class Variable Details [hide private]

_InterfaceClass__attrs

Value:
{'checkAllArgs': <zope.interface.interface.Method object at 0x879768c>\
,
 'checkResults': <zope.interface.interface.Method object at 0x879774c>\
,
 'getKeywordArgConstraint': <zope.interface.interface.Method object at\
 0x87977cc>,
 'getPositionalArgConstraint': <zope.interface.interface.Method object\
 at 0x87977ac>,
...

__iro__

Value:
(<InterfaceClass foolscap.constraint.IRemoteMethodConstraint>,
 <InterfaceClass foolscap.constraint.IConstraint>,
 <InterfaceClass zope.interface.Interface>)

__sro__

Value:
(<InterfaceClass foolscap.constraint.IRemoteMethodConstraint>,
 <InterfaceClass foolscap.constraint.IConstraint>,
 <InterfaceClass zope.interface.Interface>)

_implied

Value:
{<InterfaceClass foolscap.constraint.IConstraint>: (),
 <InterfaceClass foolscap.constraint.IRemoteMethodConstraint>: (),
 <InterfaceClass zope.interface.Interface>: ()}