org.openliberty.wsc
Class DiscoveryService

java.lang.Object
  extended by org.openliberty.wsc.BaseServiceClient
      extended by org.openliberty.wsc.DiscoveryService

public class DiscoveryService
extends BaseServiceClient

This class bootstraps into the WSF environment using an AuthenticationService to retrieve a Discovery Service Endpoint Reference, utilizing SASL

Author:
asa

Nested Class Summary
static class DiscoveryService.WSFServiceType
          An enumeration of services currently supported by the client library
 
Field Summary
static java.lang.String DISCO_QUERY
          The urn indicating the default DS Action
private static java.lang.String IDWSF_20_AUTHENTICATION_SERVICE_URN
           
private static java.lang.String IDWSF_20_DISCOVERY_SERVICE_URN
           
private static java.lang.String IDWSF_20_ID_SIS_DAP_SERVICE_URN
           
private static java.lang.String IDWSF_20_PEOPLE_SERVICE_URN
           
private static java.lang.String IDWSF_20_PERSONAL_PROFILE_SERVICE_URN
          Service Types, used by the WSFService enum
protected static org.apache.log4j.Logger log
           
private  java.util.List<RequestedService> requestedServices
          stores requested services for discovery
 
Constructor Summary
DiscoveryService(DiscoveryService discoveryService, EndpointReference initialEndpointReference)
          
DiscoveryService(EndpointReference initialEndpointReference)
          The discovery service EPR is not necessarily supplied by a Discovery Service, therefore a constructor with only an EPR is provided.
 
Method Summary
 void addARequestedService(RequestedService requestedService)
          Allows the ClientLib User to add a requested service to the upcoming request
static void addProviderIDsToRequestedService(java.lang.String[] providerIDs, RequestedService requestedService)
          Utility Method to add ProviderID objects to an existing RequestedService
static void addSecurityMechIDsToRequestedService(java.lang.String[] securityMechIDs, RequestedService requestedService)
          Utility Method to add SecurityMechID objects to an existing RequestedService
static void addServiceTypesToRequestedService(java.lang.String[] serviceTypes, RequestedService requestedService)
          Utility Method to add ServiceType objects to an existing RequestedService
static RequestedService baseRequestedService()
          Creates a base RequestedService, used by the other Factory methods
static java.util.List<EndpointReference> eprsFromDiscoResponse(WSFMessage message)
          Utility method to extract the EndpointReferences from the WSFMessage response.
 java.util.List<EndpointReference> invoke()
          This method creates a disco request from the specified EndpointReference generating a ServiceRequest for each ServiceType specified
static RequestedService requestedServiceForProviderIDs(java.lang.String[] providerIDs)
          Factory method that creates a RequestedService and adds the specified providerIDs
static RequestedService requestedServiceForSecurityMechIDs(java.lang.String[] securityMechIDs)
          Factory method that creates a RequestedService and adds the specified SecurityMechIDs
static RequestedService requestedServiceForServiceTypes(java.lang.String[] serviceTypes)
          Factory method that creates a RequestedService and add the specified service types
 BaseServiceClient serviceClientForTypeAndEndpointReference(DiscoveryService.WSFServiceType serviceType, EndpointReference endpointReference)
          Convenience method that returns a Service Client that is supported and enumerated by the ClientLibrary, from this discovery service
static BaseServiceClient serviceClientForTypeAndEndpointReference(DiscoveryService discoveryService, DiscoveryService.WSFServiceType serviceType, EndpointReference endpointReference)
          Convenience method that returns a Service Client that is supported and enumerated by the ClientLibrary
 
Methods inherited from class org.openliberty.wsc.BaseServiceClient
getDiscoveryService, getServiceEndpointReference, getServiceEndpointReferenceStore, isSigningOutgoingMessages, replaceServiceEndpointReference, serviceExplicitlySupportsOption, setDiscoveryService, setServiceEndpointReference, setSigningOutgoingMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log

IDWSF_20_PERSONAL_PROFILE_SERVICE_URN

private static final java.lang.String IDWSF_20_PERSONAL_PROFILE_SERVICE_URN
Service Types, used by the WSFService enum

See Also:
Constant Field Values

IDWSF_20_PEOPLE_SERVICE_URN

private static final java.lang.String IDWSF_20_PEOPLE_SERVICE_URN
See Also:
Constant Field Values

