### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.discovery

# Class IsRemotelyAccessibleAttribute

java.lang.Object
com.sas.services.AbstractServiceAttribute
com.sas.services.discovery.IsRemotelyAccessibleAttribute

All Implemented Interfaces:
  `ServiceAttributeInterface`, `Serializable`

@SASScope("ALL") @BinaryCompatibilityOnly public final class IsRemotelyAccessibleAttribute extends AbstractServiceAttribute
A foundation service discovery attribute which may be used to locate a service based on whether or not it can be accessed by remote clients.

When a service is deployed, an `IsRemotelyAccessibleAttribute` will be added to its service discovery configuration. This will enable one to find a service based on its remotely accessibility configuration.

A foundation service is represented in a SAS Metadata Repository as a `ServiceComponent` metadata element. This element has an associated `Property` whose `PropertyName` attribute is "isRemotelyAccessible". This service lookup attribute represents this property setting.

The Foundation Services Manager plug-in to the SAS Management Console provides the capability to view/edit this property for a foundation service.

## Examples

Examples are provided to find a service that is:

- accessible to remote clients
- not accessible to remote clients

## Example 1: Find a service that is accessible to remote clients

To find a service that is accessible to remote clients, define a service template that specifies one or more interfaces that the desired service must implement and a `IsRemotelyAccessibleAttribute` initialized to Boolean.TRUE.

The following example shows how to define a service template that can be used to discover a foundation Authentication service that is accessible to remote clients.

     import com.sas.services.discovery.DiscoveryService;
     import com.sas.services.discovery.IsRemotelyAccessibleAttribute;
     import com.sas.services.discovery.ServiceAttributeInterface;
     import com.sas.services.discovery.ServiceTemplate;
     import com.sas.services.security.AuthenticationServiceInterface;

     ...

     // specify the desired service type(s)
     Class[] desiredServiceTypes = new Class[] {
        AuthenticationServiceInterface.class};

     // specify the optional attributes to be used to qualify a discovery lookup
     // to include only those services which are accessible to remote clients
     ServiceAttributeInterface[] serviceAttributes =
        new ServiceAttributeInterface[] {
           new IsRemotelyAccessibleAttribute(
              Boolean.TRUE)}; // is accessible to remote clients

     // create a service lookup template specifying the required
     // service interface(s) and a service attribute for a
     // service that is accessible to remote clients
     ServiceTemplate serviceTemplate = new ServiceTemplate(
        desiredServiceTypes,
        serviceAttributes);

     // discover a service satisfying the service template
     AuthenticationServiceInterface authenticationService = (AuthenticationServiceInterface)
        DiscoveryService.defaultInstance().findService(serviceTemplate);

## Example 2: Find a service that is not accessible to remote clients

To find a service that is not accessible to remote clients, define a service template that specifies one or more interfaces that the desired service must implement and a `IsRemotelyAccessibleAttribute` initialized to Boolean.FALSE.

The following example shows how to define a service template that can be used to discover a foundation Authentication service that is not accessible to remote clients.

     import com.sas.services.discovery.DiscoveryService;
     import com.sas.services.discovery.IsRemotelyAccessibleAttribute;
     import com.sas.services.discovery.ServiceAttributeInterface;
     import com.sas.services.discovery.ServiceTemplate;
     import com.sas.services.security.AuthenticationServiceInterface;

     ...

     // specify the desired service type(s)
     final Class[] desiredServiceTypes = new Class[] {
        AuthenticationServiceInterface.class};

     // specify the optional attributes to be used to qualify a discovery lookup
     // to include only those services which are not accessible to remote clients
     final ServiceAttributeInterface[] serviceAttributes =
        new ServiceAttributeInterface[] {
           new IsRemotelyAccessibleAttribute(
              Boolean.FALSE)}; // not accessible to remote clients

     // create a service lookup template specifying the required
     // service interface(s) and a service attribute for a
     // service that is not accessible to remote clients
     final ServiceTemplate serviceTemplate = new ServiceTemplate(
        desiredServiceTypes,
        serviceAttributes);

     // discover a service satisfying the service template
     final AuthenticationServiceInterface authenticationService = (AuthenticationServiceInterface)
        DiscoveryService.defaultInstance().findService(serviceTemplate);

Since:
  1.1
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `Boolean`
  `isRemotelyAccessible`
  An ID associated with a service.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IsRemotelyAccessibleAttribute()`
  Constructs a default instance with a `null` indicating that it is unknown whether or not the service is intended to be remotely accessible.
  `IsRemotelyAccessibleAttribute(Boolean attributeIsRemotelyAccessible)`
  Constructs an instance initialized with a flag indicating whether or not the service is intended to be accessed remotely.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<String,String>`
  `getFieldNameToValueMap()`
  Gets a map of this attribute's fields and their values.

  ### Methods inherited from class com.sas.services.AbstractServiceAttribute

  `equals, hashCode, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### isRemotelyAccessible

    public Boolean isRemotelyAccessible
    An ID associated with a service.

- ## Constructor Details

  - ### IsRemotelyAccessibleAttribute

    public IsRemotelyAccessibleAttribute()
    Constructs a default instance with a `null` indicating that it is unknown whether or not the service is intended to be remotely accessible.

  - ### IsRemotelyAccessibleAttribute

    public IsRemotelyAccessibleAttribute(Boolean attributeIsRemotelyAccessible)
    Constructs an instance initialized with a flag indicating whether or not the service is intended to be accessed remotely.
    Parameters:
      `attributeIsRemotelyAccessible` - `Boolean.TRUE` if the service is intended to be accessed remotely, `Boolean.FALSE` if the service is not intended to be accessed remotely. Specify `null` if remote accessibility is a don't care.

- ## Method Details

  - ### getFieldNameToValueMap

    public Map<String,String> getFieldNameToValueMap()
    Gets a map of this attribute's fields and their values.
    - isRemotelyAccessible - whether or not the service is configured to be accessed by clients in remote JVMs
    Overrides:
      `getFieldNameToValueMap` in class `AbstractServiceAttribute`
    Returns:
      Map keyed by the `String` names of a field to their values.