*** This class provides Binary Compatibility only, not Source Compatibility ***

Class InformationService

java.lang.Object
com.sas.services.AbstractRemoteService
com.sas.services.information.InformationService
All Implemented Interfaces:
com.sas.entities.EntityKeyInterface, InformationServiceInterface, ServiceNotificationBroadcasterInterface, RemoteServiceInterface, Remote

@SASScope("ALL") @BinaryCompatibilityOnly public class InformationService extends AbstractRemoteService implements InformationServiceInterface
The Information Service handles finding repositories, connecting a user context to suitable repositories for the identities it contains, and federated searching across repositories.
Since:
1.0
See Also:
  • InformationServiceFactory
  • InformationServiceInitObject
  • Field Details

    • IDENTITY_TYPES

      public static final List<String> IDENTITY_TYPES
  • Method Details

    • getInstance

      public static InformationServiceInterface getInstance(Object initObject) throws ServiceException
      Get an instance of the InformationService. This is normally called by the Discovery Service.

      Parameters:
      initObject - An object used to initialize the Information Service.
      Returns:
      The Information Service interface.
      Throws:
      ServiceException - If an error occurs during initialization.
    • getInstance

      public static InformationServiceInterface getInstance(Object initObject, DiscoveryServiceInterface discoveryService) throws ServiceException
      Get an instance of the InformationService. This is normally called by the Discovery Service.

      Parameters:
      initObject - An object used to initialize the Information Service.
      discoveryService - The DiscoveryServiceInterface under which this instance is being deployed.
      Returns:
      The Information Service interface.
      Throws:
      ServiceException - If an error occurs during initialization.
    • initialize

      public void initialize(InformationServiceInitObject init) throws ServiceException
      This is really just for testing since it's difficult to create an InitializationObject outside the discovery service.

      Parameters:
      init - The initialization object
      Throws:
      ServiceException - if unable to read the default information factories.
    • addFactory

      public final void addFactory(String protocol, String type, String action, String filter)
    • configure

      public void configure(ServiceConfigurationInterface serviceConfiguration) throws RemoteException, ServiceException
      Configures service. Note that this method may used to initialize a service or to re-configure a previously initialized service.
      Specified by:
      configure in interface RemoteServiceInterface
      Overrides:
      configure in class AbstractRemoteService
      Parameters:
      serviceConfiguration - An object containing configuration data necessary to initialize or re-configure a service. Note that the service provider must verify that the object type is supported. An InitializationException should be thrown if the initialization was not completed successfully to indicate that the instance should not be used.
      Throws:
      ServiceException - if unable to configure the service.
      RemoteException - if a network anomaly is encountered.
    • destroy

      public void destroy() throws ServiceException, RemoteException
      Destroys the service. The service should release any resources it holds in preparation for termination of use of this service. The information service clears the following items when it is destroyed:
      • factory types
      • smart object definitions
      • repositories
      • repository definitions
      • listeners
      • logger
      Specified by:
      destroy in interface RemoteServiceInterface
      Overrides:
      destroy in class AbstractRemoteService
      Throws:
      RemoteException - if a network anomaly is encountered.
      ServiceException - if the service is unable to prepare itself for destruction.
    • setOption

      public void setOption(int option, Object o) throws IllegalArgumentException, ServiceException, RemoteException
      Set an option on the InformationService or its components.
      Specified by:
      setOption in interface InformationServiceInterface
      Parameters:
      option - The code for the option you want to set.
      o - The new value for the option. The type is dependent on the option. For simple types (int, boolean, etc.), use the object equivalent (Integer, Boolean, etc).
      Throws:
      IllegalArgumentException - Thrown if the argument type isn't correct for the option specified.
      ServiceException - In the event that an error occurs while setting the option.
      RemoteException - In the event of remote object failure.
    • getOption

      public Object getOption(int option) throws IllegalArgumentException, ServiceException, RemoteException
      Get an option value from the InformationService or its components.
      Specified by:
      getOption in interface InformationServiceInterface
      Parameters:
      option - The code for the option you want to get.
      Returns:
      The value for the option. The type of the object returned depends on the option requested. See the javadoc for the option to determine the type for that option.
      Throws:
      IllegalArgumentException - If the option specified isn't a valid option.
      ServiceException - In the event an error occurs while getting the option value.
      RemoteException - In the event of remote object failure.
    • getFactoryConfig

      public HashMap getFactoryConfig() throws RemoteException
      Return the configuration information for the Factory. This is the mapping of repository-specific types to the Java class that should represent them.

      Specified by:
      getFactoryConfig in interface InformationServiceInterface
      Returns:
      A Map of factory configurations.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryUrl

      public String getRepositoryUrl(String name) throws ServiceException, RemoteException
      Get the URL for a repository definition by name. The repository has to be in the Information Service configuration, or a null will be returned.

      Specified by:
      getRepositoryUrl in interface InformationServiceInterface
      Parameters:
      name - The name of the repository to get the URL for.
      Returns:
      The repository URL, or null if the name is undefined.
      Throws:
      ServiceException - in the event of a service failure.
      RemoteException - in the event of network failure.
    • findServers

      public List findServers(UserContextInterface user) throws ServiceException, RemoteException
      This method searches the connected metadata stores for server definitions that can participate in the Information Service as repositories. There's no guarantee that the user will have a credential set appropriate to all the servers.

      Specified by:
      findServers in interface InformationServiceInterface
      Parameters:
      user - The user context for the user performing the search
      Returns:
      An Iterator containing RepositoryDef objects for all the servers found.
      Throws:
      ServiceException - in the event of a service object failure.
      RemoteException - if a network anomaly is encountered.
    • getTrackedObject

      public MetadataInterface getTrackedObject(UserContextInterface user, int trackingId) throws RemoteException
      Deprecated.
      Use of tracking ids is no longer supported.
      Get a tracked object from the connected repositories. This method will ask for the object by tracking ID from all of the currently connected repositories and return it as soon as it gets a non-null response.

      Specified by:
      getTrackedObject in interface InformationServiceInterface
      Parameters:
      user - The UserContext that contains the repository.
      trackingId - The trackingId of the object being requested.
      Returns:
      The MetadataInterface object that matches the trackingId, or null if it wasn't found.
      Throws:
      RemoteException - in the event of remote object failure.
    • fetchEntityByKey

      public MetadataInterface fetchEntityByKey(UserContextInterface user, String key) throws RemoteException, ServiceException
      Fetch an object from the metadata stores by its entity key. The entity key should contain the repository URL, a unique identifier for the object and the type of the object.

      Specified by:
      fetchEntityByKey in interface InformationServiceInterface
      Parameters:
      user - The UserContext to use to perform the search.
      key - The entity key of the object to retrieve.
      Returns:
      The MetadataInterface object that represents the object with the requested key, or null if it couldn't be found.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - in the event of remote object failure.
    • fetchEntityByKey

      public MetadataInterface fetchEntityByKey(UserContextInterface user, String key, boolean bypassCache) throws RemoteException, ServiceException
      Fetch an object from the metadata stores by its entity key. The entity key should contain the repository URL, a unique identifier for the object and the type of the object.

      Specified by:
      fetchEntityByKey in interface InformationServiceInterface
      Parameters:
      user - The UserContext to use to perform the search.
      key - The entity key of the object to retrieve.
      bypassCache - if true, bypass the cache.
      Returns:
      The MetadataInterface object that represents the object with the requested key, or null if it couldn't be found.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - in the event of remote object failure.
    • fetchEntityByUrl

      public MetadataInterface fetchEntityByUrl(UserContextInterface user, String url, String domain) throws RemoteException, ServiceException
      Fetch an object from the metadata stores by its url.

      Specified by:
      fetchEntityByUrl in interface InformationServiceInterface
      Parameters:
      user - The UserContext to use to perform the search.
      url - The url of the object to retrieve.
      domain - An optional domain to help establish a connection, if one doesn't already exist to the server.
      Returns:
      The MetadataInterface object that represents the object with the requested key, or null if it couldn't be found.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - in the event of remote object failure.
    • fetchEntityByUrl

      public MetadataInterface fetchEntityByUrl(UserContextInterface user, String url, String domain, boolean bypassCache) throws RemoteException, ServiceException
      Fetch an object from the metadata stores by its url.

      Specified by:
      fetchEntityByUrl in interface InformationServiceInterface
      Parameters:
      user - The UserContext to use to perform the search.
      url - The url of the object to retrieve.
      domain - An optional domain to help establish a connection, if one doesn't already exist to the server.
      bypassCache - If true, the repository cache will be bypassed and a trip to the server forced.
      Returns:
      The MetadataInterface object that represents the object with the requested key, or null if it couldn't be found.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - in the event of remote object failure.
    • newMetadataInFolder

      public MetadataInterface newMetadataInFolder(FolderInterface folder, RepositoryInterface repos, String type, String name) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Create a new Metadata entity. The metadata will be child of the folder passed in. Some repositories will require this (LDAP), while with others it may be optional (OMR).

      Specified by:
      newMetadataInFolder in interface InformationServiceInterface
      Parameters:
      folder - The parent folder of the new object.
      repos - The repository in which the new object will reside.
      type - The "smart object" type string of the object.
      name - The name of the new object.
      Returns:
      A new MetadataInterface subclass for the new object.
      Throws:
      ServiceException - if there's no configuration defined for the type that was passed in, or if a repository error occurred.
      RemoteException - in the event of remote object failure.
    • newMetadata913

      public MetadataInterface newMetadata913(String reposId, String name, RepositoryInterface repos, String type) throws RemoteException, ServiceException
      Create a new metadata entity. The repository id may or may not be required by the repository that the entity is being created in.

      Specified by:
      newMetadata913 in interface InformationServiceInterface
      Parameters:
      reposId - The repository ID of the new entity. Some repositories will require this, others won't.
      name - The name of the new metadata object.
      repos - The handle to the repository to create the new metadata in.
      type - The type of the metadata to create. This can be either a "smart object" (com.sas.services.information.metadata.MetadataInterface) type, or a repository specific type (a CMetadata subclass, or an LDAP class).
      Returns:
      the new metadata entity (or null, if couldn't be created).
      Throws:
      ServiceException - If no definition for the type could be found, or some other error occurred.
      RemoteException - In the event of a network problem.
    • newMetadata

      public MetadataInterface newMetadata(String reposId, String name, RepositoryInterface repos, String type) throws RemoteException, ServiceException
      Create a new metadata entity. The repository id may or may not be required by the repository that the entity is being created in.

      Specified by:
      newMetadata in interface InformationServiceInterface
      Parameters:
      reposId - The repository ID of the new entity. Some repositories will require this, others won't.
      name - The name of the new metadata object.
      repos - The handle to the repository to create the new metadata in.
      type - The type of the metadata to create. This can be either a "smart object" (com.sas.services.information.metadata.MetadataInterface) type, or a repository specific type (a CMetadata subclass, or an LDAP class).
      Returns:
      the new metadata entity (or null, if couldn't be created).
      Throws:
      ServiceException - If no definition for the type could be found, or some other error occurred.
      RemoteException - In the event of a network problem.
    • newMetadataByModel

      public MetadataInterface newMetadataByModel(MetadataInterface model, String name) throws RemoteException, ServiceException
      Create a new metadata entity. The repository id may or may not be required by the repository that the entity is being created in.

      Specified by:
      newMetadataByModel in interface InformationServiceInterface
      Parameters:
      model - A Metadata object to use as a model for creating the new metadata. The new metadata will have the same type, be created in the same repository and may have other characteristics taken from the model.
      name - The name of the new metadata item.
      Returns:
      the new metadata entity (or null, if non could be created).
      Throws:
      ServiceException - If no definition for the type could be found, or some other error occurred.
      RemoteException - In the event of a network problem.
    • searchFilterArray

      public List searchFilterArray(UserContextInterface user, FilterInterface[] filters) throws ServiceException, RemoteException
      Perform a search in all the repositories the user is connected to using the provided Filters. All the filters are tried against all the repositories.

      Specified by:
      searchFilterArray in interface InformationServiceInterface
      Parameters:
      user - The user context to use to perform the search.
      filters - The filters used to limit search results.
      Returns:
      A List of MetadataInterface objects found in the repositories matching the filter.
      Throws:
      ServiceException - in the event of repository error.
      RemoteException - in the event of remote object failure.
    • search

      public List search(UserContextInterface user, FilterInterface filter) throws ServiceException, RemoteException
      Search all the repositories that a user is connected to. Use the filter provided to limit the search.

      Specified by:
      search in interface InformationServiceInterface
      Parameters:
      user - The user context that contains the connect repositories to use for the search.
      filter - A filter to use to perform the search.
      Returns:
      A List of MetadataInterface objects that match the filter.
      Throws:
      ServiceException - in the event of repository error.
      RemoteException - if a network anomaly is encountered.
    • searchProtocols

      public List searchProtocols(UserContextInterface user, List protocols, FilterInterface filter) throws ServiceException, RemoteException
      Perform a search in the repositories the user is connected to which match the domains in the provided Vector, using the provided Filter.

      Specified by:
      searchProtocols in interface InformationServiceInterface
      Parameters:
      user - The user context to use to perform the search.
      protocols - A List containing the repository protocols to perform the search in [omi, ldap, dav].
      filter - The filter used to limit search results.
      Returns:
      A List of MetadataInterface objects found in the repositories matching the filter.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - if a network anomaly is encountered.
    • searchProtocolsWithFilterArray

      public List searchProtocolsWithFilterArray(UserContextInterface user, List protocols, FilterInterface[] filters) throws ServiceException, RemoteException
      Perform a search in the repositories the user is connected to which match the domains in the provided Vector, using the provided Filter.

      Specified by:
      searchProtocolsWithFilterArray in interface InformationServiceInterface
      Parameters:
      user - The user context to use to perform the search.
      protocols - A List containing the repository protocols to perform the search in [omi, ldap, dav].
      filters - The filters used to limit search results.
      Returns:
      A List of MetadataInterface objects found in the repositories matching the filters.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - if a network anomaly is encountered.
    • searchTree

      public List searchTree(UserContextInterface user, FilterInterface filter) throws ServiceException, RemoteException
      Search the repositories that the user is connected to, returning the results in a navigable folder structure.
      Specified by:
      searchTree in interface InformationServiceInterface
      Parameters:
      user - The user context to use for the search.
      filter - The filter used to limit search results.
      Returns:
      A List of FilteredRepositoryInterface objects used to navigate through the result set.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - in the event of remote object failure.
    • searchGroupName

      public List searchGroupName(UserContextInterface user, String groupName, FilterInterface filter) throws ServiceException, RemoteException
      Search the repository group with the given name. All of the repositories in the group will be searched, and objects matching the filter will be returned. If the user doesn't have a connection to any of the repositories in the group, a connection will be attempted. If the connection fails, the remaining repositories will be tried and a PartialListResultsException will be thrown at the end. If a non-existent group is specified, a ServiceException will be thrown.
      Specified by:
      searchGroupName in interface InformationServiceInterface
      Parameters:
      user - The user performing the search.
      groupName - The name of the repository group to search.
      filter - The filter specifying the objects to return.
      Returns:
      A List of Metadata objects matching the filter in the repositories in the group.
      Throws:
      ServiceException - if a service error occurs.
      RemoteException - in the event of remote object failure.
    • searchGroup

      public List searchGroup(UserContextInterface user, RepositoryGroup group, FilterInterface filter) throws ServiceException, RemoteException
      Search the repository group that is provided. All of the repositories in the group will be searched, and objects matching the filter will be returned. If the user doesn't have a connection to any of the repositories in the group, a connection will be attempted. If the connection fails, the remaining repositories will be tried and a PartialListResultsException will be thrown at the end.
      Specified by:
      searchGroup in interface InformationServiceInterface
      Parameters:
      user - The user performing the search.
      group - The repository group specifying the repositories to search.
      filter - The filter specifying the objects to return.
      Returns:
      A List of Metadata objects matching the filter in the repositories in the group.
      Throws:
      ServiceException - if a service error occurs.
      RemoteException - in the event of remote object failure.
    • searchGroupWithFilterArray

      public List searchGroupWithFilterArray(UserContextInterface user, RepositoryGroup group, FilterInterface[] filterArray) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the repository group that is provided. All of the repositories in the group will be searched, and objects matching the filter will be returned. If the user doesn't have a connection to any of the repositories in the group, a connection will be attempted. If the connection fails, the remaining repositories will be tried and a PartialListResultsException will be thrown at the end.
      Specified by:
      searchGroupWithFilterArray in interface InformationServiceInterface
      Parameters:
      user - The user performing the search.
      group - The repository group specifying the repositories to search.
      filterArray - An array of filters specifying the objects to return.
      Returns:
      A List of Metadata objects matching the filter in the repositories in the group.
      Throws:
      ServiceException - if a service error occurs.
      RemoteException - in the event of remote object failure.
    • searchGroupNameWithFilterArray

      public List searchGroupNameWithFilterArray(UserContextInterface user, String groupName, FilterInterface[] filterArray) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the repository group that is provided. All of the repositories in the group will be searched, and objects matching the filter will be returned. If the user doesn't have a connection to any of the repositories in the group, a connection will be attempted. If the connection fails, the remaining repositories will be tried and a PartialListResultsException will be thrown at the end.
      Specified by:
      searchGroupNameWithFilterArray in interface InformationServiceInterface
      Parameters:
      user - The user performing the search.
      groupName - The name of the repository group specifying the repositories to search.
      filterArray - An array of filters specifying the objects to return.
      Returns:
      A List of Metadata objects matching the filter in the repositories in the group.
      Throws:
      ServiceException - if a service error occurs.
      RemoteException - in the event of remote object failure.
    • browseSearch

      public List browseSearch(UserContextInterface user, Filter filter) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the user's connected repositories. The objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable. This allows applications that are only displaying basic object information to perform much more lightweight and efficient operations, and only get "real" objects that can be manipulated and persisted when needed.

      It's generally a good idea when using this method to use a template. Otherwise, a basic template will be used that will get keywords, but no other associated objects. Not all repository types will honor a template, but SAS Metadata Server searches need one to get a useful set of data. Set the template on the Filter using the setOMRTemplate method.

      Specified by:
      browseSearch in interface InformationServiceInterface
      Parameters:
      user - The UserContext to perform the search for.
      filter - A Filter to limit the objects returned to those the client is interested in.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • browseSearchWithFilterArray

      public List browseSearchWithFilterArray(UserContextInterface user, Filter[] filters) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the user's connected repositories. The objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable. This allows applications that are only displaying basic object information to perform much more lightweight and efficient operations, and only get "real" objects that can be manipulated and persisted when needed.

      It's generally a good idea when using this method to use a template. Otherwise, a basic template will be used that will get keywords, but no other associated objects. Not all repository types will honor a template, but SAS Metadata Server searches need one to get a useful set of data. Set the template on the Filter using the setOMRTemplate method.

      Specified by:
      browseSearchWithFilterArray in interface InformationServiceInterface
      Parameters:
      user - The UserContext to perform the search for.
      filters - A Filter array to limit the objects returned to those the client is interested in.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • browseSearchProtocols

      public List browseSearchProtocols(UserContextInterface user, List protocols, Filter filter) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the user's connected repositories. The objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable. This allows applications that are only displaying basic object information to perform much more lightweight and efficient operations, and only get "real" objects that can be manipulated and persisted when needed.

      It's generally a good idea when using this method to use a template. Otherwise, a basic template will be used that will get keywords, but no other associated objects. Not all repository types will honor a template, but SAS Metadata Server searches need one to get a useful set of data. Set the template on the Filter using the setOMRTemplate method.

      Specified by:
      browseSearchProtocols in interface InformationServiceInterface
      Parameters:
      user - The UserContext to perform the search for.
      protocols - a List of protocol Strings.
      filter - A Filter to limit the objects returned to those the client is interested in.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • browseSearchProtocolsWithFilterArray

      public List browseSearchProtocolsWithFilterArray(UserContextInterface user, List protocols, Filter[] filters) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the user's connected repositories. The objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable. This allows applications that are only displaying basic object information to perform much more lightweight and efficient operations, and only get "real" objects that can be manipulated and persisted when needed.

      It's generally a good idea when using this method to use a template. Otherwise, a basic template will be used that will get keywords, but no other associated objects. Not all repository types will honor a template, but SAS Metadata Server searches need one to get a useful set of data. Set the template on the Filter using the setOMRTemplate method.

      Specified by:
      browseSearchProtocolsWithFilterArray in interface InformationServiceInterface
      Parameters:
      user - The UserContext to perform the search for.
      protocols - Protocols.
      filters - Filters to limit the objects returned to those the client is interested in.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • browseSearchGroupName

      public List browseSearchGroupName(UserContextInterface user, String groupName, Filter filter) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the repository group for the user. The objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable. This allows applications that are only displaying basic object information to perform much more lightweight and efficient operations, and only get "real" objects that can be manipulated and persisted when needed.

      It's generally a good idea when using this method to use a template. Otherwise, a basic template will be used that will get keywords, but no other associated objects. Not all repository types will honor a template, but SAS Metadata Server searches need one to get a useful set of data. Set the template on the Filter using the setOMRTemplate method.

      Specified by:
      browseSearchGroupName in interface InformationServiceInterface
      Parameters:
      user - The UserContext to perform the search for.
      groupName - The repository group to search.
      filter - A Filter to limit the objects returned to those the client is interested in.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • browseSearchGroupNameWithFilterArray

      public List browseSearchGroupNameWithFilterArray(UserContextInterface user, String groupName, Filter[] filters) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Search the repository group for the user. The objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable. This allows applications that are only displaying basic object information to perform much more lightweight and efficient operations, and only get "real" objects that can be manipulated and persisted when needed.

      It's generally a good idea when using this method to use a template. Otherwise, a basic template will be used that will get keywords, but no other associated objects. Not all repository types will honor a template, but SAS Metadata Server searches need one to get a useful set of data. Set the template on the Filter using the setOMRTemplate method.

      Specified by:
      browseSearchGroupNameWithFilterArray in interface InformationServiceInterface
      Parameters:
      user - The UserContext to perform the search for.
      groupName - The repository group to search.
      filters - An array of Filters to limit the objects returned to those the client is interested in.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • connectAuto

      public void connectAuto(UserContextInterface user) throws ServiceException, RemoteException
      Connect to all repositories that have been predefined as auto-connect repositories. This method is called by UserService.newUser() to connect the newly created UserContext to the auto-connect repositories. It should be unnecessary for other client code to call this method.

      Specified by:
      connectAuto in interface InformationServiceInterface
      Parameters:
      user - The UserContext to connect to the repositories.
      Throws:
      ServiceException - in the event of a severe failure.
      RemoteException - in the event of network failure
    • connectByName

      public RepositoryInterface connectByName(UserContextInterface user, String name) throws ServiceException, RemoteException
      Connect to a preconfigured repository. In order to connect using this method, the name specified has to be the name of a ReposDef entry in the Information Service configuration.

      Specified by:
      connectByName in interface InformationServiceInterface
      Parameters:
      user - The user context to use to connect to the repository.
      name - The "nickname" of the repository to connect to.
      Returns:
      The newly connected RepositoryInterface, or null if the connection fails.
      Throws:
      ServiceException - if the repository name isn't defined, or a there's a problem making the connection.
      RemoteException - in the event of network error.
    • connect

      public ServerInterface connect(UserContextInterface user, ServerDef serverDef) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Connect to a ServerInterface object.

      For any client connecting to a metadata server, it is strongly recommended that the InformationServiceInterface.connect(UserContextInterface, ServerDef, Cluster) method be used instead.

      Specified by:
      connect in interface InformationServiceInterface
      Parameters:
      user - The user being connected. Any required credentials will be retrieved from this UserContext, and the ServerInterface will be added to its list of Servers.
      serverDef - The ServerDefinition with the connection information to connect to the server.
      Returns:
      The connected ServerInterface.
      Throws:
      ServiceException - If a communications or other server error occurs.
      RemoteException - In the event of remote object failure.
    • connect

      public ServerInterface connect(UserContextInterface user, ServerDef serverDef, Cluster cluster) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Connect to a ServerInterface object.
      Specified by:
      connect in interface InformationServiceInterface
      Parameters:
      user - The user being connected. Any required credentials will be retrieved from this UserContext, and the ServerInterface will be added to its list of Servers.
      serverDef - The ServerDefinition with the connection information to connect to the server.
      cluster - The cluster definition to use for the connection.
      Returns:
      The connected ServerInterface.
      Throws:
      ServiceException - If a communications or other server error occurs.
      RemoteException - In the event of remote object failure.
    • connect

      public RepositoryInterface connect(UserContextInterface user, RepositoryDef reposDef) throws ServiceException, RemoteException
      Connect to the repository specified in the repository definition.

      Specified by:
      connect in interface InformationServiceInterface
      Parameters:
      user - The user context to connect to the repository.
      reposDef - The repository definition with the information needed to connect to the service.
      Returns:
      The newly connected RepositoryInterface, or null if the connection fails.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of a network failure.
    • addRepositoryDef

      public boolean addRepositoryDef(RepositoryDef repositoryDef) throws RemoteException
      Description copied from interface: InformationServiceInterface
      Adds a repository definition to the repository list.

      Specified by:
      addRepositoryDef in interface InformationServiceInterface
      Parameters:
      repositoryDef - An information service repository definition.
      Returns:
      true if the repository definition was successfully added or false if it wasn't.
      Throws:
      RemoteException - in the event of remote object failure.
    • removeRepositoryDef

      public boolean removeRepositoryDef(RepositoryDef repositoryDef) throws RemoteException
      Description copied from interface: InformationServiceInterface
      Removes a repository definition from the list of repositories.

      Specified by:
      removeRepositoryDef in interface InformationServiceInterface
      Parameters:
      repositoryDef - A Repository definition to remove.
      Returns:
      true if the repository definition was successfully removed or false if it wasn't.
      Throws:
      RemoteException - in the event of remote object failure.
    • clearRepositoryDefs

      public void clearRepositoryDefs()
      Description copied from interface: InformationServiceInterface
      Removes all repository definitions.

      Specified by:
      clearRepositoryDefs in interface InformationServiceInterface
    • getReposDefs

      public List getReposDefs() throws RemoteException
      Return a List of the preconfigured repository definitions. This list represents all the repositories that can be connected to by name.

      Specified by:
      getReposDefs in interface InformationServiceInterface
      Returns:
      A List containing RepositoryDef objects for all the repositories that are in the Information Service configuration.
      Throws:
      RemoteException - in the event of remote object failure.
    • addServerDef

      public boolean addServerDef(ServerDef serverDef) throws RemoteException
      Description copied from interface: InformationServiceInterface
      Add a new server definition to the Information Service configuration.
      Specified by:
      addServerDef in interface InformationServiceInterface
      Parameters:
      serverDef - The new server definition to add.
      Returns:
      true if the server definition was successfully added or false if it wasn't.
      Throws:
      RemoteException - In the event of remote object failure.
    • removeServerDef

      public boolean removeServerDef(ServerDef serverDef) throws RemoteException
      Description copied from interface: InformationServiceInterface
      Remove a server definition from the Information Service configuration.
      Specified by:
      removeServerDef in interface InformationServiceInterface
      Parameters:
      serverDef - The server definition to remove.
      Returns:
      true if the server definition was successfully removed or false if it wasn't.
      Throws:
      RemoteException - In the event of remote object failure.
    • clearServerDefs

      public void clearServerDefs()
      Description copied from interface: InformationServiceInterface
      Clear the set of defined server definitions.
      Specified by:
      clearServerDefs in interface InformationServiceInterface
    • getServerDefs

      public List getServerDefs() throws RemoteException
      Returns a List of the configured server definitions. This list represents all of the servers that can be connected to by name.

      Specified by:
      getServerDefs in interface InformationServiceInterface
      Returns:
      A List of ServerDef objects that exist in the configuration.
      Throws:
      RemoteException - In the event of remote object failure.
    • getRepositoryGroups

      public List getRepositoryGroups() throws ServiceException, RemoteException
      Return a List of the defined repository groups.
      Specified by:
      getRepositoryGroups in interface InformationServiceInterface
      Returns:
      A List of RepositoryGroup objects.
      Throws:
      ServiceException - in the event of service failure.
      RemoteException - in the event of remote object failure.
    • getRepositoryGroup

      public RepositoryGroup getRepositoryGroup(String name) throws ServiceException, RemoteException
      Get the group with the given name.
      Specified by:
      getRepositoryGroup in interface InformationServiceInterface
      Parameters:
      name - The name of the repository group to return.
      Returns:
      the RepositoryGroup whose name matches the parameter, or null if no such group exists.
      Throws:
      ServiceException - in the event of a service error.
      RemoteException - in the event of remote object failure.
    • addRepositoryGroup

      public boolean addRepositoryGroup(RepositoryGroup group) throws ServiceException, RemoteException
      Add a new group to the collection of defined repository groups that can be used to scope a search.
      Specified by:
      addRepositoryGroup in interface InformationServiceInterface
      Parameters:
      group - The new group to add to the definitions.
      Returns:
      true if the new group is successfully added, false otherwise.
      Throws:
      ServiceException - If a service error occurs.
      RemoteException - in the event of remote object failure.
    • removeRepositoryGroup

      public boolean removeRepositoryGroup(RepositoryGroup group) throws ServiceException, RemoteException
      Remove a group from the collection of defined repository groups that can be used to scope a search.
      Specified by:
      removeRepositoryGroup in interface InformationServiceInterface
      Parameters:
      group - The group to remove from the definitions.
      Returns:
      true if the group is successfully removed, false otherwise.
      Throws:
      ServiceException - if a service error occurs.
      RemoteException - in the event of remote object failure.
    • clearRepositoryGroups

      public void clearRepositoryGroups() throws ServiceException, RemoteException
      Clear all repository group definitions.
      Specified by:
      clearRepositoryGroups in interface InformationServiceInterface
      Throws:
      ServiceException - if a service error occurs.
      RemoteException - in the event of remote object failure.
    • addMetadataChangeListener

      public void addMetadataChangeListener(MetadataChangeListener listener, String url) throws ServiceException, RemoteException
      Register a metadata change listener. These should typically be only RepositoryInterface implementers, and this call should be made by the Repository connect() method. The Information Service is the clearinghouse for metadata change notifications. Each repository should notify the Information Service when it persists a change to the backing store. The Information Service then notifies all the other repositories, so hopefully the data stays as up-to-date as possible.

      Specified by:
      addMetadataChangeListener in interface InformationServiceInterface
      Parameters:
      listener - A MetadataChangeListener to add to the list.
      url - A URL that represents the server to receive notifications for.
      Throws:
      IllegalArgumentException - if the url is invalid.
      RemoteException - in the event of remote object failure.
      ServiceException - if a service level error occurs.
    • removeMetadataChangeListener

      public void removeMetadataChangeListener(MetadataChangeListener listener, String url) throws RemoteException
      Remove a metadata change listener. This should only be called by a Repository close() method.

      Specified by:
      removeMetadataChangeListener in interface InformationServiceInterface
      Parameters:
      listener - The listener to remove.
      url - The url for the server the listener is listening for.
      Throws:
      IllegalArgumentException - if the url is invalid.
      RemoteException - in the event of remote object failure.
    • metadataChange

      public void metadataChange(MetadataChangeEvent event) throws RemoteException
      Process a metadata change event. Some metadata was changed, and all listeners to whom it applies need to be informed.

      Specified by:
      metadataChange in interface InformationServiceInterface
      Parameters:
      event - the MetadataChangeEvent that describes what changed.
      Throws:
      RemoteException - in the event of remote object failure.
    • getServiceProxy

      public final RemoteServiceInterface getServiceProxy()
      Gets the service proxy.
      Specified by:
      getServiceProxy in interface RemoteServiceInterface
      Overrides:
      getServiceProxy in class AbstractRemoteService
      Returns:
      A proxy to this service or null if a proxy is not available.
    • isAuthorized

      public boolean isAuthorized(UserContextInterface superUser, IdentityInterface plainUser, MetadataInterface objectToCheck, String permission) throws ServiceException, RemoteException
      Check the authorization for a metadata object. Use the connection of superUser, the credentials of plainUser, and the ID of the object. If plainUser has the permission, return true.
      Specified by:
      isAuthorized in interface InformationServiceInterface
      Parameters:
      superUser - The user whose connection to the repository we're to use.
      plainUser - The user whose access we're checking.
      objectToCheck - The object we want to check permissions on.
      permission - The permission string we're checking for.
      Returns:
      True if plainUser has permission on objectToCheck, false otherwise
      Throws:
      ServiceException - in the event of a repository error.
      RemoteException - in the event of remote object failure.
    • getReposKey

      public String getReposKey(String entityKey) throws ServiceException, RemoteException
      This is a utility method to take an entity key and return the repository key. This can be useful if a client already knows what repository the data is in, and wants to bypass the Information Service's searching for the correct repository instance.
      Specified by:
      getReposKey in interface InformationServiceInterface
      Parameters:
      entityKey - A String with the entity key.
      Returns:
      A String with the repository key that can be passed to the repository's fetch method.
      Throws:
      ServiceException - if a parse error occurs processing the entity key.
      RemoteException - in the event of remote object failure.
    • addInformationServiceTimerClient

      public void addInformationServiceTimerClient(InformationServiceTimerClient client) throws ServiceException, RemoteException
      Add a client object to be triggered when the timer expires. Currently the timer is scheduled for every five minutes, but may be configurable in the future. This method is especially intended for use by the repository instances to purge/refresh cache objects.
      Specified by:
      addInformationServiceTimerClient in interface InformationServiceInterface
      Parameters:
      client - A client object to trigger when the timer expires.
      Throws:
      ServiceException - In the event of Service object errors.
      RemoteException - in the event of remote object failure.
    • removeInformationServiceTimerClient

      public void removeInformationServiceTimerClient(InformationServiceTimerClient client) throws ServiceException, RemoteException
      Remove a timer client from the service list.
      Specified by:
      removeInformationServiceTimerClient in interface InformationServiceInterface
      Parameters:
      client - The client to remove from the timer list.
      Throws:
      ServiceException - If a services error occurs.
      RemoteException - In the event of remote object failure.
    • setIsolated

      public void setIsolated() throws RemoteException
      Set the flag which isolates the data retrieved by the repositories. This means that metadata objects will not be exported to RMI, and so will not be sharable across JVM's. Use this option with great care.
      Specified by:
      setIsolated in interface InformationServiceInterface
      Throws:
      RemoteException - in the event of remote object failure.
    • isIsolated

      public boolean isIsolated() throws RemoteException
      Get the flag that indicates if metadata isolation is active.
      Specified by:
      isIsolated in interface InformationServiceInterface
      Returns:
      true if isolation is on.
      Throws:
      RemoteException
    • logFormat

      public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0) throws RemoteException
      Throws:
      RemoteException
    • logFormat

      public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1) throws RemoteException
      Throws:
      RemoteException
    • logFormat

      public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1, Object arg2) throws RemoteException
      Throws:
      RemoteException
    • logFormat

      public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1, Object arg2, Object arg3) throws RemoteException
      Throws:
      RemoteException
    • logMessage

      public void logMessage(org.apache.logging.log4j.Level level, String message) throws RemoteException
      Throws:
      RemoteException
    • logMessage

      public void logMessage(org.apache.logging.log4j.Level level, String message, Throwable t) throws RemoteException
      Throws:
      RemoteException
    • getSmartObjectDefinitions

      public Map getSmartObjectDefinitions() throws RemoteException
      Description copied from interface: InformationServiceInterface
      Get the Map of Smart object definitions from the configuration. The returned Map is a copy of the configuration, and updating it will not affect the Information Service.
      Specified by:
      getSmartObjectDefinitions in interface InformationServiceInterface
      Returns:
      A Map of SmartDef objects.
      Throws:
      RemoteException - In the event of remote object failure.
    • getObjectByPath

      public MetadataInterface getObjectByPath(UserContextInterface user, PathUrl path) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Retrieve an object using the PathUrl.
      Specified by:
      getObjectByPath in interface InformationServiceInterface
      Parameters:
      user - The UserContextInterface for the user to retrieve the object for.
      path - The PathUrl That points to the object to be retrieved.
      Returns:
      The object pointed to by the path, or null if it is not found.
      Throws:
      ServiceException - In the event of a repository error, an invalid PathUrl, or a service level error.
      RemoteException - In the event of remote object failure.
    • getServerForPath

      public ServerInterface getServerForPath(UserContextInterface user, PathUrl path) throws ServiceException, RemoteException
      Description copied from interface: InformationServiceInterface
      Return the ServerInterface for the path given. If the path has the server name, it's easy. Just get it from the UserContext. Otherwise, go through the user's connected servers and ask each RepositoryInterface for its ISName and compare them to the one in the Pathurl. Needless to say, it's much better if the PathUrl has the server name in it.
      Specified by:
      getServerForPath in interface InformationServiceInterface
      Parameters:
      user - The UserContext containing the ServerInterface(s).
      path - The PathUrl that the client wants the server for.
      Returns:
      The ServerInterface containing the path, if it can be determined.
      Throws:
      ServiceException - If the path is ambiguous. That is, the path contains a repository name that's in multiple servers, or the server name isn't found.
      RemoteException - In the event of remote object failure.
    • addTypeMap

      public void addTypeMap(String serverUrl, Map typeMap) throws RemoteException
      Description copied from interface: InformationServiceInterface
      Cache a type map for a given server. The host string should be a URL format with the host name and port number. (e.g., omi://host.dot.com:8561).
      Specified by:
      addTypeMap in interface InformationServiceInterface
      Parameters:
      typeMap - A Map of TypeDefinitions for the server.
      Throws:
      RemoteException - In the event of remote object failure.
    • getTypeMap

      public Map getTypeMap(String serverUrl) throws RemoteException
      Description copied from interface: InformationServiceInterface
      Get a type definition map for a given server.
      Specified by:
      getTypeMap in interface InformationServiceInterface
      Parameters:
      serverUrl - The server identifier to retrieve the type map for.
      Returns:
      The map of TypeDefinition objects, or null if it hasn't been retrieved.
      Throws:
      RemoteException - in the event of remote object failure.
    • addExplicitIdentityGroupsMap

      @Deprecated public void addExplicitIdentityGroupsMap(String serverUrl, Map _explicitIdentityGroupsMap) throws RemoteException
      Deprecated.
      Description copied from interface: InformationServiceInterface
      Cache a type map for a given server. The host string should be a URL format with the host name and port number. (e.g., omi://host.dot.com:8561).
      Specified by:
      addExplicitIdentityGroupsMap in interface InformationServiceInterface
      Throws:
      RemoteException - In the event of remote object failure.
    • getExplicitIdentityGroupsMap

      @Deprecated public Map getExplicitIdentityGroupsMap(String serverUrl) throws RemoteException
      Deprecated.
      Description copied from interface: InformationServiceInterface
      Get an Explicit IdentityGroups map for a given server.
      Specified by:
      getExplicitIdentityGroupsMap in interface InformationServiceInterface
      Parameters:
      serverUrl - The server identifier to retrieve the IdentityGroups for.
      Returns:
      The map of Explicit IdentityGroups objects, or null if it hasn't been retrieved.
      Throws:
      RemoteException - in the event of remote object failure.