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 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.
ServiceDirectory client class. Applications obtain the instance of LookupManager/RegistrationManager/ServiceDirectoryConfig from this class.
 public class ServiceDirectory {

The ServiceDirectory enabled property name, indicating whether ServiceDirectory is enabled for directory service.
     public static final String SD_API_SERVICE_DIRECTORY_ENABLED_PROPERTY = "";

Default is to enable ServiceDirectory for directory service.
     public static final boolean SD_API_SERVICE_DIRECTORY_ENABLED_DEFAULT = true;
     private static final Configuration serviceDirectoryConfig = ConfigurationFactory.getConfiguration();

Singleton, private constructor.
     private ServiceDirectory(){

Get the LookupManager.

the implementation instance of LookupManager.
     public static LookupManager getLookupManager() throws ServiceException {
         return getImpl().getLookupManager();

Get the RegistrationManager.

the implementation instance of RegistrationManager.
     public static RegistrationManager getRegistrationManager() throws ServiceException {
         return getImpl().getRegistrationManager();

Get the ServiceDirectoryConfig.

the ServiceDirectoryConfig
     public static Configuration getServiceDirectoryConfig() {
         return ;

Re-initialize the ServiceDirectoryManagerFactory. It allows applications to change the ServiceDirectoryManagerFactory in the runtime.

factory the ServiceDirectoryManagerFactory which generates LookupManager and RegistrationManager.

Check whether ServiceDirectory is enabled for the directory service. The value comes from the configuration property "". By default the ServiceDirectory is enabled.

true if the ServiceDirectory is enabled.
    public static boolean isEnabled(){

Get the Service Directory API version

the Service Directory API version
    public static String getAPIVersion() {
        return getImpl().getVersion();
Shut down the ServiceDirectory. Be careful to invoke this method. When shutdown() is called, ServiceDirectory cannot be used unless jvm is restarted to reload the ServiceDirectory class.
    public static void shutdown(){

Get the ServiceDirectory implementation.

the ServiceDirectoryImpl instance.
    private static ServiceDirectoryImpl getImpl() {
        return ServiceDirectoryImpl.getInstance();
New to GrepCode? Check out our FAQ X