|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DAVTransportInterface
The DAVTransportInterface provides a mechanism for publishing a result package to a WebDAV server, and for retrieving a result package from a WebDAV server.
WebDAV (Web-based Distributed Authoring and Versioning) is an emerging industry standard that is based on extensions to HTTP 1.1 that enables collaborative development of files and collections of files on remote Web servers. WebDAV is documented in RFC2518. Visit the WebDAV site for more information.
By default, when a result package is published to a WebDAV server, the
result package is published as a set of loose files. This default
behavior can be overridden by using the asArchive(boolean)
method.
If set to true
, the result package will be published
to the WebDAV server as an archive (.spk file).
See
WebDAV Publish as Archive Example for an example of publishing
an archive to a WebDAV server.
The WebDAV transport also supports the retrieval of these binary result packages from a WebDAV server. See WebDAV Retrieve Archive Example for an example of retrieving an archive from a WebDAV server.
Namespaces can be defined on the WebDAV transport, using
the setNamespaces(java.util.Map)
method. The namespace is specified as a map.
The key identifies the prefix and the value identifies the namespace URI.
The WebDAV transport supports namespaces when publishing or retrieving a result package. Namespaces are unique names that associate published packages with specific contexts on a WebDAV-compliant server. The association of a namespace with a package organizes package data on a server according to meaningful criteria, or contexts. A namespace is an additional scoping criterion for a name/value description of a package or package entry.
If namespaces are set on the WebDAV delivery transport that is used to publish a result package, the namespace name/value descriptors are stored with the result package or its entries to the specified WebDAV namespace. As an example, a package might be described as containing first quarter profits that were generated by the Houston office. The specified description and scope uniquely define the package so that consumers can filter name/value pairs on packages or entries unambiguously. An example of a namespace definition follows:
Map m = new HashMap(); m.put("HOUSTON", "http://www.AlphaliteAirways.com/revenue.final");To define specific name/value pairs to the namespace, the name should be preceded by the namespace prefix, and then a colon. For example:
AttributeMapInterface namevalues = new AttributeMap(); namevalues.addAttribute("HOUSTON:type", "quarterlyReport");
See WebDAV Publishing with Namespaces Example for an example of using namespaces when publishing a result package to a WebDAV server.
If namespaces are set on the WebDAV delivery transport that is used to retrieve a result package, the namespaces identify what namespaces that you are interested in returning. Only empty namespaces, and those that match the specified namespaces, will be returned.
As an example, if the calling application is only interested in information containing profit information, I must define the namespaces of interest:
Map m = new HashMap(); m.put("a", "http://www.AlphaliteAirways.com/revenue.final"); m.put("b", "http://www.AlphaliteAirways.com/revenue.first");This identifies two additional namespaces of interests. Only those name/value pairs that match these namespaces, or the emptly namespace, will be returned. Name/value pairs that are defined to one of the namespaces will be identified by prepending the name with the namespace prefix, and then a colon. For example, if the name/value pair, type=quarterlyReport was defined to the "http://www.AlphaliteAirways.com/revenue.final" namespace, its name will be returned as "a:type" and its value will be "quarterlyReport"
See WebDAV Retrieving with Namespaces Example for an example of using namespaces when retrieving a result package from a WebDAV server.
TransportFactory
Field Summary | |
---|---|
static int |
COLLECTION_URL
The URL to which the result package will be published. |
static int |
NOREPLACE
If the collection already exists, do not publish. |
static int |
PARENT_URL
The URL under which the result package will be published. |
static int |
REPLACE
If the collection already exists, replace it by deleting the current collection and its entities first. |
static int |
UPDATE
If the collection already exists, update the existing collection by replacing like-named entities and adding newly named entities. |
static int |
UPDATEANY
If the collection already exists, update the existing collection by replacing like-named entities and adding newly named entities. |
Method Summary | |
---|---|
void |
asArchive(boolean publishAsArchive)
Determines if the package will be published to a collection as a set of loose files or if the package will be published as a binary archive (.spk) file. |
java.lang.String |
getArchiveName()
If publishing the package as an archive to the webDAV server, this identifies the archive filename. |
int |
getCreationMode()
Returns the creation mode. |
java.lang.String |
getDomain()
Returns the authentication domain. |
java.util.Map |
getNamespaces()
Returns the namespaces. |
java.lang.String |
getPassword()
Returns the HTTP password used when binding to the webDAV server. |
java.lang.String |
getProxyURL()
Returns the URL of the proxy server. |
java.lang.String |
getURL()
Returns the collection URL. |
int |
getURLRole()
Returns the role of the URL. |
java.lang.String |
getUserName()
Returns the HTTP user name used when binding to the webDAV server. |
void |
setArchiveName(java.lang.String name)
If publishing the package as an archive to the webDAV server, this identifies the archive filename. |
void |
setCreationMode(int mode)
Sets the creation mode that determines how the package will be published to the WebDAV server. |
void |
setNamespaces(java.util.Map namespaces)
Sets the namespaces to be used when publishing or retrieving a result package or when creating the SASPackage event. |
void |
setPassword(java.lang.String password)
Set the HTTP password to use when binding to the webDAV server. |
void |
setProxyURL(java.lang.String proxyUrl)
Sets the URL of the proxy server to be used when publishing or retrieving a result package using the WebDAV delivery transport. |
void |
setURLRole(int role)
Sets the role of the URL. |
void |
setUserName(java.lang.String userName)
Set the HTTP user name to use when binding to the webDAV server. |
Methods inherited from interface com.sas.services.publish.TransportInterface |
---|
getLogger, getResultPackage, getSessionContext, publishResultPackage, setLogger |
Field Detail |
---|
static final int COLLECTION_URL
static final int PARENT_URL
static final int REPLACE
static final int NOREPLACE
static final int UPDATE
static final int UPDATEANY
Method Detail |
---|
java.lang.String getUserName()
String
The user name explicitly set on the constructor
or on the setUserName(java.lang.String)
method. This username may be null
if not previously set.void setUserName(java.lang.String userName)
userName
- The user name.void setPassword(java.lang.String password)
password
- The password.java.lang.String getPassword()
String
The HTTP password explicitly set on the
constructor or on the setPassword(java.lang.String)
method. This password
may be null
if not previously set.java.lang.String getURL()
String
The collection URL.java.lang.String getDomain()
String
The authentication domain; may be
null
if not previously set.java.util.Map getNamespaces()
Map
The namespaces which map a prefix to
a namespace. The key identifies the prefix to associate with a given namespace URI.
This may be null
.void setNamespaces(java.util.Map namespaces) throws java.lang.IllegalArgumentException
namespaces
- The namespaces. The namespace specification is case-sensitive.
java.lang.IllegalArgumentException
- If an invalid namespace is specified.java.lang.String getProxyURL()
String
The URL of the proxy server. This may be null
.void setProxyURL(java.lang.String proxyUrl)
proxyUrl
- The URL of the proxy server.int getURLRole()
TransportFactory
.
Supported roles include COLLECTION_URL
and PARENT_URL
.
String
The URL of the proxy server.void setURLRole(int role) throws java.lang.IllegalArgumentException
TransportFactory
.
The role defaults to COLLECTION_URL
. This default role
can be overridden by using this method to explicitly set
the role to PARENT_URL
.
The role of the URL is used when the result package is published to a WebDAV server. If a collection role is specified, the URL identifies the name of the result package collection. If a parent role is specified, the URL identifies the collection under which the result package will be published. A unique collection name will be created by the WebDAV transport and the result package will be published to that collection.
If publishing the result package as an archive (by invoking
the asArchive(boolean)
method, the URL role is ignored. The specified URL will always
be used as a parent URL; that is, the archive will be created as a
resource in the specified URL.
When retrieving a result package from a WebDAV server, the role is ignored because the URL must identify the collection that is the result package.
role
- The role of the URL. Supported roles include COLLECTION_URL
and PARENT_URL
.
java.lang.IllegalArgumentException
- If an invalid role is specified.void asArchive(boolean publishAsArchive)
true
on this method. This will
cause the result package to be published as an archive (.spk file)
The name of the archive file can be specified on the
setArchiveName(String)
method. If an archive name is
not specified, a unique name will be generated.
If asArchive is set to true
, the URL role will be ignored.
The specified URL will always
be used as a parent URL; that is, the archive will be created as a
resource in the specified URL.
publishAsArchive
- true
if the package should be
published as an archive file (.spk) to the WebDAV server; false
if the package should be published as loose files.void setArchiveName(java.lang.String name)
name
- The archive filename; this name should not include the .spk
extension.java.lang.String getArchiveName()
String
The archive filename; this may be null
if not previously set using setArchiveName
int getCreationMode()
REPLACE
.
int
The creation mode. Supported modes include
REPLACE
, NOREPLACE
, UPDATE
and UPDATEANY
.void setCreationMode(int mode) throws java.lang.IllegalArgumentException
REPLACE
.
mode
- The creation mode. Supported modes include REPLACE
,
NOREPLACE
, UPDATE
and UPDATEANY
.
java.lang.IllegalArgumentException
- If an invalid mode is specified.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |