*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.publish
Class ResultPackage
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sas.services.publish.AbstractEntry
com.sas.services.publish.ResultPackage
- All Implemented Interfaces:
com.sas.entities.EntityKeyInterface,com.sas.io.InputStreamProviderInterface,EntryInterface,ResultPackageInterface,Serializable,Remote
@SASScope("ALL")
@BinaryCompatibilityOnly
public class ResultPackage
extends AbstractEntry
implements ResultPackageInterface
Represents a result package that
can then be published using one of the supported
delivery transports.
See Constructing a
Result Package to Publish for an example of how this class is used.
A result package is a collection
of information, such as a collection of reports, tables and documents.
A package can contain text files, binary files (such as GIF or
JPG), HTML files, references, and viewer files.
Package metadata can be defined to provide more information about the result package:
- Abstract - An abstract can be assigned to the result package. Analogous to the abstract of a technical paper, the result package abstract is typically a paragraph length overview of the contents of the package. It is assigned by the package's creator.
- Creation Date/Time - The creation datetime stamp indicates the result package creation date and time. The creation datetime is assigned when the result package is published. The value is in UTC (not local) time.
- Description - This description is typically a single line summary of the package contents. It is assigned by the package's creator.
- Expiration Date/Time - The expiration datetime indicates the date and time on which the result package is scheduled to expire. The expiration datetime is assigned by the packages's creator. If not specified, the value of Dec 31, 9999 will be assigned when the result package is published. The publish framework does not enforce the expiration. It is up to the calling application to use this expiration value as desired. The value should be stored and interpreted in UTC (not local) time.
- Name/Values - The result package name/values can be assigned to the result package to provide user or application control information that describes the package. Name/value pairs are typically assigned to support subsequent package retrieval in search operations, but they could be used for other purposes as well.
- Since:
- 1.0
- See Also:
-
Field Summary
Fields inherited from class com.sas.services.publish.AbstractEntry
BINARY_COMPAT_VERSION, CATALOG_COMPAT_VERSION, DATASET_COMPAT_VERSION, DEFAULT_ENTRY_VERSION, HTML_COMPAT_VERSION, MDDB_COMPAT_VERSION, NESTEDPACKAGE_COMPAT_VERSION, REFERENCE_COMPAT_VERSION, SQLVIEW_COMPAT_VERSION, TEXT_COMPAT_VERSION, VERSION_94_EXTENDED_ATTRIBUTES, VIEWER_COMPAT_VERSIONFields inherited from class java.rmi.server.RemoteObject
ref -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntry(EntryInterface entry) Adds a new entry to the result package.voidclose()Close the result package.voiddelete()Delete the result package.StringReturns the abstract of the result package.longReturns the creation datetime stamp.Returns an array of all entries in this package.getEntry(int index) Returns a particular result package entry as indicated by the specified index.getEntry(String uniqueId) Returns the result package entry identified by the entity key.Returns the event data.longReturns the expiration datetime stamp.InputStreamGets the input stream for this result package.InputStreamgetInputStream(Object streamID) Deprecated.StringgetName()Returns the name for this result package.com.sas.io.RemoteInputStreamInterfacegetRemoteInputStream(Object streamID) Deprecated.UsegetInputStream()which now supports remote input streams.ObjectDeprecated.this method no longer needed as getInputStream() will return an input stream that can be used in a remote environmentbooleanisNested()Returns true when the result package is a nested package.voidsetAbstract(String pkgAbstract) Set the abstract for the result package.voidsetExpirationDateTime(long expiration) Set the expiration datetime stamp for the packagevoidsetName(String name) Set the name for the result package.Methods inherited from class com.sas.services.publish.AbstractEntry
getDescription, getEntityKey, getNameValuePairs, getURL, isClosed, isReadOnly, sameEntity, setClosed, setDescription, setEntityKey, setNameValuePairs, setRead, throwExceptionIfClosedMethods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLogMethods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStubMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sas.entities.EntityKeyInterface
getEntityKey, sameEntity, setEntityKeyMethods inherited from interface com.sas.services.publish.EntryInterface
getDescription, getNameValuePairs, getURL, isReadOnly, setDescription, setNameValuePairs
-
Constructor Details
-
ResultPackage
public ResultPackage() throws RemoteExceptionCreates a result package.- Throws:
RemoteException- If a network anomaly is encountered.
-
-
Method Details
-
hasInputStream
public Object hasInputStream() throws IllegalStateExceptionDeprecated.this method no longer needed as getInputStream() will return an input stream that can be used in a remote environmentCheck ifgetInputStream(java.lang.Object)will succeed. This method will always returnnull.- Specified by:
hasInputStreamin interfacecom.sas.io.InputStreamProviderInterface- Specified by:
hasInputStreamin interfaceResultPackageInterface- Returns:
Objectnull- Throws:
IllegalStateException- if this result package has already been closed.
-
getInputStream
public InputStream getInputStream(Object streamID) throws IllegalStateException Deprecated.UsegetInputStream()which now supports remote input streams.Gets the input stream for this result package. This method will always returnnulland is only present becuase this class implementsResultPackageInterfacewhich extendsRemoteInputStreamInterfacewhich defines it.- Specified by:
getInputStreamin interfacecom.sas.io.InputStreamProviderInterface- Specified by:
getInputStreamin interfaceResultPackageInterface- Parameters:
streamID- The stream description should benull; it will be ignored.- Returns:
null- Throws:
IllegalStateException- if this result package has already been closed.
-
getInputStream
public InputStream getInputStream() throws IllegalStateExceptionGets the input stream for this result package. This method will always returnnulland is only present because this class implementsResultPackageInterfacewhich extendsRemoteInputStreamInterfacewhich defines it.- Specified by:
getInputStreamin interfaceResultPackageInterface- Returns:
null- Throws:
IllegalStateException- if this result package has already been closed.
-
getRemoteInputStream
public com.sas.io.RemoteInputStreamInterface getRemoteInputStream(Object streamID) throws IOException, RemoteException, IllegalStateException Deprecated.UsegetInputStream()which now supports remote input streams.Gets the remote input stream for this result package. This method will always returnnulland is only present becuase this class implementsResultPackageInterfacewhich extendsRemoteInputStreamInterfacewhich defines it.- Specified by:
getRemoteInputStreamin interfacecom.sas.io.InputStreamProviderInterface- Specified by:
getRemoteInputStreamin interfaceResultPackageInterface- Parameters:
streamID- The stream description should benull; it will be ignored.- Returns:
null- Throws:
IllegalStateException- if this result package has already been closed.IOException- If an error occurs constructing the remote input stream.RemoteException- If a network anomaly is encountered.
-
getAbstract
public String getAbstract() throws RemoteException, IllegalStateExceptionReturns the abstract of the result package.- Specified by:
getAbstractin interfaceResultPackageInterface- Returns:
ObjectThe abstract of the result package; can be null.- Throws:
RemoteException- If a network anomaly is encountered.IllegalStateException- if this result package has already been closed.
-
setAbstract
public void setAbstract(String pkgAbstract) throws RemoteException, IllegalStateException Set the abstract for the result package.- Specified by:
setAbstractin interfaceResultPackageInterface- Parameters:
pkgAbstract- Plain text that is the abstract for this result package.- Throws:
IllegalStateException- If the result package is read only or if the result package is already closed.RemoteException- If a network anomaly is encountered.
-
getExpirationDateTime
public long getExpirationDateTime() throws RemoteException, IllegalStateExceptionReturns the expiration datetime stamp.- Specified by:
getExpirationDateTimein interfaceResultPackageInterface- Returns:
longThe expiration datetime stamp for this result package.- Throws:
RemoteException- If a network anomaly is encountered.IllegalStateException- if this result package has already been closed.
-
setExpirationDateTime
public void setExpirationDateTime(long expiration) throws RemoteException, IllegalStateException Set the expiration datetime stamp for the package- Specified by:
setExpirationDateTimein interfaceResultPackageInterface- Parameters:
expiration- The expiration datetime.- Throws:
IllegalStateException- If the result package is read only or if the result package is already closed.RemoteException- If a network anomaly is encountered.
-
getCreationDateTime
public long getCreationDateTime() throws IllegalStateException, RemoteExceptionReturns the creation datetime stamp. Because ResultPackage is used to construct new result packages, this method will cause an IllegalStateException.- Specified by:
getCreationDateTimein interfaceResultPackageInterface- Returns:
longThe creation datetime stamp for this result package.- Throws:
IllegalStateException- if this result package has already been closed.RemoteException- If a network anomaly is encountered.
-
getName
Returns the name for this result package.- Specified by:
getNamein interfaceResultPackageInterface- Returns:
StringThe name of the result package; can be null.- Throws:
IllegalStateException- if this result package has already been closed.TransportException- If the transport encounters an error getting the nested name.RemoteException- If a network anomaly is encountered.
-
setName
public void setName(String name) throws IllegalStateException, RemoteException Set the name for the result package. This name will only be used if the result package is published as a nested package. A result package can be nested by adding it as an entry to another result package. When the nested package is published, a unique nested package name is generated by the transports. This can be overridden by providing the nested name to use.- Specified by:
setNamein interfaceResultPackageInterface- Parameters:
name- The name for this result package; can be null.- Throws:
IllegalStateException- If the result package is read only or the result package is already closed.RemoteException- If a network anomaly is encountered.
-
getEntry
Returns a particular result package entry as indicated by the specified index. Distributed applications should use {#link getEntries} to obtain the array of entries. It is more efficient to obtain the entire entry array in one request, instead of invoking this method to obtain each entry separately.- Specified by:
getEntryin interfaceResultPackageInterface- Parameters:
index- The zero-based index of the desired result package entry.- Returns:
ResultPackageEntryInterfaceThe result package entry.- Throws:
RemoteException- If a network anomaly is encountered.IllegalStateException- if this result package has already been closed.
-
getEntries
Returns an array of all entries in this package. Distributed applications should use this method to obtain the package entries because it is more efficient to get all the entries in one request.- Specified by:
getEntriesin interfaceResultPackageInterface- Returns:
ListAn array of EntryInterface objects.- Throws:
RemoteException- If a network anomaly is encountered.IllegalStateException- if this result package has already been closed.
-
addEntry
public void addEntry(EntryInterface entry) throws RemoteException, IllegalStateException, IllegalArgumentException Adds a new entry to the result package. The entry will be added to the end of the array of entries. This method will fail if the result package is read only.- Specified by:
addEntryin interfaceResultPackageInterface- Parameters:
entry- The entry to add to the result package.- Throws:
IllegalStateException- If the result package is read only or if the result package has already been closed.IllegalArgumentException- If a library member entry is added to the package. Library member entries cannot be published.RemoteException- If a network anomaly is encountered.
-
isNested
public boolean isNested() throws RemoteException, IllegalStateExceptionReturns true when the result package is a nested package.- Specified by:
isNestedin interfaceResultPackageInterface- Returns:
booleanTrue if the result package is a nested package; otherwise if this is the main package, false is returned.- Throws:
RemoteException- If a network anomaly is encountered.IllegalStateException- if this result package has already been closed.
-
close
Close the result package.- Specified by:
closein interfaceResultPackageInterface- Throws:
IllegalStateException- If the result package has already been closed or if this is a nested package.TransportException- If the transport encounters an error getting the entry.RemoteException- If a network anomaly is encountered.
-
delete
Delete the result package. This method is not supported for nested packages. Because ResultPackage is used to construct new result packages, this method will cause an IllegalStateException.- Specified by:
deletein interfaceResultPackageInterface- Throws:
UnsupportedOperationException- If the operation is not supported by the trasnport.IllegalStateException- If the result package is read only, if this is a nested package, or if this result package has already been closed.TransportException- If the transport encounters an error deleting the package.RemoteException- If a network anomaly is encountered.
-
getEventData
public EventDataInterface getEventData() throws TransportException, RemoteException, IllegalStateExceptionReturns the event data. This includes the SASPackage XML event that describes this result package, as well as the event persistence information. See SASPackage Event Usage for more details.- Specified by:
getEventDatain interfaceResultPackageInterface- Returns:
EventDataInterfaceThe event data which includes the SASPackage event body, and the event persistence information.- Throws:
TransportException- If the transport encounters an error getting the nested name.RemoteException- If a network anomaly is encountered.IllegalStateException- if this result package has already been closed.
-
getEntry
public EntryInterface getEntry(String uniqueId) throws IllegalStateException, RemoteException, TransportException Returns the result package entry identified by the entity key.- Specified by:
getEntryin interfaceResultPackageInterface- Parameters:
uniqueId- The unique identifier of the desired result package entry.- Returns:
EntryInterfaceThe result package entry. This may benullif no entry is found with the specified identifier.- Throws:
IllegalStateException- if this result package has already been closed.TransportException- If the transport encounters an error getting the entry.RemoteException- If a network anomaly is encountered.
-
getInputStream()which now supports remote input streams.