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.registration;
 
 import java.util.Map;
 
 
 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 extends ServiceDirectoryService{

    
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()){
            throw new ServiceException(.);
        }
        registerService(serviceInstance);
    }

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

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

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

Parameters:
serviceName the serviceName of the ProvidedServiceInstance.
providerAddress the providerAddress of the ProvidedServiceInstance.
status the new OperationalStatus of the ProvidedServiceInstance.
    public void updateServiceOperationalStatus(String serviceName,
            String providerAddressOperationalStatus status) {
        getServiceDirectoryClient().updateInstanceStatus(serviceName,
                providerAddressstatus);
    }
    
    

    
Update the metadata attribute of the ProvidedServiceInstance The ProvidedServiceInstance is uniquely identified by serviceName and providerAddress

Parameters:
serviceName the serviceName of the ProvidedServiceInstance.
providerAddress The IP address or FQDN that the instance is running on.
metadata the meta data.
    public void updateServiceMetadata(String serviceNameString providerAddress,
            Map<StringStringmetadata) {
        getServiceDirectoryClient().updateInstanceMetadata(serviceNameproviderAddress,
                metadata);
    }


    
Update the ProvidedServiceInstance.

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

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

Parameters:
serviceName the serviceName of ProvidedServiceInstance.
providerAddress the provierAddress of ProvidedServiceInstance.
    public void unregisterService(String serviceNameString providerAddress) {
        getServiceDirectoryClient().unregisterInstance(serviceNameproviderAddress);
    }

    
Get the DirectoryServiceClient.

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