background image

Managing Registry Data

<< Finding Services and Service Bindings | Complex data item >>
<< Finding Services and Service Bindings | Complex data item >>
186
J
AVA
API
FOR
XML R
EGISTRIES
Managing Registry Data
If a client has authorization to do so, it can submit data to a registry, modify it,
and remove it. It uses the
BusinessLifeCycleManager
interface to perform
these tasks.
Registries usually allow a client to modify or remove data only if the data is
being modified or removed by the same user who first submitted the data.
Managing registry data involves the following tasks:
· Getting authorization from the registry
· Creating an organization
· Adding classifications
· Adding services and service bindings to an organization
· Publishing an organization
· Publishing a specification concept
· Removing data from the registry
Getting Authorization from the Registry
Before it can submit data, the client must send its user name and password to the
registry in a set of credentials. The following code fragment shows how to do
this.
String username = "testuser";
String password = "testuser";
// Get authorization from the registry
PasswordAuthentication passwdAuth =
new PasswordAuthentication(username,
password.toCharArray());
HashSet<PasswordAuthentication> creds =
new HashSet<PasswordAuthentication>();
creds.add(passwdAuth);
connection.setCredentials(creds);
Creating an Organization
The client creates the organization and populates it with data before publishing
it.