Class FavoritesFactory
java.lang.Object
com.sas.services.information.metadata.favorites.FavoritesFactory
- All Implemented Interfaces:
RemoteSessionContextStateChangedListener,Remote,EventListener
Factory class used for creating new favorites folders.
- Since:
- 9.3
-
Method Summary
Modifier and TypeMethodDescriptionvoidNotifies the object that its state has changed within the session context.createFavoritesFolder(String name, FolderInterface folder) Creates a new favorites folder.createFavoritesGroup(String name, FavoritesContainer container) Creates a new favorites group within an owning container.getApplicationFavorites(String contextName) Returns the Favorites folder for a given context.getApplicationHistory(String applicationName) Returns the History favorites folder for a given application.static FavoritesFactorygetInstance(SessionContextInterface session) Returns the factory instance for a given session context.Returns the session associated with this factory instance.Returns the Favorites folder for the user currently logged in.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
getInstance
public static FavoritesFactory getInstance(SessionContextInterface session) throws ServiceException, RemoteException Returns the factory instance for a given session context.- Parameters:
session- the users's session context- Returns:
- favorites factory instance
- Throws:
ServiceExceptionRemoteException
-
getSession
Returns the session associated with this factory instance.- Returns:
- session context
-
createFavoritesFolder
public FavoritesFolder createFavoritesFolder(String name, FolderInterface folder) throws ServiceException, RemoteException Creates a new favorites folder. Callers should ensure the name being used to create the object is unique within the parent folder. SeeFolder.hasDuplicate(String, String).- Parameters:
name- the name of the objectfolder- the parent folder to associate this favorites folder to- Returns:
- a new favorites folder or null if one could not be created
- Throws:
ServiceExceptionRemoteException
-
createFavoritesGroup
public FavoritesGroup createFavoritesGroup(String name, FavoritesContainer container) throws ServiceException, RemoteException Creates a new favorites group within an owning container. Callers should ensure the name being used to create the object is unique within the container. SeeFavoritesContainer.hasDuplicateFavoritesGroup(String).- Parameters:
name- the name of the objectcontainer- the parent container to associate this favorites group to- Returns:
- a new favorites group or null if one could not be created
- Throws:
ServiceExceptionRemoteException
-
getUserFavorites
Returns the Favorites folder for the user currently logged in. The favorites folders reside in a user's Application Data folder, for example:/User Folders/user-name/Application Data/My Favorites(FavoritesFolder)
If the favorites folder does not exist, this method will attempt to create it along with its parent folders if necessary. Meaning, the method will first retrieve the user's Application Data folder, and will create it if necessary. And finally, the Favorites favorites folder itself is retrieved, or created.- Returns:
- the user's favorites folder, or null if for some reason the favorites folder could not be created.
- Throws:
ServiceExceptionRemoteException
-
getApplicationFavorites
public FavoritesFolder getApplicationFavorites(String contextName) throws ServiceException, RemoteException Returns the Favorites folder for a given context. A context is typically the name of the calling application, but it can represent a shared value if multiple applications want to display the same set of favorites. The favorites folders reside in a user's Application Data folder, for example:/User Folders/user-name/Application Data/context-name/Favorites(FavoritesFolder)
If the favorites folder does not exist, this method will attempt to create it along with its parent folders if necessary. Meaning, the method will first retrieve the user's Application Data folder, and will create it if necessary. Next, the context specific subfolder will be retrieved, or created if necessary. And finally, the Favorites favorites folder itself is retrieved, or created.- Parameters:
contextName- the context name to create the favorites folder under- Returns:
- the context specific favorites folder, or null if for some reason the favorites folder could not be created.
- Throws:
ServiceExceptionRemoteException
-
getApplicationHistory
public FavoritesFolder getApplicationHistory(String applicationName) throws ServiceException, RemoteException Returns the History favorites folder for a given application. History folders reside in a user's Application Data folder, for example:/User Folders/user-name/Application Data/application-name/History(FavoritesFolder)
If the favorites folder does not exist, this method will attempt to create it along with its parent folders if necessary. Meaning, the method will first retrieve the user's Application Data folder, and will create it if necessary. Next, the application specific subfolder will be retrieved, or created if necessary. And finally, the History favorites folder itself is retrieved, or created.To set the number maximum number of objects contained within the history, see
FavoritesContainer.setMaxCapacity(int).- Parameters:
applicationName- the context name to create the favorites folder under- Returns:
- the application specific favorites folder, or null if for some reason the favorites folder could not be created.
- Throws:
ServiceExceptionRemoteException
-
contextStateChanged
Description copied from interface:RemoteSessionContextStateChangedListenerNotifies the object that its state has changed within the session context. Currently, this is when the object is removed from the session context or when the session context is destroyed. If an object added to the session context withSessionContextInterface.setAttribute(Object)implements this interface, the session context will invoke this method when the object is removed from the session context or when the session context is destroyed.- Specified by:
contextStateChangedin interfaceRemoteSessionContextStateChangedListener- Parameters:
event- The event that identifies the bound object, the name of the bound object, the session context, and an identifier that indicates the type of state change that occurred.- Throws:
RemoteException- If a network anomaly is encountered.
-