/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.deployment;

/**
 * MBean interface.
 */
public interface MainDeployerMBean extends org.jboss.system.ServiceMBean, org.jboss.deployment.DeployerMBean, org.jboss.deployment.MainDeployerConstants {

   //default object name
   public static final javax.management.ObjectName OBJECT_NAME = org.jboss.mx.util.ObjectNameFactory.create("jboss.system:service=MainDeployer");

   /**
    * Describe <code>setServiceController</code> method here.
    * @param serviceController an <code>ObjectName</code> value
    */
  void setServiceController(javax.management.ObjectName serviceController) ;

   /**
    * The <code>listDeployed</code> method returns a collection of DeploymemtInfo objects for the currently deployed packages.
    * @return a <code>Collection</code> value
    */
  java.util.Collection listDeployed() ;

   /**
    * Describe <code>listDeployedAsString</code> method here.
    * @return a <code>String</code> value
    */
  java.lang.String listDeployedAsString() ;

   /**
    * The <code>listIncompletelyDeployed</code> method returns a list of packages that have not deployed completely. The toString method will include any exception in the status field.
    * @return a <code>Collection</code> value
    */
  java.util.Collection listIncompletelyDeployed() ;

   /**
    * The <code>listWaitingForDeployer</code> method returns a collection of the packages that currently have no identified deployer.
    * @return a <code>Collection</code> value
    */
  java.util.Collection listWaitingForDeployer() ;

   /**
    * The <code>addDeployer</code> method registers a deployer with the main deployer. Any waiting packages are tested to see if the new deployer will deploy them.
    * @param deployer a <code>SubDeployer</code> value
    */
  void addDeployer(org.jboss.deployment.SubDeployer deployer) ;

   /**
    * The <code>removeDeployer</code> method unregisters a deployer with the MainDeployer. Deployed packages deployed with this deployer are undeployed.
    * @param deployer a <code>SubDeployer</code> value
    */
  void removeDeployer(org.jboss.deployment.SubDeployer deployer) ;

   /**
    * The <code>listDeployers</code> method returns a collection of ObjectNames of deployers registered with the MainDeployer.
    * @return a <code>Collection<ObjectName></code> value
    */
  java.util.Collection listDeployers() ;

   /**
    * The <code>shutdown</code> method undeploys all deployed packages in reverse order of their deployement.
    */
  void shutdown() ;

   /**
    * Describe <code>redeploy</code> method here.
    * @param urlSpec a <code>String</code> value
    * @exception DeploymentException if an error occurs
    * @exception MalformedURLException if an error occurs
    */
  void redeploy(java.lang.String urlspec) throws org.jboss.deployment.DeploymentException, java.net.MalformedURLException;

   /**
    * Describe <code>redeploy</code> method here.
    * @param url an <code>URL</code> value
    * @exception DeploymentException if an error occurs
    */
  void redeploy(java.net.URL url) throws org.jboss.deployment.DeploymentException;

   /**
    * Describe <code>redeploy</code> method here.
    * @param sdi a <code>DeploymentInfo</code> value
    * @exception DeploymentException if an error occurs
    */
  void redeploy(org.jboss.deployment.DeploymentInfo sdi) throws org.jboss.deployment.DeploymentException;

   /**
    * The <code>undeploy</code> method undeploys a package identified by a URL
    * @param url an <code>URL</code> value
    */
  void undeploy(java.net.URL url) throws org.jboss.deployment.DeploymentException;

   /**
    * The <code>undeploy</code> method undeploys a package identified by a string representation of a URL.
    * @param urlspec a <code>String</code> value
    * @exception MalformedURLException if an error occurs
    */
  void undeploy(java.lang.String urlspec) throws org.jboss.deployment.DeploymentException, java.net.MalformedURLException;

   /**
    * The <code>undeploy</code> method undeploys a package represented by a DeploymentInfo object.
    * @param di a <code>DeploymentInfo</code> value
    */
  void undeploy(org.jboss.deployment.DeploymentInfo di) ;

   /**
    * The <code>deploy</code> method deploys a package identified by a string representation of a URL.
    * @param urlspec a <code>String</code> value
    * @exception MalformedURLException if an error occurs
    */
  void deploy(java.lang.String urlspec) throws org.jboss.deployment.DeploymentException, java.net.MalformedURLException;

   /**
    * The <code>deploy</code> method deploys a package identified by a URL
    * @param url an <code>URL</code> value
    */
  void deploy(java.net.URL url) throws org.jboss.deployment.DeploymentException;

   /**
    * The <code>deploy</code> method deploys a package represented by a DeploymentInfo object.
    * @param deployment a <code>DeploymentInfo</code> value
    * @exception DeploymentException if an error occurs
    */
  void deploy(org.jboss.deployment.DeploymentInfo deployment) throws org.jboss.deployment.DeploymentException;

   /**
    * The <code>isDeployed</code> method tells you if a package identified by a string representation of a URL is currently deployed.
    * @param url a <code>String</code> value
    * @return a <code>boolean</code> value
    * @exception MalformedURLException if an error occurs
    */
  boolean isDeployed(java.lang.String url) throws java.net.MalformedURLException;

   /**
    * The <code>isDeployed</code> method tells you if a packaged identified by a URL is deployed.
    * @param url an <code>URL</code> value
    * @return a <code>boolean</code> value
    */
  boolean isDeployed(java.net.URL url) ;

   /**
    * The <code>getDeployment</code> method returns the DeploymentInfo object for the URL supplied.
    * @param url an <code>URL</code> value
    * @return a <code>DeploymentInfo</code> value
    */
  org.jboss.deployment.DeploymentInfo getDeployment(java.net.URL url) ;

   /**
    * The <code>getWatchUrl</code> method returns the URL that, when modified, indicates that a redeploy is needed.
    * @param url an <code>URL</code> value
    * @return a <code>URL</code> value
    */
  java.net.URL getWatchUrl(java.net.URL url) ;

   /**
    * Check the current deployment states and generate a IncompleteDeploymentException if there are mbeans waiting for depedencies.
    * @exception IncompleteDeploymentException
    */
  void checkIncompleteDeployments() throws org.jboss.deployment.DeploymentException;

}
