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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThe purpose of this class is effeciently assist with the determination of the "smart metadata type" for a particular class name. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected booleanprotected Stringprotected ArrayListprotected org.apache.logging.log4j.Loggerprotected intprotected Stringprotected Stringprotected Stringprotected UserContextInterfaceprotected ExceptionFields inherited from class java.rmi.server.RemoteObject
refFields inherited from interface com.sas.services.information.RepositoryInterface
PROFILE_BEST, PROFILE_NO, PROFILE_POSSIBLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(RepositoryListenerInterface listener) Add a listener to receive event notifications from the repository instance.voidclose()Close the connection and get rid of the cache.StringGet the domain for this repository.StringgetHost()Get the name of the host this repository is running on.static InformationServiceInterfaceReturn a handle to the Information Service.StringGet the Information Service configuration name for this repository if it exists.intgetPort()Get the port number of the server this repository is using.StringGet the principal name this instance connected with.protected StringgetSmartType(String key, AbstractRepository2.SmartTypeHelper helper, Map rawData, org.apache.logging.log4j.Logger logger) getTrackedObject(int trackingId) Get a cached object by its tracking ID.StringGet a unique identifier for this repository instance.StringgetUrl()Get the URL that represents the specific instance for a repository.Get the UserContext this repository was connected for.booleanCheck if the repostiory instance has been closed.protected voidnotifyListeners(int event) Notify listeners that a repository event has occurred (close, disconnect, reconnect).protected voidvoidremoveListener(RepositoryListenerInterface listener) Remove a listener from the list of active event listeners for this repository.voidsetDomain(String domain) Set the security domain for this repository.voidsetISName(String name) Set the name that was used to connect to the repository.voidSet the UserContext that this repository belongs to.Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLogMethods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStubMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
_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 RemoteExceptionDescription copied from interface:RepositoryInterfaceClose the connection and get rid of the cache.- Specified by:
closein interfaceRepositoryInterface- Throws:
RemoteException- in the event of network errors.
-
getInformationService
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:RepositoryInterfaceSet 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:
setISNamein interfaceRepositoryInterface- 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 RemoteExceptionGet 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:
getISNamein interfaceRepositoryInterface- Returns:
- The ReposDef name for this repository.
- Throws:
RemoteException- in the event of remote object failure.
-
setUserContext
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:
setUserContextin interfaceRepositoryInterface- Parameters:
user- The UserContext this repository was connected for.- Throws:
RemoteException- In the event of network failure.
-
getUserContext
Get the UserContext this repository was connected for. This may be null if none was set.- Specified by:
getUserContextin interfaceRepositoryInterface- Returns:
- The UserContext this repostiory is connected for.
- Throws:
RemoteException- in the event of network failure.
-
getUrl
public String getUrl() throws RemoteExceptionDescription copied from interface:RepositoryInterfaceGet the URL that represents the specific instance for a repository.- Specified by:
getUrlin interfaceRepositoryInterface- 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:
getDomainin interfaceRepositoryInterface- 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:
setDomainin interfaceRepositoryInterface- Parameters:
domain- The security domain this server instance uses for authentication.- Throws:
RemoteException- in the event of network errors.
-
getHost
public String getHost() throws RemoteExceptionDescription copied from interface:RepositoryInterfaceGet the name of the host this repository is running on.- Specified by:
getHostin interfaceRepositoryInterface- Returns:
- The host name.
- Throws:
RemoteException- in the event of network errors.
-
getPort
public int getPort() throws RemoteExceptionDescription copied from interface:RepositoryInterfaceGet the port number of the server this repository is using.- Specified by:
getPortin interfaceRepositoryInterface- Returns:
- The port number.
- Throws:
RemoteException- in the event of network errors.
-
getPrincipal
public String getPrincipal() throws RemoteExceptionDescription copied from interface:RepositoryInterfaceGet the principal name this instance connected with.- Specified by:
getPrincipalin interfaceRepositoryInterface- Returns:
- The principal string.
- Throws:
RemoteException- in the event of network errors.
-
getTrackedObject
Description copied from interface:RepositoryInterfaceGet 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:
getTrackedObjectin interfaceRepositoryInterface- Parameters:
trackingId- The id of the desired metadata object.- Returns:
- Cached object obtained using its tracking id or
nullif 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:
addListenerin interfaceRepositoryInterface- 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:
removeListenerin interfaceRepositoryInterface- 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 RemoteExceptionDescription copied from interface:RepositoryInterfaceGet a unique identifier for this repository instance.- Specified by:
getUniqueIdin interfaceRepositoryInterface- Returns:
- A unique identifier.
- Throws:
RemoteException- In the event of remote object failure.
-
isDestroyed
public boolean isDestroyed() throws RemoteExceptionDescription copied from interface:RepositoryInterfaceCheck if the repostiory instance has been closed.- Specified by:
isDestroyedin interfaceRepositoryInterface- 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
- Throws:
ServiceException
-