org.dvb.tvanytime.resolution
Interface ResolutionResponse


public interface ResolutionResponse

Interface for encapsulating a resolution response. A resolution function call will return an object which implements this interface

All the searching through the local database and possibly multiple IP servers is done transparently.

There are 4 states that an application needs to distinguish:

  1. The resolution is successful AND complete requiring no further resolution [status = "resolved" and complete = "true"]
  2. There are children in the response but it is incomplete and needs further resolution [status = "resolved" and complete = "false"]
  3. Resolve again at a certain time but there are no children [status = "cannot yet resolve" (or "unable to resolve" for a secondary resolution source)]
  4. PDR should discard the CRID because it is invalid [status = "discard CRID" (or "unable to resolve" for a primary resolution source)]

1234
isValid()truetruetrue false
isSuccessful()truetruefalse undefined
isCompletelyResolved()truefalse falseundefined
getChildren()VectorVectornull null
getNextResolutionDate()nullDate or null Date or nullnull
getType()TYPE_GET_ALL or TYPE_ALTERNATIVE TYPE_GET_ALL or TYPE_ALTERNATIVEundefined undefined

Note that resolution authorities are never returned as a possible response. The redirection mechanism is automatically followed. In other words, a client of this class does not need to know about Resolving Authority Records, nor the various Resolution handlers that are used to carry out the resolution.


Field Summary
static int TYPE_ALTERNATIVE
          Value returned by getType which indicates that just one of the children should be captured.
static int TYPE_GET_ALL
          Value returned by getType which indicates that all the children should be captured.
 
Method Summary
 java.util.Vector getChildren()
          This method provides access to the resolution results.
 java.util.Date getNextResolutionDate()
          If the resolution was not successful, or successful but incomplete, this function may indicate when an application should try to resolve again.
 CRID getQueryCRID()
          Returns the Content Reference that was used in the query which created this response.
 int getSource()
          Get the source of this resolution response.
 int getType()
          Signals how the list of children should be handled.
 boolean hasCRIDChildren()
          Returns true if this response is for a group CRID that has CRIDs as its children.
 boolean isCompletelyResolved()
          Used to indicate whether or not further resolution is required.
 boolean isSuccessful()
          Used to indicate whether or not the Content Reference was successfully resolved.
 boolean isValid()
          Used to indicate whether or not a valid response has been obtained.
 

Field Detail

TYPE_GET_ALL

static final int TYPE_GET_ALL
Value returned by getType which indicates that all the children should be captured. e.g. this would be used for a series.

See Also:
Constant Field Values

TYPE_ALTERNATIVE

static final int TYPE_ALTERNATIVE
Value returned by getType which indicates that just one of the children should be captured. e.g. this would be used for a programme and its repeat.

See Also:
Constant Field Values
Method Detail

isValid

boolean isValid()
Used to indicate whether or not a valid response has been obtained. This method will return false if the resolution status is signalled as "discard CRID" or if the resolution source is primary source and the resolution status is signalled as "unable to resolve".

Returns:
true if a valid response has been obtained.

isSuccessful

boolean isSuccessful()
Used to indicate whether or not the Content Reference was successfully resolved. (i.e. whether or not the response has children)

Returns:
true if there is no need to resolve again

isCompletelyResolved

boolean isCompletelyResolved()
Used to indicate whether or not further resolution is required.

Returns:
true if there is no need to resolve again

getQueryCRID

CRID getQueryCRID()
Returns the Content Reference that was used in the query which created this response. This is necessary since resolution results may not be returned in the order they were requested.

Returns:
a CRID object

getChildren

java.util.Vector getChildren()
This method provides access to the resolution results. By using the instanceof operator the client can determine the type of object that each element of the vector contains.

Returns:
a vector of CRIDs or a vector of ContentLocations. Null if there are no children.

hasCRIDChildren

boolean hasCRIDChildren()
Returns true if this response is for a group CRID that has CRIDs as its children. If hasCRIDChildren returns true, then the getChildren call will return a Vector that only contains CRID objects. If hasCRIDChildren returns false, the getChildren function will return a Vector of ContentLocation objects, or the getChildren call will return an empty Vector.

Returns:
true if the query CRID is known to be a group CRID (i.e. has CRID children)

getNextResolutionDate

java.util.Date getNextResolutionDate()
If the resolution was not successful, or successful but incomplete, this function may indicate when an application should try to resolve again. The Date returned shall contain a copy of the date contained in this instance such that it can be freely modified by applications without changing the date contained in this instance.

Returns:
the date of the next resolution. Null if no re-resolve date is signalled.

getType

int getType()
Signals how the list of children should be handled.

Returns:
an integer taking value TYPE_GET_ALL or TYPE_ALTERNATIVE

getSource

int getSource()
Get the source of this resolution response.

Returns:
a value which is either RESOLVE_LOCAL, RESOLVE_DVB, or RESOLVE_IP as defined in the ContentReferencingManager class that identifies the source of this resolution response.