com.metamatrix.common.callback
Class CallbackImpl

java.lang.Object
  extended by com.metamatrix.common.object.ObjectDefinitionImpl
      extended by com.metamatrix.common.callback.CallbackImpl
All Implemented Interfaces:
Callback, ObjectDefinition, PropertiedObject, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
UserPreferenceCallback

public class CallbackImpl
extends ObjectDefinitionImpl
implements Callback

Implementations of this interface are passed to a CallbackHandler, allowing underlying services the ability to interact with a calling application to retrieve specific authentication data such as usernames and passwords, or to display certain information, such as error and warning messages. Following the completion of the handle method on CallbackHandler, the component that generated the callbacks can then obtain the information from the callbacks.

Callback implementations do not retrieve or display the information requested by underlying security services. Callback implementations simply provide the means to pass such requests to applications, and for applications, if appropriate, to return requested information back to the underlying security services.

See Also:
Serialized Form

Constructor Summary
CallbackImpl(java.lang.String name, java.lang.String displayName, CallbackChoices choices)
           
CallbackImpl(java.lang.String name, java.lang.String displayName, CallbackChoices choices, PropertiedObject propertiedObject, PropertiedObjectEditor propertiedObjectEditor)
           
CallbackImpl(java.lang.String name, java.lang.String displayName, CallbackChoices choices, PropertiedObject propertiedObject, PropertiedObjectEditor propertiedObjectEditor, java.util.List propertyDefinitionGroups, boolean isSequential)
           
 
Method Summary
 CallbackChoices getChoices()
          get the choice options that are available for providing this callback's setChoice() method.
 PropertiedObjectEditor getEditor()
          return the PropertiedObjectEditor that the CallbackHandler should user to edit this Callback's PropertiedObject.
 PropertyDefinitionGroup getNextGroup()
          return the next PropertyDefinitionGroup.
 PropertyDefinitionGroup getPreviousGroup()
          return the previous PropertyDefinitionGroup.
 PropertiedObject getPropertiedObject()
          return a PropertiedObject that the CallbackHandler should use and modify to hold any values in response to this Callback.
 java.util.List getPropertyDefinitionGroups()
          return the list of PropertyDefinitionGroups contained by this Callback.
 int getResponse()
          return the response that this callback received from the callback handler.
 boolean hasNextGroup()
          determine if there is a next PropertyDefinitionGroup.
 boolean hasPreviousGroup()
          determine if there is a previous PropertyDefinitionGroup.
 boolean hasPropertiedObject()
          determine if this Callback contains a PropertiedObject that should be modified to provide values for the resource requesting the callback.
 boolean hasPropertyDefinitionGroups()
          determine if this Callback contains one or more PropertyDefinitionGroups.
 boolean isSequential()
          determine if the List of PropertyDefinitionGroups contained by this object should be processed one-by-one in order (as in a "wizard"), or all at once (as in a tabbed panel).
 void setResponse(int responseIndex)
          set the response to this callback from the options provide by this callback's getOptions() method.
 
Methods inherited from class com.metamatrix.common.object.ObjectDefinitionImpl
clone, compareTo, computeDisplayName, computePluralDisplayName, equals, getDisplayName, getName, getPluralDisplayName, getShortDescription, getShortDisplayName, hashCode, setDisplayName, setName, setPluralDisplayName, setShortDescription, setShortDisplayName, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.metamatrix.common.object.ObjectDefinition
compareTo, equals, getDisplayName, getName, getPluralDisplayName, getShortDescription, getShortDisplayName, toString
 

Constructor Detail

CallbackImpl

public CallbackImpl(java.lang.String name,
                    java.lang.String displayName,
                    CallbackChoices choices)

CallbackImpl

public CallbackImpl(java.lang.String name,
                    java.lang.String displayName,
                    CallbackChoices choices,
                    PropertiedObject propertiedObject,
                    PropertiedObjectEditor propertiedObjectEditor)

CallbackImpl

