Package com.sas.services.information

# Class AbstractRepository2

java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sas.services.information.AbstractRepository2

All Implemented Interfaces:
  `RepositoryInterface`, `Serializable`, `Remote`

public abstract class AbstractRepository2 extends UnicastRemoteObject implements RepositoryInterface

See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `class`
  `AbstractRepository2.SmartTypeHelper`
  The purpose of this class is effeciently assist with the determination of the "smart metadata type" for a particular class name.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `_domain`
  `protected String`
  `_host`
  `protected boolean`
  `_isDestroyed`
  `protected String`
  `_isName`
  `protected ArrayList`
  `_listeners`
  `protected org.apache.logging.log4j.Logger`
  `_logger`
  `protected int`
  `_portInt`
  `protected String`
  `_principal`
  `protected String`
  `_uniqueId`
  `protected String`
  `_url`
  `protected UserContextInterface`
  `_user`
  `protected Exception`
  `closeStack`

  ### Fields inherited from class java.rmi.server.RemoteObject

  `ref`

  ### Fields inherited from interface com.sas.services.information.RepositoryInterface

  `PROFILE_BEST, PROFILE_NO, PROFILE_POSSIBLE`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractRepository2()`
  `protected`
  `AbstractRepository2(Class theClass)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addListener(RepositoryListenerInterface listener)`
  Add a listener to receive event notifications from the repository instance.
  `void`
  `close()`
  Close the connection and get rid of the cache.
  `String`
  `getDomain()`
  Get the domain for this repository.
  `String`
  `getHost()`
  Get the name of the host this repository is running on.
  `static InformationServiceInterface`
  `getInformationService()`
  Return a handle to the Information Service.
  `String`
  `getISName()`
  Get the Information Service configuration name for this repository if it exists.
  `int`
  `getPort()`
  Get the port number of the server this repository is using.
  `String`
  `getPrincipal()`
  Get the principal name this instance connected with.
  `protected String`
  `getSmartType(String key, AbstractRepository2.SmartTypeHelper helper, Map rawData, org.apache.logging.log4j.Logger logger)`
  `MetadataInterface`
  `getTrackedObject(int trackingId)`
  Get a cached object by its tracking ID.
  `String`
  `getUniqueId()`
  Get a unique identifier for this repository instance.
  `String`
  `getUrl()`
  Get the URL that represents the specific instance for a repository.
  `UserContextInterface`
  `getUserContext()`
  Get the UserContext this repository was connected for.
  `boolean`
  `isDestroyed()`
  Check if the repostiory instance has been closed.
  `protected void`
  `notifyListeners(int event)`
  Notify listeners that a repository event has occurred (close, disconnect, reconnect).
  `protected void`
  `pulseCheck()`
  `void`
  `removeListener(RepositoryListenerInterface listener)`
  Remove a listener from the list of active event listeners for this repository.
  `void`
  `setDomain(String domain)`
  Set the security domain for this repository.
  `void`
  `setISName(String name)`
  Set the name that was used to connect to the repository.
  `void`
  `setUserContext(UserContextInterface user)`
  Set the UserContext that this repository belongs to.

  ### Methods inherited from class java.rmi.server.UnicastRemoteObject

  `clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject`

  ### Methods inherited from class java.rmi.server.RemoteServer

  `getClientHost, getLog, setLog`

  ### Methods inherited from class java.rmi.server.RemoteObject

  `equals, getRef, hashCode, toString, toStub`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.sas.services.information.RepositoryInterface

  `addEntity, addRootFolder, browseFetch, browseFolder, browseFolderRecursive, browseObjectByPath, browseSearch, connect, connect, connectWithProxy, deleteEntity, factoryProcess, factoryTest, fetch, fetch, fetchByUrl, fromByteArry, getBase, getCacheStatistics, getEvaluator, getFactoryKey, getIdentity, getObjectByPath, getObjectByPath, getObjectByPath, getObjectByPathString, getRootFolder, getRootFolders, getServer, getUser, isEqual, isProfileRepository, makeRootFolder, narrow, newChild, newMetadata, newMetadata, newMetadataByModel, produceDefaultMetadata, refreshAllData, refreshEntity, removeRootFolder, search, searchTree, searchTree, searchTreeFromBase, searchTreeFromBaseWithScope, setUser, toByteArray`

- ## Field Details

  - ### _isName

    protected String _isName

  - ### _isDestroyed

    protected boolean _isDestroyed

  - ### closeStack

    protected Exception closeStack

  - ### _user

    protected UserContextInterface _user

  - ### _logger

    protected org.apache.logging.log4j.Logger _logger

  - ### _url

    protected String _url

  - ### _domain

    protected String _domain

  - ### _host

    protected String _host

  - ### _principal

    protected String _principal

  - ### _portInt

    protected int _portInt

  - ### _listeners

    protected ArrayList _listeners

  - ### _uniqueId

    protected String _uniqueId

- ## Constructor Details

  - ### AbstractRepository2

    protected AbstractRepository2() throws RemoteException
    Throws:
      `RemoteException`

  - ### AbstractRepository2

    protected AbstractRepository2(Class theClass) throws RemoteException
    Throws:
      `RemoteException`

- ## Method Details

  - ### close

    public void close() throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Close the connection and get rid of the cache.

    Specified by:
      `close` in interface `RepositoryInterface`
    Throws:
      `RemoteException` - in the event of network errors.

  - ### getInformationService

    public static InformationServiceInterface getInformationService() throws RemoteException
    Return a handle to the Information Service. If necessary, use the Discovery Service to get it.

    Returns:
      an instance of the Information Service.
    Throws:
      `RemoteException` - in the event of remote object failure.

  - ### setISName

    public void setISName(String name) throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Set the name that was used to connect to the repository. This method should be used by the InformationService connect methods. If this is used by client applications, certain functions may not work correctly.
    Specified by:
      `setISName` in interface `RepositoryInterface`
    Parameters:
      `name` - The name that was used to connect to the repository. This name should match the Information Service RepositoryDef name.
    Throws:
      `RemoteException`

  - ### getISName

    public String getISName() throws RemoteException
    Get the Information Service configuration name for this repository if it exists. It looks through the ReposDefs for the best match and returns the name.

    Specified by:
      `getISName` in interface `RepositoryInterface`
    Returns:
      The ReposDef name for this repository.
    Throws:
      `RemoteException` - in the event of remote object failure.

  - ### setUserContext

    public void setUserContext(UserContextInterface user) throws RemoteException
    Set the UserContext that this repository belongs to. This will be used to retrieve a logging interface as well as a session when necessary.

    Specified by:
      `setUserContext` in interface `RepositoryInterface`
    Parameters:
      `user` - The UserContext this repository was connected for.
    Throws:
      `RemoteException` - In the event of network failure.

  - ### getUserContext

    public UserContextInterface getUserContext() throws RemoteException
    Get the UserContext this repository was connected for. This may be null if none was set.

    Specified by:
      `getUserContext` in interface `RepositoryInterface`
    Returns:
      The UserContext this repostiory is connected for.
    Throws:
      `RemoteException` - in the event of network failure.

  - ### getUrl

    public String getUrl() throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Get the URL that represents the specific instance for a repository.
    Specified by:
      `getUrl` in interface `RepositoryInterface`
    Returns:
      The URL representing the repository we're currently connected to.
    Throws:
      `RemoteException` - in the event of network errors.

  - ### getDomain

    public String getDomain()
    Get the domain for this repository. This is the security domain that this service runs in.

    Specified by:
      `getDomain` in interface `RepositoryInterface`
    Returns:
      The security domain this server is authenticated in.

  - ### setDomain

    public void setDomain(String domain) throws RemoteException
    Set the security domain for this repository.

    Specified by:
      `setDomain` in interface `RepositoryInterface`
    Parameters:
      `domain` - The security domain this server instance uses for authentication.
    Throws:
      `RemoteException` - in the event of network errors.

  - ### getHost

    public String getHost() throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Get the name of the host this repository is running on.

    Specified by:
      `getHost` in interface `RepositoryInterface`
    Returns:
      The host name.
    Throws:
      `RemoteException` - in the event of network errors.

  - ### getPort

    public int getPort() throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Get the port number of the server this repository is using.

    Specified by:
      `getPort` in interface `RepositoryInterface`
    Returns:
      The port number.
    Throws:
      `RemoteException` - in the event of network errors.

  - ### getPrincipal

    public String getPrincipal() throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Get the principal name this instance connected with.

    Specified by:
      `getPrincipal` in interface `RepositoryInterface`
    Returns:
      The principal string.
    Throws:
      `RemoteException` - in the event of network errors.

  - ### getTrackedObject

    public MetadataInterface getTrackedObject(int trackingId) throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Get a cached object by its tracking ID. Objects in the tracking cache are saved by WeakReference, so they may be garbage collected if no other object is using them. In that case, this method will return null.
    Specified by:
      `getTrackedObject` in interface `RepositoryInterface`
    Parameters:
      `trackingId` - The id of the desired metadata object.
    Returns:
      Cached object obtained using its tracking id or `null` if the object isn't available in the cache.
    Throws:
      `RemoteException` - in the event of network errors.

  - ### addListener

    public void addListener(RepositoryListenerInterface listener) throws ServiceException, RemoteException
    Add a listener to receive event notifications from the repository instance. Events include disconnect, reconnect, and close. Other events may be added.
    Specified by:
      `addListener` in interface `RepositoryInterface`
    Parameters:
      `listener` - The object to add to the repository's list of event listeners.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of network errors.

  - ### removeListener

    public void removeListener(RepositoryListenerInterface listener) throws ServiceException, RemoteException
    Remove a listener from the list of active event listeners for this repository.
    Specified by:
      `removeListener` in interface `RepositoryInterface`
    Parameters:
      `listener` - The object to remove from the repository's list of event listeners.
    Throws:
      `ServiceException` - if a repository error occurs.
      `RemoteException` - in the event of network errors.

  - ### notifyListeners

    protected void notifyListeners(int event) throws RemoteException
    Notify listeners that a repository event has occurred (close, disconnect, reconnect).

    Parameters:
      `event` - The type of event that occurred.
    Throws:
      `RemoteException`

  - ### getUniqueId

    public String getUniqueId() throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Get a unique identifier for this repository instance.
    Specified by:
      `getUniqueId` in interface `RepositoryInterface`
    Returns:
      A unique identifier.
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### isDestroyed

    public boolean isDestroyed() throws RemoteException
    Description copied from interface: `RepositoryInterface`
    Check if the repostiory instance has been closed.
    Specified by:
      `isDestroyed` in interface `RepositoryInterface`
    Returns:
      true if the repository has been closed, false otherwise.
    Throws:
      `RemoteException` - In the event of remote object failure.

  - ### getSmartType

    protected String getSmartType(String key, AbstractRepository2.SmartTypeHelper helper, Map rawData, org.apache.logging.log4j.Logger logger)

  - ### pulseCheck

    protected void pulseCheck() throws ServiceException
    Throws:
      `ServiceException`