com.sas.services.information.metadata.favorites
Interface FavoritesContainer

All Superinterfaces:
MetadataInterface, PublicObjectContainerInterface, PublicObjectInterface, java.rmi.Remote
All Known Subinterfaces:
FavoritesFolder, FavoritesGroup

public interface FavoritesContainer
extends MetadataInterface, PublicObjectContainerInterface

Base interface used for any favorites container object, such as a FavoritesFolder or a FavoritesGroup. This interface contains the common methods used by these containers.

Since:
9.3

Field Summary
static int CAPACITY_UNLIMITED
          Constant used to indicate that the container can hold an unlimited number of favorites.
 
Fields inherited from interface com.sas.services.information.metadata.MetadataInterface
METADATA_STATE_DELETED, METADATA_STATE_DESTROYED, METADATA_STATE_NEW, METADATA_STATE_NORMAL, PERMISSION_READMETADATA, PERMISSION_WRITEMETADATA
 
Method Summary
 void addFavorite(MetadataInterface favorite)
          Adds a new item to the list of favorites.
 void addFavoritesGroup(FavoritesGroup subGroup)
          Adds a new child group to this container.
 boolean containsFavorite(MetadataInterface favorite)
          Returns true if the specified object is a direct member of this container.
 int getFavoriteCount()
          Returns the number of favorites in this container.
 int getFavoriteIndex(MetadataInterface favorite)
          Returns the index of the specified favorite, or -1 if the favorite does not exist within this container.
 java.util.List<MetadataInterface> getFavorites()
          Returns the list of all favorites contained within this container.
 java.util.List<MetadataInterface> getFavorites(SortOrder[] order)
          Deprecated. should not be used
 int getFavoritesGroupIndex(FavoritesGroup subGroup)
          Returns the index of the specified favorites group, or -1 if the group does not exist within this container.
 java.util.List<FavoritesGroup> getFavoritesGroups()
          Returns the list of all favorites groups contained within this container.
 int getMaxCapacity()
          Returns the maximum number of favorites allowed under this container.
 int getTotalFavoriteCount()
          Returns the number of favorites in this container, as well as any nested favorites groups, recursively.
 boolean hasDuplicateFavoritesGroup(java.lang.String name)
          Check if there's a duplicate favorites group in this container with the same name.
 void insertFavorite(MetadataInterface favorite, int index)
          Inserts a new item to the list of favorites at the specified index.
 void insertFavoritesGroup(FavoritesGroup subGroup, int index)
          Inserts a new child group to this container at the specified index.
 boolean isEmpty()
          Returns true if this container has no elements, either favorites or child favorite groups.
 void moveFavorite(MetadataInterface favorite, int newPosition)
          Deprecated. use removeFavorite(MetadataInterface) and insertFavorite(MetadataInterface, int)
 void removeAll()
          Clears the container by removing all favorites and favorites groups, recursively.
 void removeAllFavorites()
          Removes all existing favorites from this particular container.
 void removeAllFavoritesGroups()
          Removes all existing child favorite groups from this particular container.
 void removeFavorite(MetadataInterface favorite)
          Removes the specified object from the list of favorites.
 void removeFavoritesGroup(FavoritesGroup subGroup)
          Removes the specified object from the list favorites groups.
 void setMaxCapacity(int capacity)
          Sets the maximum number of favorites allowed to be contained within this folder at a given time.
 
Methods inherited from interface com.sas.services.information.metadata.MetadataInterface
add, addAccessControl, addAttribute, addAttributes, addDocument, addExtension, addGroup, addImplementor, addKeyword, addObjectProperty, addObjectProperty, addPermissions, addPrompt, addPropertySet, addRemark, addResponsibleParty, addTransactionListener, addUsedByPrototype, checkin, checkout, commit, copyTo, countAssociatedObjects, delete, deleteAttribute, deleteAttributes, destroy, getAccessControls, getAttribute, getAttributes, getAuthorizationUtil, getCreateDate, getDescription, getDocuments, getEntityKey, getEntityURL, getExtensions, getGroups, getGUID, getIdentities, getImplementors, getKeywords, getLockedBy, getModifyDate, getObjectProperties, getParent, getParentPath, getParents, getPath, getPaths, getPermission, getPermissions, getPermissions, getPreviousVersionNames, getPrimaryPropertyGroup, getPrompt, getPrompts, getPropertyBag, getPropertySets, getRemarksList, getReposId, getRepository, getRepositoryEntity, getRepositoryName, getReposKey, getResponsibleParties, getState, getTrackingId, getType, getUsageVersion, getUsedByPrototypes, getUsingPrototype, getVersion, isAuthorized, isCompatible, isDeleted, isDestroyed, isLoggingEnabled, isObjectAlive, isReadCompatible, logMessage, mapNameToFilesystem, mapUrlToFilesystem, moveTo, newServiceObject, refresh, removeAccessControl, removeDocument, removeExtension, removeGroup, removeImplementor, removeKeyword, removeObjectProperty, removePermissions, removePrompt, removePropertySet, removeResponsibleParty, removeUsedByPrototype, rollback, setAttribute, setAttributes, setDeleted, setDescription, setDocuments, setExtensions, setGroups, setGUID, setKeywords, setName, setObjectProperties, setPermission, setPrimaryPropertyGroup, setPrompt, setPrompts, setRemarksList, setRepository, setUsingPrototype, startTransaction, toByteArray, transactionEvent, uncheckout, update, updateFromBag, version
 
