*** This class provides Binary Compatibility only, not Source Compatibility ***
Class IsRemotelyAccessibleAttribute
- All Implemented Interfaces:
ServiceAttributeInterface,Serializable
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 aIsRemotelyAccessibleAttribute 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 aIsRemotelyAccessibleAttribute 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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a default instance with anullindicating 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 TypeMethodDescriptionMap<String, String> Gets a map of this attribute's fields and their values.Methods inherited from class com.sas.services.AbstractServiceAttribute
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Field Details
-
isRemotelyAccessible
public Boolean isRemotelyAccessibleAn ID associated with a service.
-
-
Constructor Details
-
IsRemotelyAccessibleAttribute
public IsRemotelyAccessibleAttribute()Constructs a default instance with anullindicating 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.TRUEif the service is intended to be accessed remotely,Boolean.FALSEif the service is not intended to be accessed remotely. Specifynullif 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:
getFieldNameToValueMapin classAbstractServiceAttribute- Returns:
- Map keyed by the
Stringnames of a field to their values.
-