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

com.sas.services.discovery
Class IsRemotelyAccessibleAttribute

com.sas.services.discovery.IsRemotelyAccessibleAttribute
All Implemented Interfaces:
ServiceAttributeInterface, java.io.Serializable

public final class IsRemotelyAccessibleAttribute

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:

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
 java.lang.Boolean isRemotelyAccessible
          An ID associated with a service.
 
Constructor Summary
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(java.lang.Boolean attributeIsRemotelyAccessible)
          Constructs an instance initialized with a flag indicating whether or not the service is intended to be accessed remotely.
 
Method Summary
 java.util.Map getFieldNameToValueMap()
          Gets a map of this attribute's fields and their values.
 
Methods inherited from class com.sas.services.AbstractServiceAttribute
equals, hashCode, toString
 

Field Detail

isRemotelyAccessible

public java.lang.Boolean isRemotelyAccessible
An ID associated with a service.

Constructor Detail

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(java.lang.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 Detail

getFieldNameToValueMap

public java.util.Map getFieldNameToValueMap()
Gets a map of this attribute's fields and their values.

Overrides:
getFieldNameToValueMap in class AbstractServiceAttribute
Returns:
String summarizing the state of this attribute.

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.