001: /*
002: * $RCSfile: RemoteRenderedImage.java,v $
003: *
004: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005: *
006: * Use is subject to license terms.
007: *
008: * $Revision: 1.1 $
009: * $Date: 2005/02/11 04:57:53 $
010: * $State: Exp $
011: */package javax.media.jai.remote;
012:
013: import java.awt.image.RenderedImage;
014: import javax.media.jai.remote.NegotiableCapabilitySet;
015:
016: /**
017: * <code>RemoteRenderedImage</code> is an interface commonly used to
018: * represent objects which contain or can produce image data in the form of
019: * <code>Raster</code>s from locations that are remote. The image data may be
020: * stored/produced as a single tile or a regular array of tiles.
021: *
022: * <p>This class is the remote equivalent of the <code>RenderedImage</code>
023: * interface and adds methods that deal with the remote location aspect of
024: * the image.
025: *
026: * @see RenderedImage
027: *
028: * @since JAI 1.1
029: */
030: public interface RemoteRenderedImage extends RenderedImage {
031:
032: /**
033: * Returns the <code>String</code> that identifies the server.
034: */
035: String getServerName();
036:
037: /**
038: * Returns the <code>String</code> that identifies the remote imaging
039: * protocol.
040: */
041: String getProtocolName();
042:
043: /**
044: * Returns the amount of time between retries in milliseconds.
045: */
046: int getRetryInterval();
047:
048: /**
049: * Sets the amount of time between retries in milliseconds.
050: *
051: * @param retryInterval The amount of time (in milliseconds) to wait
052: * between retries.
053: * @throws IllegalArgumentException if retryInterval is negative.
054: */
055: void setRetryInterval(int retryInterval);
056:
057: /**
058: * Returns the number of retries.
059: */
060: int getNumRetries();
061:
062: /**
063: * Sets the number of retries.
064: *
065: * @param numRetries The number of times an operation should be retried
066: * in case of a network error.
067: * @throws IllegalArgumentException if numRetries is negative.
068: */
069: void setNumRetries(int numRetries);
070:
071: /**
072: * Returns the current negotiation preferences or null, if none were
073: * set previously.
074: */
075: NegotiableCapabilitySet getNegotiationPreferences();
076:
077: /**
078: * Sets the preferences to be used in the client-server
079: * communication. These preferences are utilized in the negotiation
080: * process. Note that preferences for more than one category can be
081: * specified using this method. Also each preference can be a list
082: * of values in decreasing order of preference, each value specified
083: * as a <code>NegotiableCapability</code>. The
084: * <code>NegotiableCapability</code> first (for a particular category)
085: * in this list is given highest priority in the negotiation process
086: * (for that category).
087: *
088: * <p> It may be noted that this method allows for multiple negotiation
089: * cycles. Everytime this method is called, new preferences are
090: * specified for the negotiation, which can be utilized to perform
091: * a new round of negotiation to produce new negotiated values to be
092: * used in the remote communication.
093: *
094: * @param preferences The preferences to be used in the negotiation
095: * process.
096: * @throws IllegalArgumentException if preferences is null.
097: */
098: void setNegotiationPreferences(NegotiableCapabilitySet preferences);
099:
100: /**
101: * Returns the results of the negotiation process. This will return null
102: * if no negotiation preferences were set, and no negotiation was
103: * performed, or if the negotiation failed.
104: */
105: NegotiableCapabilitySet getNegotiatedValues()
106: throws RemoteImagingException;
107:
108: /**
109: * Returns the results of the negotiation process for the given category.
110: * This will return null if no negotiation preferences were set, and no
111: * negotiation was performed, or if the negotiation failed.
112: *
113: * @param String category The category to get the negotiated results for.
114: * @throws IllegalArgumentException if category is null.
115: */
116: NegotiableCapability getNegotiatedValue(String category)
117: throws RemoteImagingException;
118:
119: /**
120: * Informs the server of the negotiated values that are the result of
121: * a successful negotiation.
122: *
123: * @param negotiatedValues The result of the negotiation.
124: */
125: void setServerNegotiatedValues(
126: NegotiableCapabilitySet negotiatedValues)
127: throws RemoteImagingException;
128: }
|