org.openspml.client
Class LighthouseClient

java.lang.Object
  |
  +--org.openspml.client.SpmlClient
        |
        +--org.openspml.client.LighthouseClient

public class LighthouseClient
extends SpmlClient

A class that wraps a SpmlClient instance to provide a more Lighthouse-specific interface. All requests made using this client are ultimately implemented with SPML requests.

Note that authentication is currently out of scope in the SPML specification, but all vendors will ultimately require some form of authentication. In this implementation, it is requried that the client make an SPML extended request to login to the lighthouse. Credentials are passed as attributes of the extended requst. Once authenticated, a session token is returned as an operational attribute of the login response. This token must be included as an operational attribute of all subsequent SPML requests. Management of the session token is handled automatically by LighthouseClient.


Constructor Summary
LighthouseClient()
          Construct a new lighthouse client.
 
Method Summary
 void createUser(java.lang.String accountId, java.util.Map attributes)
          Create a new Lighthouse user, with attributes specified in a Map.
 void deleteUser(java.lang.String accountId, java.util.List targets)
          Delete the Lighthouse user and deprovision all associated resource accounts.
 java.util.Map getUser(java.lang.String accountId)
          Return the attriutes of a Lighthouse user as a Map.
 void login()
          Login to the Lighthouse server.
 void logout()
          Logout of the Lighthouse server.
 SpmlResponse request(SpmlRequest req)
          Overload this to ensure a login before proceeding.
 void setPassword(java.lang.String s)
          Set the password to use when authenticating to the Lighthouse server.
 void setUser(java.lang.String s)
          Set the name of a Lighthouse user to use when authenticating to the Lighthouse server.
 void updateUser(java.lang.String accountId, java.util.Map modifications)
          Update the attributes of a user.
 
Methods inherited from class org.openspml.client.SpmlClient
batchRequest, extendedRequest, println, searchRequest, setAction, setBodyAttributes, setHeader, setMonitor, setTrace, setUrl, setUrl, throwErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LighthouseClient

public LighthouseClient()
Construct a new lighthouse client. Before calling the request methods, the host, port, user, and password fields must be specified.
Method Detail

setUser

public void setUser(java.lang.String s)
Set the name of a Lighthouse user to use when authenticating to the Lighthouse server.

setPassword

public void setPassword(java.lang.String s)
Set the password to use when authenticating to the Lighthouse server.

login

public void login()
           throws SpmlException
Login to the Lighthouse server.

logout

public void logout()
            throws SpmlException
Logout of the Lighthouse server.

request

public SpmlResponse request(SpmlRequest req)
                     throws SpmlException
Overload this to ensure a login before proceeding.
Overrides:
request in class SpmlClient

getUser

public java.util.Map getUser(java.lang.String accountId)
                      throws SpmlException
Return the attriutes of a Lighthouse user as a Map.

This is implemented using an SPML , expecting a single and converting the list of s into a Map.


deleteUser

public void deleteUser(java.lang.String accountId,
                       java.util.List targets)
                throws SpmlException
Delete the Lighthouse user and deprovision all associated resource accounts. If the "targets" list is passed, we will only deprovision those accounts on the list. If targets is non-null, the Lighthouse account is deleted only if the name "Lighthouse" appears on the list.

This is implemented as an SPML passing the target list as an operational attribute.


createUser

public void createUser(java.lang.String accountId,
                       java.util.Map attributes)
                throws SpmlException
Create a new Lighthouse user, with attributes specified in a Map.

This is implemented as an SPML .


updateUser

public void updateUser(java.lang.String accountId,
                       java.util.Map modifications)
                throws SpmlException
Update the attributes of a user. The attributes to be modified are passed in a Map. The current values are replaced.