com.metamatrix.common.callback
Interface Callback

All Superinterfaces:
java.lang.Comparable, ObjectDefinition, PropertiedObject
All Known Implementing Classes:
CallbackImpl, UserPreferenceCallback

public interface Callback
extends ObjectDefinition

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.


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.
 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 response)
          set the response to this callback from the options provide by this callback's getOptions() method.
 
Methods inherited from interface com.metamatrix.common.object.ObjectDefinition
compareTo, equals, getDisplayName, getName, getPluralDisplayName, getShortDescription, getShortDisplayName, toString
 

Method Detail

getChoices

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

Returns:
the options : UNSPECIFIED_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION. Note that for UNSPECIFIED_OPTION, any value provided to setChoice() will be acceptable and the value will not be examined buy the resource requesting the callback.

setResponse

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

Parameters:
response - the index of available choices from the CallbackChoices object:

hasPropertiedObject

boolean hasPropertiedObject()
determine if this Callback contains a PropertiedObject that should be modified to provide values for the resource requesting the 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

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.

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

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).

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

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

Returns:
the editor for this Callback's PropertiedObject. May be null if this Callback does not contain a PropertiedObject.

getPropertiedObject

PropertiedObject getPropertiedObject()
return a PropertiedObject that the CallbackHandler should use and modify to hold any values in response to this 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

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

Returns:
the list PropertyDefinitionGroups, null if there are none.

hasNextGroup

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


hasPreviousGroup

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


getNextGroup

PropertyDefinitionGroup getNextGroup()
return the next PropertyDefinitionGroup.

Returns:
the next PropertyDefinitionGroup, null if there are no more;

getPreviousGroup

PropertyDefinitionGroup getPreviousGroup()
return the previous PropertyDefinitionGroup.

Returns:
the previous PropertyDefinitionGroup, null if there is no previous Group;


Copyright © 2009. All Rights Reserved.