Methods inherited from interface com.sas.services.information.publicobject.PublicObjectContainerInterface
getChildAt, getChildCount, getChildren, getChildren, newChild
 
Methods inherited from interface com.sas.services.information.publicobject.PublicObjectInterface
addProcessorInterface, getContainer, getIdentifier, getName, getObjectURI, getPathUrl, getProcessorInterface, getTypeDescriptor
 

Field Detail

CAPACITY_UNLIMITED

static final int CAPACITY_UNLIMITED
Constant used to indicate that the container can hold an unlimited number of favorites.

See Also:
Constant Field Values
Method Detail

getFavorites

java.util.List<MetadataInterface> getFavorites()
                                               throws ServiceException,
                                                      java.rmi.RemoteException
Returns the list of all favorites contained within this container. An empty list is returned if this container contains no favorites.

Returns:
list of favorites
Throws:
ServiceException
java.rmi.RemoteException

getFavorites

java.util.List<MetadataInterface> getFavorites(SortOrder[] order)
                                               throws ServiceException,
                                                      java.rmi.RemoteException
Deprecated. should not be used

Returns the list of all favorites contained within this folder, and sorted in the proper order. If a null value is passed in for the order, a default order will be applied (sorting by name then type). An empty list will be returned if this folder contains no favorites.

Parameters:
order -
Returns:
list of favorites sorted in the appropriate order
Throws:
ServiceException
java.rmi.RemoteException

getFavoriteIndex

int getFavoriteIndex(MetadataInterface favorite)
                     throws ServiceException,
                            java.rmi.RemoteException
Returns the index of the specified favorite, or -1 if the favorite does not exist within this container.

Parameters:
favorite - the favorite to search for
Returns:
the index of the favorite, or -1 if not found
Throws:
ServiceException
java.rmi.RemoteException

getFavoriteCount

int getFavoriteCount()
                     throws ServiceException,
                            java.rmi.RemoteException
Returns the number of favorites in this container. This method returns the total count of this specific container, and does not include the count of any nested favorites groups, if applicable. Any child favorites groups are also not included in this count.

Returns:
the number of favorites
Throws:
ServiceException
java.rmi.RemoteException

getTotalFavoriteCount

int getTotalFavoriteCount()
                          throws ServiceException,
                                 java.rmi.RemoteException
Returns the number of favorites in this container, as well as any nested favorites groups, recursively. Use getFavoriteCount() if a recursive search is not needed. The returned count only includes objects that have been added as favorites. Nested favorites groups are not included.

Returns:
the number of favorites
Throws:
ServiceException
java.rmi.RemoteException

containsFavorite

boolean containsFavorite(MetadataInterface favorite)
                         throws ServiceException,
                                java.rmi.RemoteException
Returns true if the specified object is a direct member of this container. Note, this method does not search within any nested favorites groups to determine if the object is contained or not.

Parameters:
favorite - the favorite item
Returns:
true if contained within the folder, false otherwise
Throws:
ServiceException
java.rmi.RemoteException

isEmpty

boolean isEmpty()
                throws ServiceException,
                       java.rmi.RemoteException
Returns true if this container has no elements, either favorites or child favorite groups.

Returns:
true if this container is empty
Throws:
ServiceException
java.rmi.RemoteException

addFavorite

void addFavorite(MetadataInterface favorite)
                 throws ServiceException,
                        java.rmi.RemoteException
Adds a new item to the list of favorites. If the object is already contained within the list, it will not be re-added.

Parameters:
favorite - the favorite item
Throws:
ServiceException
java.rmi.RemoteException

insertFavorite

void insertFavorite(MetadataInterface favorite,
                    int index)
                    throws ServiceException,
                           java.rmi.RemoteException
Inserts a new item to the list of favorites at the specified index. If the object is already contained within the list, it will not be re-added.

Parameters:
favorite - the favorite item
index - the index where the favorite should be added
Throws:
ServiceException
java.rmi.RemoteException

removeFavorite

