| //------------------------------------------------------------------------------ |
| // Copyright (c) 2005, 2006 IBM Corporation and others. |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v1.0 |
| // which accompanies this distribution, and is available at |
| // http://www.eclipse.org/legal/epl-v10.html |
| // |
| // Contributors: |
| // IBM Corporation - initial implementation |
| //------------------------------------------------------------------------------ |
| package org.eclipse.epf.library; |
| |
| import java.util.Map; |
| |
| import org.eclipse.emf.edit.provider.ComposedAdapterFactory; |
| import org.eclipse.epf.library.events.ILibraryChangeListener; |
| import org.eclipse.epf.uma.MethodElement; |
| import org.eclipse.epf.uma.MethodLibrary; |
| |
| /** |
| * The interface for a Library Manager. |
| * |
| * @author Kelvin Low |
| * @since 1.0 |
| */ |
| public interface ILibraryManager { |
| |
| /** |
| * Creates a new method library. |
| * |
| * @param name |
| * A name for the new method library. |
| * @param args |
| * Method library specific arguments. |
| * @return A <code>MethodLibrary</code>. |
| * @throw <code>LibraryServiceException</code> if an error occurred while |
| * performing the operation. |
| */ |
| public MethodLibrary createMethodLibrary(String name, Map args) |
| throws LibraryServiceException; |
| |
| /** |
| * Opens a method library. |
| * |
| * @param args |
| * Method library specific arguments. |
| * @return A <code>MethodLibrary</code>. |
| * @throw <code>LibraryServiceException</code> if an error occurred while |
| * performing the operation. |
| */ |
| public MethodLibrary openMethodLibrary(Map args) |
| throws LibraryServiceException; |
| |
| /** |
| * Reopens the managed method library. |
| * |
| * @return A <code>MethodLibrary</code>. |
| * @throw <code>LibraryServiceException</code> if an error occurred while |
| * performing the operation. |
| */ |
| public MethodLibrary reopenMethodLibrary() throws LibraryServiceException; |
| |
| /** |
| * Saves a method library. |
| * |
| * @throw <code>LibraryServiceException</code> if an error occurred while |
| * performing the operation. |
| */ |
| public void saveMethodLibrary() throws LibraryServiceException; |
| |
| /** |
| * Closes the method library that is managed by this library manager. |
| * |
| * @return A <code>MethodLibrary</code>. |
| * @throw <code>LibraryServiceException</code> if an error occurred while |
| * performing the operation. |
| */ |
| public void closeMethodLibrary() throws LibraryServiceException; |
| |
| /** |
| * Returns the method library that is managed by this library manager. |
| * |
| * @return A <code>MethodLibrary</code>. |
| */ |
| public MethodLibrary getMethodLibrary(); |
| |
| /** |
| * Sets the managed method library. |
| * |
| * @param library |
| * A method library. |
| */ |
| public void setMethodLibrary(MethodLibrary library); |
| |
| /** |
| * Returns the absolute path to the method library that is managed by this |
| * library manager. |
| * |
| * @return An absolute path to the method library. |
| */ |
| public String getMethodLibraryPath(); |
| |
| /** |
| * Returns the adapter factory. |
| * |
| * @return A <code>ComposedAdapterFactory</code> |
| */ |
| public ComposedAdapterFactory getAdapterFactory(); |
| |
| /** |
| * Checks whether the managed method library is locked. |
| * |
| * @return <code>true</code> if the method library is locked. |
| */ |
| public boolean isMethodLibraryLocked(); |
| |
| /** |
| * Attaches a changed listener to the managed method library. |
| * |
| * @param listener |
| * A library change listener. |
| */ |
| public void addListener(ILibraryChangeListener listener); |
| |
| /** |
| * Detaches a changed listener from the managed method library. |
| * |
| * @param listener |
| * A library change listener. |
| */ |
| public void removeListener(ILibraryChangeListener listener); |
| |
| /** |
| * Returns a method element. |
| * |
| * @param guid |
| * The method element's GUID. |
| * |
| * @return A <code>MethodElement</code> or <code>null</code>. |
| */ |
| public MethodElement getMethodElement(String guid); |
| |
| } |