Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (C) 2011 eXo Platform SAS.
   *
   * 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.exoplatform.services.jcr.ext.distribution;
 
 import java.util.List;
 import java.util.Map;
 
 import javax.jcr.Node;
This interface describes a type of distribution.

Author(s):
Nicolas Filotto
Version:
$Id$
 
 public interface DataDistributionType
 {
   
Retrieves the node from the JCR under the given root node and corresponding to the given data id.

Parameters:
rootNode the root node under which the data to find is stored
dataId the id of the data to find
Returns:
the Node corresponding to the data to find
Throws:
javax.jcr.PathNotFoundException if the data cannot be find
javax.jcr.RepositoryException if an error occurred while trying to get the expected data
 
    Node getDataNode(Node rootNodeString dataIdthrows PathNotFoundExceptionRepositoryException;
   
   
Tries to get the node from the JCR and if it cannot be found, it will create it automatically.

Parameters:
rootNode the root node under which the data to find is stored
dataId the id of the data to find/create
Returns:
the Node corresponding to the data to find
Throws:
javax.jcr.RepositoryException if an error occurred while trying to get or create the expected data
 
    Node getOrCreateDataNode(Node rootNodeString dataIdthrows RepositoryException;
   
   
Tries to get the node from the JCR and if it cannot be found, it will create it automatically. If the node has to be created, the node will be created with the given node type.

Parameters:
rootNode the root node under which the data to find is stored
dataId the id of the data to find/create
nodeType the node type to use in case we need to create the node
Returns:
the Node corresponding to the data to find
Throws:
javax.jcr.RepositoryException if an error occurred while trying to get or create the expected data
 
    Node getOrCreateDataNode(Node rootNodeString dataIdString nodeTypethrows RepositoryException;
   
   
Tries to get the node from the JCR and if it cannot be found, it will create it automatically. If the node has to be created, the node will be created with the given node type and given mixin types.

Parameters:
rootNode the root node under which the data to find is stored
dataId the id of the data to find/create
nodeType the node type to use in case we need to create the node
mixinTypes the mixin types to use in case we need to create the node
Returns:
the Node corresponding to the data to find
Throws:
javax.jcr.RepositoryException if an error occurred while trying to get or create the expected data
 
    Node getOrCreateDataNode(Node rootNodeString dataIdString nodeTypeList<StringmixinTypesthrows RepositoryException;
   
   
Tries to get the node from the JCR and if it cannot be found, it will create it automatically. If the node has to be created, the node will be created with the given node type, given mixin types and given permissions.

Parameters:
rootNode the root node under which the data to find is stored
dataId the id of the data to find/create
nodeType the node type to use in case we need to create the node
mixinTypes the mixin types to use in case we need to create the node
permissions the permissions to use in case we need to create the node
Returns:
the Node corresponding to the data to find
Throws:
javax.jcr.RepositoryException if an error occurred while trying to get or create the expected data
 
    Node getOrCreateDataNode(Node rootNodeString dataIdString nodeTypeList<StringmixinTypes,
             Map<StringString[]> permissionsthrows RepositoryException;
   
   
Remove the node from the JCR if it exists

Parameters:
rootNode the root node under which the data to remove is stored
dataId the id of the data to remove
Throws:
javax.jcr.RepositoryException if an error occurred while trying to remove the expected data
   void removeDataNode(Node rootNodeString dataIdthrows RepositoryException;

   
Migrate from old structure to new one.

Parameters:
rootNode the root node under which the data to migrate is stored
Throws:
javax.jcr.RepositoryException if an error occurred during migration
   void migrate(Node rootNodethrows RepositoryException;

   
Migrate from old structure to new one.

Parameters:
rootNode the root node under which the data to migrate is stored
nodeType the node type to use in case we need to create the node
mixinTypes the mixin types to use in case we need to create the node
permissions the permissions to use in case we need to create the node
Throws:
javax.jcr.RepositoryException if an error occurred during migration
   void migrate(Node rootNodeString nodeTypeList<StringmixinTypesMap<StringString[]> permissions)
      throws RepositoryException;
New to GrepCode? Check out our FAQ X