Org.eclipse.higgins.idas.client

From Eclipsepedia

Jump to: navigation, search

Higgins logo 76Wx100H.jpg

This page describes the higgins.idas.client component (IdAS Client), which is the client-side counterpart to the IdAS Proxy. Its purpose is to make available the full functionality of the IdAS Package (including the IdAS API, the UDI Resolver and a set of Context Providers) to a thin client which cannot all run these components by itself.

The basic concept is that the IdAS Client exposes the APIs of the IdAS Package, but instead of executing IdAS operations by itself, it forwards those operations to the IdAS Proxy running on a server.

The IdAS Client uses the XDI Context Provider for talking to the Attribute Service, which is dynamically instantiated by the IdAS Proxy.

Contents

Javadoc

Service

XDI Messages are used by a client to communicate both with the IdAS Proxy and the Attribute Service. Please refer to the pages of those components for more details.

Example Use

The following example code demonstrates how the IdAS Client can resolve a UDI and read attribute values from an LDAP Context with the help of the IdAS Proxy:

IdASClient client = IdASClient.getInstance();
client.setIdasProxyEndpoint("http://localhost:7080/org.eclipse.higgins.idas.proxy/");

IEntity entity = client.resolveEntity("=udidemo*contexts/(+ldap)//uid%3Dsaba,dc%3Dparityinc,dc%3Dnet", "urn:udi:authnmaterials:1.0:usernamePassword", "cn%3DManager%2Cdc%3Dparityinc%2Cdc%3Dnet oep72eh14");
Iterator attributes = entity.getAttributes();
while (attributes.hasNext()) {

	IAttribute attribute = (IAttribute) attributes.next();
	System.out.println(attribute.getAttrID().toString());
	Iterator values = attribute.getValues();
	while (values.hasNext()) {

		IAttributeValue value = (IAttributeValue) values.next();
		if (value instanceof ISimpleAttrValue) {

			System.out.println("  " + ((ISimpleAttrValue) value).getData());

			if (((ISimpleAttrValue) value).getData().equals("Old Value")) {

				((ISimpleAttrValue) value).setData("New Value");
				entity.getContext().applyUpdates();
			}
		} else {

			System.out.println("  " + "(complex value");
		}
	}
}

See Also