IDWSF_20_AUTHENTICATION_SERVICE_URN

private static final java.lang.String IDWSF_20_AUTHENTICATION_SERVICE_URN
See Also:
Constant Field Values

IDWSF_20_DISCOVERY_SERVICE_URN

private static final java.lang.String IDWSF_20_DISCOVERY_SERVICE_URN
See Also:
Constant Field Values

IDWSF_20_ID_SIS_DAP_SERVICE_URN

private static final java.lang.String IDWSF_20_ID_SIS_DAP_SERVICE_URN
See Also:
Constant Field Values

DISCO_QUERY

public static final java.lang.String DISCO_QUERY
The urn indicating the default DS Action

See Also:
Constant Field Values

requestedServices

private java.util.List<RequestedService> requestedServices
stores requested services for discovery

Constructor Detail

DiscoveryService

public DiscoveryService(EndpointReference initialEndpointReference)
The discovery service EPR is not necessarily supplied by a Discovery Service, therefore a constructor with only an EPR is provided.

Parameters:
initialEndpointReference -

DiscoveryService

public DiscoveryService(DiscoveryService discoveryService,
                        EndpointReference initialEndpointReference)

Method Detail

requestedServiceForServiceTypes

public static RequestedService requestedServiceForServiceTypes(java.lang.String[] serviceTypes)
Factory method that creates a RequestedService and add the specified service types

Returns:

addServiceTypesToRequestedService

public static void addServiceTypesToRequestedService(java.lang.String[] serviceTypes,
                                                     RequestedService requestedService)
Utility Method to add ServiceType objects to an existing RequestedService

Parameters:
requestedService -
providerIDs -

requestedServiceForProviderIDs

public static RequestedService requestedServiceForProviderIDs(java.lang.String[] providerIDs)
Factory method that creates a RequestedService and adds the specified providerIDs

Parameters:
providerIDs -
Returns:

addProviderIDsToRequestedService

public static void addProviderIDsToRequestedService(java.lang.String[] providerIDs,
                                                    RequestedService requestedService)
Utility Method to add ProviderID objects to an existing RequestedService

Parameters:
requestedService -
providerIDs -

requestedServiceForSecurityMechIDs

public static RequestedService requestedServiceForSecurityMechIDs(java.lang.String[] securityMechIDs)
Factory method that creates a RequestedService and adds the specified SecurityMechIDs

Parameters:
providerIDs -
Returns:

addSecurityMechIDsToRequestedService

public static void addSecurityMechIDsToRequestedService(java.lang.String[] securityMechIDs,
                                                        RequestedService requestedService)
Utility Method to add SecurityMechID objects to an existing RequestedService

Parameters:
requestedService -
securityMechIDs -

baseRequestedService

public static RequestedService baseRequestedService()
Creates a base RequestedService, used by the other Factory methods

At the moment only Version 2.0 is supported and therefore it is enforced in this method which specifies the 2.0 framework.

Returns:

addARequestedService

public void addARequestedService(RequestedService requestedService)
Allows the ClientLib User to add a requested service to the upcoming request

Parameters:
requestedService -

invoke

public java.util.List<EndpointReference> invoke()
This method creates a disco request from the specified EndpointReference generating a ServiceRequest for each ServiceType specified

Parameters:
epr -
serviceTypes -
Returns:

eprsFromDiscoResponse

public static java.util.List<EndpointReference> eprsFromDiscoResponse(WSFMessage message)
Utility method to extract the EndpointReferences from the WSFMessage response.

Parameters:
message -
Returns:
a List of EndpointReference objects, or null if there are none

serviceClientForTypeAndEndpointReference

public BaseServiceClient serviceClientForTypeAndEndpointReference(DiscoveryService.WSFServiceType serviceType,
                                                                  EndpointReference endpointReference)
Convenience method that returns a Service Client that is supported and enumerated by the ClientLibrary, from this discovery service

Parameters:
serviceType -
endpointReference -
Returns:

serviceClientForTypeAndEndpointReference

public static BaseServiceClient serviceClientForTypeAndEndpointReference(DiscoveryService discoveryService,
                                                                         DiscoveryService.WSFServiceType serviceType,
                                                                         EndpointReference endpointReference)
Convenience method that returns a Service Client that is supported and enumerated by the ClientLibrary

Parameters:
discoveryService -
serviceType -
endpointReference -
Returns: