Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2014 Cisco Systems, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 
 
 
 package com.cisco.oss.foundation.directory.impl;
 
 
 import static com.cisco.oss.foundation.directory.ServiceDirectory.getServiceDirectoryConfig;

It is the Directory Registration Service to perform the ServiceInstance registration. It registers ServiceInstance to Directory Server.
 
 public class DirectoryRegistrationService {

    
The property to disable the ILLEGAL_SERVICE_INSTANCE_OWNER_ERROR error in the Directory tool.
 
     public static final String SD_API_REGISTRY_DISABLE_OWNER_ERROR_PROPERTY_NAME = "com.cisco.oss.foundation.directory.registry.disable.owner.error";

    
Default to disable ILLEGAL_SERVICE_INSTANCE_OWNER_ERROR.
 
     public static final boolean SD_API_REGISTRY_DISABLE_OWNER_ERROR_DEFAULT = false;

    
The remote ServiceDirectory client.
 
 
     private boolean disableOwnerError = false;

    
Constructor.

Parameters:
directoryServiceClient DirectoryServiceClientManager to get DirectoryServiceClient.
 
             DirectoryServiceClient directoryServiceClient) {
         this. = directoryServiceClient;
                 );
     }

    
Register a ProvidedServiceInstance.

Parameters:
serviceInstance the ProvidedServiceInstance.
 
     public void registerService(ProvidedServiceInstance serviceInstance) {
         getServiceDirectoryClient().registerInstance(serviceInstance);
     }

    
Register a ProvidedServiceInstance with the OperationalStatus.

Parameters:
serviceInstance the ProvidedServiceInstance.
status the OperationalStatus of the ProvidedServiceInstance.
 
     public void registerService(ProvidedServiceInstance serviceInstance,
             OperationalStatus status) {
 
         serviceInstance.setStatus(status);
         registerService(serviceInstance);
     }

    
Register a ProvidedServiceInstance with the ServiceInstanceHealth callback.

Parameters:
serviceInstance the ProvidedServiceInstance.
registryHealth the ServiceInstanceHealth callback.
    public void registerService(ProvidedServiceInstance serviceInstanceServiceInstanceHealth registryHealth) {
        // Monitor disabled ProvidedServiceInstance should not have the ServiceInstanceHealth.
        if(serviceInstance.isMonitorEnabled()== false){
            throw new ServiceException(.);
        }
        registerService(serviceInstance);
    }

    
Update the uri attribute of the ProvidedServiceInstance The ProvidedServiceInstance is uniquely identified by serviceName and providerId

Parameters:
serviceName the serviceName of the ProvidedServiceInstance.
providerId the providerId of the ProvidedServiceInstance.
uri the new uri.
    public void updateServiceUri(String serviceNameString providerId,
            String uri) {
        getServiceDirectoryClient().updateInstanceUri(serviceNameproviderId,
                uri);
    }

    
Update the OperationalStatus of the ProvidedServiceInstance The ProvidedServiceInstance is uniquely identified by serviceName and providerId

Parameters:
serviceName the serviceName of the ProvidedServiceInstance.
providerId the providerId of the ProvidedServiceInstance.
status the new OperationalStatus of the ProvidedServiceInstance.
    public void updateServiceOperationalStatus(String serviceName,
            String providerIdOperationalStatus status) {
        getServiceDirectoryClient().updateInstanceStatus(serviceName,
                providerIdstatus);
    }

    
Update the ProvidedServiceInstance.

Parameters:
serviceInstance the ProvidedServiceInstance.
    public void updateService(ProvidedServiceInstance serviceInstance) {
        getServiceDirectoryClient().updateInstance(serviceInstance);
    }

    
Unregister a ProvidedServiceInstance The ProvidedServiceInstance is uniquely identified by serviceName and providerId

Parameters:
serviceName the serviceName of ProvidedServiceInstance.
providerId the provierId of ProvidedServiceInstance.
    public void unregisterService(String serviceNameString providerId) {
        getServiceDirectoryClient().unregisterInstance(serviceNameproviderId);
    }

    
Get the DirectoryServiceClient.

Returns:
the DirectoryServiceClient to access remote directory server.
        return this.;
    }
New to GrepCode? Check out our FAQ X