Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.advisor
Interface Advice

public interface Advice

This interface is used to return advice from the Advisor. Advice can consist of a number of namespaces (one for each Advislet) each of which can contain a list of key-value pairs, that contain sub-results for the Advice.

Advice is considered complete if isComplete returns true and there are no ProcessingErrors associated with the Advice.

Method Summary
`void` | `addProcessingError(ProcessingError error)` Adds an error that ocurred while processing an AdviceRequest
`java.lang.Object` | `getEntry(Advislet advislet, java.lang.Object key)` Retrieves an entry from an Advislet's namespace.
`java.lang.String` | `getIdentifier()` Get the identifier for the Advice.
`ProcessingError[]` | `getProcessingErrors()` Get the ProcessingErrors which occured while creating the Advice.
`java.lang.Object` | `getResult()` Returns the last RESULT key written to the Advice.
`java.lang.Object` | `getResult(Advislet advislet)` Get the object with the RESULT key for an Advislet.
`boolean` | `isComplete()` Returns the completion status for the Advice.
`void` | `setEntry(Advislet advislet, java.lang.Object key, java.lang.Object value)` Sets an entry within an Advislet's namespace.
`void` | `setIncomplete()` Marks this Advice object as incomplete.
`void` | `setResult(Advislet advislet, java.lang.Object value)` Sets the result within an Advislet's namespace.

Method Detail

### getEntry

    public java.lang.Object getEntry(Advislet advislet,
                                     java.lang.Object key)

  Retrieves an entry from an Advislet's namespace.

  Parameters:
    `advislet` - the Advislet namespace to be queried
    `key` - the key for the value within the namespace
  Returns:
    an Advice sub-result

### setEntry

    public void setEntry(Advislet advislet,
                         java.lang.Object key,
                         java.lang.Object value)

  Sets an entry within an Advislet's namespace.

  Parameters:
    `advislet` - the Advislet namespace to be modifed
    `key` - the key for the Advice sub-result being added.
    `value` - the value to be associated with the key

### setResult

    public void setResult(Advislet advislet,
                          java.lang.Object value)

  Sets the result within an Advislet's namespace.

  Parameters:
    `advislet` - the Advislet namespace to be modifed
    `value` - the result value

### getIdentifier

    public java.lang.String getIdentifier()

  Get the identifier for the Advice.

  Returns:
    the unique identifier for the advice result

### getProcessingErrors

    public ProcessingError[] getProcessingErrors()

  Get the ProcessingErrors which occured while creating the Advice.

  Returns:
    the errors that ocurred while processing an AdviceRequest

### addProcessingError

    public void addProcessingError(ProcessingError error)

  Adds an error that ocurred while processing an AdviceRequest

  Parameters:
    `error` - the ProcessingError to be added.

### isComplete

    public boolean isComplete()

  Returns the completion status for the Advice.

  Returns:
    `true` if the AdviceRequest was fully completed without errors. If this method returns false the caller should examine the ProcessingErrors before using any sub-result entries and should not call getResult().

### setIncomplete

    public void setIncomplete()

  Marks this Advice object as incomplete. Once an Advice object is marked as incomplete it cannot be subsequently marked as complete.

### getResult

    public java.lang.Object getResult(Advislet advislet)

  Get the object with the RESULT key for an Advislet.

  Parameters:
    `advislet` - The target Advislet
  Returns:
    the Object with the RESULT key for the Advislet

### getResult

    public java.lang.Object getResult()
                               throws java.lang.IllegalStateException

  Returns the last RESULT key written to the Advice.

  Returns:
    the Object with the RESULT key for the final Advislet The last object that was saved with RESULT key is returned
  Throws:
    java.lang.IllegalStateException - if `isComplete` returns false

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 BEA Systems, Inc. All Rights Reserved