void removeFavorite(MetadataInterface favorite)
                    throws ServiceException,
                           java.rmi.RemoteException
Removes the specified object from the list of favorites.

Parameters:
favorite - the favorite item
Throws:
ServiceException
java.rmi.RemoteException

removeAllFavorites

void removeAllFavorites()
                        throws ServiceException,
                               java.rmi.RemoteException
Removes all existing favorites from this particular container.

Throws:
ServiceException
java.rmi.RemoteException

getFavoritesGroups

java.util.List<FavoritesGroup> getFavoritesGroups()
                                                  throws ServiceException,
                                                         java.rmi.RemoteException
Returns the list of all favorites groups contained within this container. An empty list is returned if this container contains no child groups.

Returns:
list of favorites groups
Throws:
ServiceException
java.rmi.RemoteException

getFavoritesGroupIndex

int getFavoritesGroupIndex(FavoritesGroup subGroup)
                           throws ServiceException,
                                  java.rmi.RemoteException
Returns the index of the specified favorites group, or -1 if the group does not exist within this container.

Parameters:
subGroup - the favorites group to search for
Returns:
the index of the child group, or -1 if not found
Throws:
ServiceException
java.rmi.RemoteException

addFavoritesGroup

void addFavoritesGroup(FavoritesGroup subGroup)
                       throws ServiceException,
                              java.rmi.RemoteException
Adds a new child group to this container. If the object is already contained within the list, it will not be re-added.

Parameters:
subGroup - the child favorites group
Throws:
ServiceException
java.rmi.RemoteException

insertFavoritesGroup

void insertFavoritesGroup(FavoritesGroup subGroup,
                          int index)
                          throws ServiceException,
                                 java.rmi.RemoteException
Inserts a new child group to this container at the specified index. If the object is already contained within the list, it will not be re-added.

Parameters:
subGroup - the child favorites group
index - the index where the group should be added
Throws:
ServiceException
java.rmi.RemoteException

removeFavoritesGroup

void removeFavoritesGroup(FavoritesGroup subGroup)
                          throws ServiceException,
                                 java.rmi.RemoteException
Removes the specified object from the list favorites groups.

Important: Removing the favorites group will remove the object from its association with its parent container. This will essentially leave the group orphaned, but it will not delete it from the metadata server. The group will need to be either deleted or re-added to another (or same) favorites container.

Parameters:
subGroup - the child favorites group
Throws:
ServiceException
java.rmi.RemoteException

removeAllFavoritesGroups

void removeAllFavoritesGroups()
                              throws ServiceException,
                                     java.rmi.RemoteException
Removes all existing child favorite groups from this particular container.

Important: Removing the favorites group will remove the object from its association with its parent container. This will essentially leave the group orphaned, but it will not delete it from the metadata server. The group will need to be either deleted or re-added to another (or same) favorites container.

Throws:
ServiceException
java.rmi.RemoteException

removeAll

void removeAll()
               throws ServiceException,
                      java.rmi.RemoteException
Clears the container by removing all favorites and favorites groups, recursively.

Throws:
ServiceException
java.rmi.RemoteException

hasDuplicateFavoritesGroup

boolean hasDuplicateFavoritesGroup(java.lang.String name)
                                   throws ServiceException,
                                          java.rmi.RemoteException
Check if there's a duplicate favorites group in this container with the same name.

Parameters:
name - the name to check for.
Returns:
true if this container has a favorites group with the given name, false otherwise.
Throws:
ServiceException
java.rmi.RemoteException

setMaxCapacity

void setMaxCapacity(int capacity)
                    throws ServiceException,
                           java.rmi.RemoteException
Sets the maximum number of favorites allowed to be contained within this folder at a given time. This method is typically used for favorites containers that are used in a history based context.

If an object is added as a favorite such that it exceeds the capacity settings, the favorites container will remove the oldest value. This way the container will never contain more objects than what's specified by the capacity.

Parameters:
capacity - the maximum capacity of favorites allowed in this container
Throws:
ServiceException
java.rmi.RemoteException

getMaxCapacity

int getMaxCapacity()
                   throws ServiceException,
                          java.rmi.RemoteException
Returns the maximum number of favorites allowed under this container.

Returns:
the maximum capactiy of favorites.
Throws:
ServiceException
java.rmi.RemoteException

moveFavorite

void moveFavorite(MetadataInterface favorite,
                  int newPosition)
                  throws ServiceException,
                         java.rmi.RemoteException
Deprecated. use removeFavorite(MetadataInterface) and insertFavorite(MetadataInterface, int)

Moves an existing favorite to the specified location.

Parameters:
favorite - the favorite item
newPosition - the new position to move the item to
Throws:
java.lang.IllegalArgumentException - if the object does not exist within this container
ServiceException
java.rmi.RemoteException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.