Lookup/Ibis web service client API
  • Class

Classes

  • GroupMethods
  • IbisAttribute
  • IbisAttributeScheme
  • IbisClientConnection
  • IbisContactPhoneNumber
  • IbisContactRow
  • IbisContactWebPage
  • IbisDto
  • IbisError
  • IbisGroup
  • IbisIdentifier
  • IbisInstitution
  • IbisMethods
  • IbisPerson
  • IbisResult
  • IbisResultParser
  • InstitutionMethods
  • PersonMethods

Interfaces

  • ClientConnection

Exceptions

  • IbisException

Class IbisClientConnection

Default implementation of the ClientConnection interface, to allow methods in the Lookup/Ibis web service API to be invoked.

IbisClientConnection implements ClientConnection
Author: Dean Rasheed (dev-group@ucs.cam.ac.uk)
Located at client/IbisClientConnection.php

Methods summary

public static IbisClientConnection
# createConnection()

Create an IbisClientConnection to the Lookup/Ibis web service API at https://www.lookup.cam.ac.uk/.

Create an IbisClientConnection to the Lookup/Ibis web service API at https://www.lookup.cam.ac.uk/.

The connection is initially anonymous, but this may be changed using IbisClientConnection::setUsername() and IbisClientConnection::setPassword().

Returns

IbisClientConnection
the connection to the Lookup/Ibis server.
public static IbisClientConnection
# createTestConnection()

Create an IbisClientConnection to the Lookup/Ibis test web service API at https://lookup-test.srv.uis.cam.ac.uk/.

Create an IbisClientConnection to the Lookup/Ibis test web service API at https://lookup-test.srv.uis.cam.ac.uk/.

The connection is initially anonymous, but this may be changed using IbisClientConnection::setUsername() and IbisClientConnection::setPassword().

NOTE: This test server is not guaranteed to always be available, and the data in it may be out of sync with the data on the live system.

Returns

IbisClientConnection

the connection to the Lookup/Ibis test server.

public static IbisClientConnection
# createLocalConnection()

Create an IbisClientConnection to a Lookup/Ibis web service API running locally on https://localhost:8443/ibis/.

Create an IbisClientConnection to a Lookup/Ibis web service API running locally on https://localhost:8443/ibis/.

The connection is initially anonymous, but this may be changed using IbisClientConnection::setUsername() and IbisClientConnection::setPassword().

This is intended for testing during development. The local server is assumed to be using self-signed certificates, which will not be checked.

Returns

IbisClientConnection

the connection to a local Lookup/Ibis server.

public
# __construct(string $urlBase, boolean $checkCertificates)

Create a new IbisClientConnection using the specified URL base, which should be something like https://www.lookup.cam.ac.uk/. It is strongly recommended that certificate checking be enabled.

Create a new IbisClientConnection using the specified URL base, which should be something like https://www.lookup.cam.ac.uk/. It is strongly recommended that certificate checking be enabled.

The connection is initially anonymous, but this may be changed using IbisClientConnection::setUsername() and IbisClientConnection::setPassword().

Parameters

$urlBase

The base URL to the Lookup/Ibis web service API.

$checkCertificates

If this is true the server's certificates will be checked. Otherwise, the they will not, and the connection may be insecure.

See

IbisClientConnection::createConnection()
IbisClientConnection::createTestConnection()
public
# setUsername(string $username)

Set the username to use when connecting to the Lookup/Ibis web service. By default connections are anonymous, which gives read-only access. This method enables authentication as a group, using the group's password, which gives read/write access and also access to certain non-public data, based on the group's privileges.

Set the username to use when connecting to the Lookup/Ibis web service. By default connections are anonymous, which gives read-only access. This method enables authentication as a group, using the group's password, which gives read/write access and also access to certain non-public data, based on the group's privileges.

This method may be called at any time, and affects all subsequent access using this connection, but should not affect any other ClientConnection objects.

Parameters

$username

The username to connect as. This should either be "anonymous" (the default) or the name of a group.

Implementation of

ClientConnection::setUsername()
public
# setPassword(string $password)

Set the password to use when connecting to the Lookup/Ibis web service. This is only necessary when connecting as a group, in which case it should be that group's password.

Set the password to use when connecting to the Lookup/Ibis web service. This is only necessary when connecting as a group, in which case it should be that group's password.

Parameters

$password
The group password.

Implementation of

ClientConnection::setPassword()
public IbisResult
# invokeGetMethod(string $path, string[] $pathParams, array $queryParams)

Invoke a web service GET method.

Invoke a web service GET method.

The path should be the relative path to the method with standard Java/PHP format specifiers for any path parameters, for example "api/v1/person/%1$s/%2$s". Any path parameters specified are then substituted into the path according to the standard Java formatting rules.

Parameters

$path
The path to the method to invoke.
$pathParams

Any path parameters that should be inserted into the path in place of any format specifiers.

$queryParams

Any query parameters to add as part of the URL's query string.

Returns

IbisResult
The result of invoking the method.

Implementation of

ClientConnection::invokeGetMethod()
public IbisResult
# invokeMethod(string $method, string $path, string[] $pathParams, array $queryParams, array $formParams = null)

Invoke a web service GET, POST, PUT or DELETE method.

Invoke a web service GET, POST, PUT or DELETE method.

The path should be the relative path to the method with standard Java/PHP format specifiers for any path parameters, for example "api/v1/person/%1$s/%2$s". Any path parameters specified are then substituted into the path according to the standard Java formatting rules.

Parameters

$method

The method type ("GET", "POST", "PUT" or "DELETE").

$path
The path to the method to invoke.
$pathParams

Any path parameters that should be inserted into the path in place of any format specifiers.

$queryParams

Any query parameters to add as part of the URL's query string.

$formParams
Any form parameters to submit.

Returns

IbisResult
The result of invoking the method.

Implementation of

ClientConnection::invokeMethod()
Lookup/Ibis web service client API documentation generated by ApiGen