public CallbackImpl(java.lang.String name,
                    java.lang.String displayName,
                    CallbackChoices choices,
                    PropertiedObject propertiedObject,
                    PropertiedObjectEditor propertiedObjectEditor,
                    java.util.List propertyDefinitionGroups,
                    boolean isSequential)
Method Detail

getResponse

public int getResponse()
return the response that this callback received from the callback handler.


getChoices

public CallbackChoices getChoices()
get the choice options that are available for providing this callback's setChoice() method.

Specified by:
getChoices in interface Callback
Returns:
the CallbackChoices for this object.

setResponse

public void setResponse(int responseIndex)
set the response to this callback from the options provide by this callback's getOptions() method.

Specified by:
setResponse in interface Callback
Parameters:
response - the response value from among the chioce options: YES, NO, CANCEL, or OK.

hasPropertiedObject

public boolean hasPropertiedObject()
determine if this Callback contains a PropertiedObject that should be modified to provide values for the resource requesting the callback.

Specified by:
hasPropertiedObject in interface Callback
Returns:
true if this callback contains a PropertiedObject and a PropertiedObjectEditor. If false, then the resource is requesting a direct response to this object's getDisplayName().

hasPropertyDefinitionGroups

public boolean hasPropertyDefinitionGroups()
determine if this Callback contains one or more PropertyDefinitionGroups. The groups are used to indicate collections of PropertyDefinitions which the CallbackHandler may process either sequentially (if isSequential() returns true), or all at once.

Specified by:
hasPropertyDefinitionGroups in interface Callback
Returns:
true if this callback contains a both PropertiedObject and one or more PropertyDefinitionGroups. If false, and hasPropertiedObject() returns true, then the resource is requesting that the PropertiedObject be editied directly and all at once by the CallbackHandler.

isSequential

public boolean isSequential()
determine if the List of PropertyDefinitionGroups contained by this object should be processed one-by-one in order (as in a "wizard"), or all at once (as in a tabbed panel).

Specified by:
isSequential in interface Callback
Returns:
true if this callback contains PropertyDefinitionGroups that should be processed sequentially, as with a wizard. Returns false if the groups can be processed all at once or if this Callback contains no groups.

getEditor

public PropertiedObjectEditor getEditor()
return the PropertiedObjectEditor that the CallbackHandler should user to edit this Callback's PropertiedObject.

Specified by:
getEditor in interface Callback
Returns:
the editor for this Callback's PropertiedObject. May be null if this Callback does not contain a PropertiedObject.

getPropertiedObject

public PropertiedObject getPropertiedObject()
return a PropertiedObject that the CallbackHandler should use and modify to hold any values in response to this Callback.

Specified by:
getPropertiedObject in interface Callback
Returns:
the PropertiedObject which for this Callback's resource is requesting values. May be null if this Callback does not contain a PropertiedObject.

getPropertyDefinitionGroups

public java.util.List getPropertyDefinitionGroups()
return the list of PropertyDefinitionGroups contained by this Callback.

Specified by:
getPropertyDefinitionGroups in interface Callback
Returns:
the list PropertyDefinitionGroups, null if there are none.

hasNextGroup

public boolean hasNextGroup()
determine if there is a next PropertyDefinitionGroup.

Specified by:
hasNextGroup in interface Callback

hasPreviousGroup

public boolean hasPreviousGroup()
determine if there is a previous PropertyDefinitionGroup.

Specified by:
hasPreviousGroup in interface Callback

getNextGroup

public PropertyDefinitionGroup getNextGroup()
return the next PropertyDefinitionGroup.

Specified by:
getNextGroup in interface Callback
Returns:
the next PropertyDefinitionGroup, null if there are no more;

getPreviousGroup

public PropertyDefinitionGroup getPreviousGroup()
return the previous PropertyDefinitionGroup.

Specified by:
getPreviousGroup in interface Callback
Returns:
the previous PropertyDefinitionGroup, null if there is no previous Group;


Copyright © 2009. All Rights Reserved.