import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * This class functions as interface for the façade.
 *
 * @author HONOREZ Dylan
 * @author SELS Wannes
 * @version ebXML Proxy 2.0 with JAX-RPC
 */

public interface ebXMLrrIF extends Remote {
    //private ProxyConnectionManager pcm;
    //private ProxyQueryManager pqm;
    //private ProxyLifeCycleManager plcm;

    // CONNECTION METHODS

    /**
     * Initializes the RegistryProxy.
     */
    public void startUp() throws RemoteException;

    /**
     * Shuts down the RegistryProxy.
     */
    public void shutDown() throws RemoteException;

    /**
     * Establishes a connection to the Registry, so the ProxyQueryManager knows the location of the Registry Service.
     * @param url
     * @return Success: true/false.
     */
    public boolean connect(String url) throws RemoteException;

    /**
     * Disconnects from the Registry.
     */
    public void disconnect() throws RemoteException;

    /**
     * Used to log on to the server. You have to log on to use most of the ProxyLifeCycleManager methods.
     * @param login
     * @param password
     * @return Success: true/false.
     */
    public boolean logOn(String login, String password) throws RemoteException;

    /**
     * Used to log off. No more access to ProxyLifyCycleManager methods.
     */
    public void logoff() throws RemoteException;

    // QUERY METHODS

    /**
     * Returns all the Users in the Registry.
     * @return An XML in String-format.
     */
    public String getUsers() throws RemoteException;

    /**
     * Returns all the ExtrinsicObjects in the Registry.
     * @return An XML in String-format.
     */
    public String getExtrinsicObjects() throws RemoteException;

    /**
     * Returns all the ClassificationSchemes in the Registry.
     * @return An XML in String-format.
     */
    public String getClassificationSchemes() throws RemoteException;

    /**
     * Returns all the ClassificationNodes in the Registry.
     * @return An XML in String-format.
     */
    public String getClassificationNodes() throws RemoteException;

    /**
     * Returns all the Organizations in the Registry.
     * @return An XML in String-format.
     */
    public String getOrganizations() throws RemoteException;

    /**
     * Returns all the RegistryPackages in the Registry.
     * @return An XML in String-format.
     */
    public String getRegistryPackage() throws RemoteException;

    /**
     * Returns all the Services in the Registry.
     * @return An XML in String-format.
     */
    public String getServices() throws RemoteException;

    /**
     * Returns all the ClassificationNodes in the Registry for a given ClassificationScheme.
     * @return An XML in String-format.
     */
    public String getChilds(String id) throws RemoteException;


    public String query(String query) throws RemoteException;
    /**
     *
     * @param id
     * @return
     */
    public String countChilds(String id) throws RemoteException;

    /**
     *
     * @return
     */
    public String countSchemeNodes() throws RemoteException;

    /**
     * Returns the RepositoryItem as String for ExtrinsicObject
     * @param uuid of ExtrinsicObject
     * @return RepositoryItem
     */
    public String getEoContent(String uuid) throws RemoteException;

    // LIFECYCLE METHODS

    /**
     * Creates a user.
     * @param userInfo XML in String-format, contains the user data.
     * @param alias Login/alias for the Registry.
     * @param pass Password for the Registry.
     * @return Success: true/false
     */
    public String createUser(String userInfo, String alias, String pass) throws RemoteException;

    /**
     * Deletes a user.
     * @param uuid Unique ID for the user
     * @param login Login or alias from the keystore
     */
    public void deleteUser(String uuid, String login) throws RemoteException;


    /**
     * Deletes an organization
     * @param uuid
     * @return boolean
     */
    public boolean deleteOrganization(String uuid) throws RemoteException;

    /**
     * Deletes a ClassificationScheme.
     * @param schemaId The uuid from the Scheme that has to be deleted.
     */
    public void deleteClassificationScheme(String schemaId) throws RemoteException;

    /**
     * Deletes a ClassificationNode if there is nothing under it (no node or object)
     * @param nodeId The id for the to be deleted node.
     */
    public void deleteClassificationNode(String nodeId) throws RemoteException;

    /**
     * Lists the users of the current KeyStoreFile.
     * @return An XML in String-format.
     */
    public String listAliassen() throws RemoteException;

    /**
     * Submit XML RIM Objects
     * @param xmlObjs XML as String
     * @return xml with objects if succesfull, errorlist if failure
     */
    public String createXmlObjects(String xmlObjs) throws RemoteException;

    /**
     * Update XML RIM Objects
     * @param xmlObjs XML as String
     * @return xml with objects if succesfull, errorlist if failure
     */
    public String updateXmlObjects(String xmlObjs) throws RemoteException;

    /**
     * Generates a new unique id.
     * @return The generated id.
     */
    public String newId() throws RemoteException;

    /**
     * Creates an ExtrinsicObject
     * @param objectInfo The object meta-data.
     * @param object The actual object.
     * @return Id of the created object.
     */
    public String createExtrinsicObject(String objectInfo, String object) throws RemoteException;

    // TESTING

    public String test() throws RemoteException;
}