You can programmatically modify an existing endpoint by
using the LiveCycle Java API. By modifying an endpoint,
you can change the behaviour of the endpoint. Consider, for example,
a Watched Folder endpoint that specifies a folder that is used as
the watched folder. You can programmatically modify configuration
values that belong to the Watched Folder endpoint, resulting in another
folder functioning as the watched folder. For information about
configuration values that belong to a Watched Folder endpoint, see Adding Watched Folder Endpoints.
To demonstrate how to modify an endpoint, this section modifies
a Watched Folder endpoint by changing the folder that behaves as
the watched folder.
注意: You cannot modify an endpoint by using web services.
Summary of stepsTo modify an endpoint, perform the following tasks:
Include project files.
Create an EndpointRegistryClient object.
Retrieve the endpoint.
Specify new configuration values.
Include project filesInclude the necessary files in your development
project. If you are creating a client application by using Java,
include the necessary JAR files. If you are using web services,
make sure that you include the proxy files.
The following
JAR files must be added to your project’s class path:
adobe-livecycle-client.jar
adobe-usermanager-client.jar
adobe-utilities.jar (required if LiveCycle is deployed
on JBoss Application Server)
jbossall-client.jar (required if LiveCycle is deployed
on JBoss Application Server)
For information about
the location of these JAR files, see Including LiveCycle Java library files.
Create an EndpointRegistry Client objectTo programmatically
modify an endpoint, you must create an EndpointRegistryClient object.
Retrieve the endpoint to modifyBefore you can modify an endpoint,
you must retrieve it. To retrieve an endpoint, you must connect
as a user who can access an endpoint. It is recommended that you
connect as an administrator. (See Setting connection properties).
You can retrieve an endpoint
by retrieving a list of endpoints. You can then iterate through
the list, searching for the specific endpoint to remove. For example,
you can locate an endpoint by determining the service that corresponds
to the endpoint and the type of endpoint. When you locate the endpoint,
you can modify it.
Specify new configuration valuesWhen modifying an endpoint, specify
new configuration values. For example, to modify a Watched Folder
endpoint, reset all Watched Folder endpoint configuration values,
not just the ones that you want to modify. For information about configuration
values that belong to a Watched Folder endpoint, see Adding Watched Folder Endpoints.
重要: You cannot
modify the service that is invoked by the endpoint. If you attempt
to modify the service, an exception is thrown. To modify the service associated
with a given endpoint, remove the endpoint and create a new one.
(See Removing Endpoints.)
Modifying an endpoint using the Java APIModify an endpoint by using the Java API:
Include project files.
Include client JAR files,
such as adobe-livecycle-client.jar, in your Java project’s class
path.
Create an EndpointRegistry Client object.
Retrieve the endpoint to modify.
Retrieve
a list of all endpoints to which the current user (specified in
the connection properties) can access by invoking the EndpointRegistryClient object’s getEndpoints method
and passing a PagingFilter object that acts as
a filter. You can pass a (PagingFilter)null value
to return all endpoints. This method returns a java.util.List object
where each element is an Endpoint object. For information
about a PagingFilter object, see LiveCycle API Reference.
Iterate through the java.util.List object
to determine whether it has endpoints. If endpoints exist, each
element is an EndPoint instance.
Determine the service that corresponds to an endpoint by
invoking the EndPoint object’s getServiceId method.
This method returns a string value that specifies the service name.
Determine the type of endpoint by invoking the EndPoint object’s getConnectorId method.
This method returns a string value that specifies the type of endpoint.
For example, if the endpoint is a Watched Folder endpoint, this
method returns WatchedFolder.
Specify new configuration values.
Create a ModifyEndpointInfo object
by invoking its constructor.
For each configuration value to set, invoke the ModifyEndpointInfo object’s setConfigParameterAsText method.
For example, to set the url configuration value, invoke the ModifyEndpointInfo object’s setConfigParameterAsText method
and pass the following values:
A string value that
specifies the name of the configuration value. For example, to set
the url configuration value, specify url.
A string value that specifies the value of the configuration
value. To define a value for the url configuration
value, specify the watched folder location.
Invoke the EndpointRegistryClient object’s modifyEndpoint method
and pass the ModifyEndpointInfo object.
|
|
|