Project Wonder 5.0

er.rest.entityDelegates
Class ERXRestContext

java.lang.Object
  extended by er.rest.entityDelegates.ERXRestContext
All Implemented Interfaces:
com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling

public class ERXRestContext
extends java.lang.Object
implements com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling

ERXRestContext contains all the state for a single REST request. ERXRestContext provides access to the WOContext, which will allow you to access the session should you desire (only cookie sessions can be used by clients right now). Additionally, ERXRestContext acts as a dictionary, so you can put arbitrary values into it if you just want to use it to pass the current User around that way. The EOEditingContext provided by this context is locked at the request level, similar to the session defaultEditingContext.

Author:
mschrag

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.DefaultImplementation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.Utility, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Field Summary
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
_CLASS, NullValue
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Constructor Summary
ERXRestContext(IERXRestDelegate delegate)
          Constructs a rest context.
ERXRestContext(IERXRestEntityDelegate defaultEntityDelegate)
          Shortcut for constructing a rest context with a single default entity delegate.
ERXRestContext(com.webobjects.appserver.WOContext context, com.webobjects.eocontrol.EOEditingContext editingContext, IERXRestDelegate delegate)
          Constructs a rest context.
 
Method Summary
 com.webobjects.appserver.WOContext context()
          Returns the WOContext for this request.
 IERXRestDelegate delegate()
          Returns the REST delegate for this context.
 com.webobjects.eocontrol.EOEditingContext editingContext()
          Returns the EOEditingContext for this request.
 java.lang.Object handleQueryWithUnboundKey(java.lang.String key)
           
 void handleTakeValueForUnboundKey(java.lang.Object value, java.lang.String key)
           
 void setDelegate(IERXRestDelegate delegate)
          Sets the REST delegate for this context (called by ERXRestRequestHandler).
 void takeValueForKey(java.lang.Object obj, java.lang.String key)
           
 void unableToSetNullForKey(java.lang.String key)
           
 java.lang.Object valueForKey(java.lang.String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXRestContext

public ERXRestContext(IERXRestEntityDelegate defaultEntityDelegate)
Shortcut for constructing a rest context with a single default entity delegate.

Parameters:
defaultEntityDelegate - the default entity delegate

ERXRestContext

public ERXRestContext(IERXRestDelegate delegate)
Constructs a rest context.


ERXRestContext

public ERXRestContext(com.webobjects.appserver.WOContext context,
                      com.webobjects.eocontrol.EOEditingContext editingContext,
                      IERXRestDelegate delegate)
Constructs a rest context.

Parameters:
context - the WOContext
editingContext - the EOEditingContext
Method Detail

context

public com.webobjects.appserver.WOContext context()
Returns the WOContext for this request.

Returns:
the WOContext for this request

editingContext

public com.webobjects.eocontrol.EOEditingContext editingContext()
Returns the EOEditingContext for this request.

Returns:
the EOEditingContext for this request

delegate

public IERXRestDelegate delegate()
Returns the REST delegate for this context.

Returns:
the REST delegate for this context

setDelegate

public void setDelegate(IERXRestDelegate delegate)
Sets the REST delegate for this context (called by ERXRestRequestHandler).

Parameters:
delegate - the REST delegate for this context

handleQueryWithUnboundKey

public java.lang.Object handleQueryWithUnboundKey(java.lang.String key)
Specified by:
handleQueryWithUnboundKey in interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling

handleTakeValueForUnboundKey

public void handleTakeValueForUnboundKey(java.lang.Object value,
                                         java.lang.String key)
Specified by:
handleTakeValueForUnboundKey in interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling

unableToSetNullForKey

public void unableToSetNullForKey(java.lang.String key)
Specified by:
unableToSetNullForKey in interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling

takeValueForKey

public void takeValueForKey(java.lang.Object obj,
                            java.lang.String key)
Specified by:
takeValueForKey in interface com.webobjects.foundation.NSKeyValueCoding

valueForKey

public java.lang.Object valueForKey(java.lang.String key)
Specified by:
valueForKey in interface com.webobjects.foundation.NSKeyValueCoding

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.