com.neeve.discovery
Class DiscoveryProviderDescriptor

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.discovery.DiscoveryObject
          extended by com.neeve.discovery.DiscoveryProviderDescriptor

public final class DiscoveryProviderDescriptor
extends DiscoveryObject

An entity discovery provider descriptor.

This class contains information to describe an entity discovery provider. It contains methods to persist and load discovery provider descriptors to/from X Platform configuration respositories.

Threading:
This class is safe for concurrent access by multiple threads.

Method Summary
static DiscoveryProviderDescriptor create(String name, String className)
          Create an empty provider descriptor.
 void delete(IConfigRepository repo)
          Delete a provider descriptor from a configuration repository.
static boolean exists(IConfigRepository repo, String name)
          Checks if a provider descriptor is present in a configuration repository
static boolean exists(String name)
          Checks if a provider descriptor is present in the local configuration repository
 String getClassName()
          Get the java class implementing providers of the type of this class.
 String getName()
          Get the name of the provider that this descriptor describes.
 Properties getProperties()
          Get the provider properties.
static DiscoveryProviderDescriptor load(IConfigRepository repo, String name)
          Create a provider descriptor from a configuration repository.
static DiscoveryProviderDescriptor load(String name)
          Create a provider descriptor from the local configuration repository.
static Set<DiscoveryProviderDescriptor> loadAll()
          Create provider descriptors for all providers in the local configuration repository.
static Set<DiscoveryProviderDescriptor> loadAll(IConfigRepository repo)
          Create provider descriptors for all providers in a configuration repository.
 void save(IConfigRepository repo)
          Save a provider descriptor to a configuration repository.
 void setProperties(Properties props)
          Adds a set of provider properties.
 void setProperty(String name, String val)
          Set a provider property.
 String toString()
          Returns a string representation of this object
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public final String getName()
Get the name of the provider that this descriptor describes.

Returns:
the name of the provider that this descriptor describes.

getClassName

public final String getClassName()
Get the java class implementing providers of the type of this class.

Returns:
the java class implementing providers of the type of this class.

setProperty

public final void setProperty(String name,
                              String val)
Set a provider property.

Parameters:
name - the property name.
val - the property value.

setProperties

public final void setProperties(Properties props)
Adds a set of provider properties.

Parameters:
props - The properties to add to this descriptor's properties.

getProperties

public final Properties getProperties()
Get the provider properties.

Returns:
the provider properties.

save

public final void save(IConfigRepository repo)
                throws EDiscoveryException
Save a provider descriptor to a configuration repository.

This method saves a discovery provider descriptor to a configuration repository. The object is stored in a format suitable for loading subsequently using any of the load methods offered by this class.

Parameters:
repo - The configuration repository to save the descriptor to.
Throws:
EDiscoveryException - Thrown in case an error in encountered during the saving of the object.
Threading:
This method is notsafe for concurrent access by multiple threads.

delete

public final void delete(IConfigRepository repo)
                  throws EDiscoveryException
Delete a provider descriptor from a configuration repository.

This method deletes a provider descriptor from a configuration repository.

Parameters:
repo - The configuration repository to delete the descriptor from.
Throws:
EDiscoveryException - Thrown in case an error in encountered during the deletion of the descriptor.
Threading:
This method is notsafe for concurrent access by multiple threads.

toString

public final String toString()
Returns a string representation of this object

Overrides:
toString in class Object

exists

public static boolean exists(IConfigRepository repo,
                             String name)
Checks if a provider descriptor is present in a configuration repository

Parameters:
repo - The configuration repository to check in.
name - The name of the provider to check for.
Threading:
This method is safe for concurrent access by multiple threads.

exists

public static boolean exists(String name)
Checks if a provider descriptor is present in the local configuration repository

Parameters:
name - The name of the provider to check for.
Threading:
This method is safe for concurrent access by multiple threads.

create

public static DiscoveryProviderDescriptor create(String name,
                                                 String className)
Create an empty provider descriptor.

Parameters:
name - The name of the provider.
className - The name of the provider's main class.
Threading:
This method is safe for concurrent access by multiple threads.

load

public static DiscoveryProviderDescriptor load(IConfigRepository repo,
                                               String name)
                                        throws EDiscoveryException
Create a provider descriptor from a configuration repository.

This method creates and initializes a provider descriptor from a configuration repository.

Parameters:
repo - The configuration respository to create it from.
name - The name of the provider.
Throws:
EDiscoveryException
Threading:
This method is safe for concurrent access by multiple threads.

load

public static DiscoveryProviderDescriptor load(String name)
                                        throws EDiscoveryException
Create a provider descriptor from the local configuration repository.

This method creates and initializes a provider descriptor from the local configuration repository.

Parameters:
name - The name of the provider.
Throws:
EDiscoveryException
Threading:
This method is safe for concurrent access by multiple threads.

loadAll

public static Set<DiscoveryProviderDescriptor> loadAll(IConfigRepository repo)
                                                throws EDiscoveryException
Create provider descriptors for all providers in a configuration repository.

This method creates and initializes provider descriptors for each of the providers present in the configuration repository identified by the specified configuration root.

Parameters:
repo - The configuration respository from which to load all provider descriptors.
Returns:
Returns the set of server descriptors.
Throws:
EDiscoveryException
Threading:
This method is safe for concurrent access by multiple threads.

loadAll

public static Set<DiscoveryProviderDescriptor> loadAll()
                                                throws EDiscoveryException
Create provider descriptors for all providers in the local configuration repository.

This method creates and initializes provider descriptors for each of the providers present in the local configurati

Returns:
Returns the set of server descriptors. on repository.

Throws:
EDiscoveryException
Threading:
This method is safe for concurrent access by multiple threads.


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.