org.exoplatform.services.jcr.ext.artifact
Class ArtifactManagingServiceImpl

java.lang.Object
  extended by org.exoplatform.services.jcr.ext.artifact.ArtifactManagingServiceImpl
All Implemented Interfaces:
ArtifactManagingService, org.picocontainer.Startable

public class ArtifactManagingServiceImpl
extends java.lang.Object
implements ArtifactManagingService, org.picocontainer.Startable

Created by The eXo Platform SAS .
Service responsible for Administration Maven repository the served JCR structure inside workspaceName is: rootPath (maven-root)/ ---part-of-group-folder1/ (nt:folder + exo:groupId) ---part-of-group-foldern/ ------artifact-root-folder/(nt:folder + exo:artifactId) ---------maven-metadata.xml(nt:file) ---------maven-metadata.xml.sha1(nt:file) ---------artifact-version-folder/(nt:folder + exo:versionId) ------------artifactId-version.jar (nt:file + exo:mavenjar / nt:resource) ------------artifactId-version.jar.sha1 (nt:file + exo:mavensha1 / nt:resource ) ------------artifactId-version.pom (nt:file + exo:mavenpom / nt:resource) ------------artifactId-version.pom.sha1 (nt:file + exo:mavensha1/ (nt:resource) ------------maven-metadata.xml (nt:file +exo:mavenmetadata / (nt:resource ) ------------maven-metadata.xml.sha1(nt:file + exo:mavensha1 / (nt:resource)

Version:
$Id: ArtifactManagingServiceImpl.java 35186 2009-08-07 14:23:43Z pnedonosko $
Author:
Gennady Azarenkov, Volodymyr Krasnikov

Constructor Summary
ArtifactManagingServiceImpl(org.exoplatform.container.xml.InitParams params, RepositoryService repositoryService)
          without registry service
ArtifactManagingServiceImpl(org.exoplatform.container.xml.InitParams initParams, RepositoryService repositoryService, RegistryService registryService)
           
 
Method Summary
 void addArtifact(SessionProvider sp, ArtifactDescriptor artifact, java.io.InputStream jarIStream, java.io.InputStream pomIStream)
          adds (deploys) artifact including creating necessary group folders, pom and checksum files
 void changePermission(SessionProvider sp, Descriptor artifact, java.lang.String identity, java.lang.String[] permissions, boolean delete)
          Changes acess permissions for the specified artifact ang given identity
protected  java.io.File createMultiMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String current_version, java.util.List<java.lang.String> v_list)
           
protected  java.io.File createSingleMetadata(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
           
 void exportArtifacts(SessionProvider sp, FolderDescriptor parentFolder, java.io.File destFolder)
           
 void exportArtifacts(SessionProvider sp, FolderDescriptor parentFolder, java.io.OutputStream out)
          exports list of artifacts from maven repo into output stream
 java.util.List<Descriptor> getDescriptors(SessionProvider sp, FolderDescriptor parentFolder)
           
 java.util.List getListErrors()
           
 java.util.List getPermission(SessionProvider sp, Descriptor artifact)
          Returns acess control list for the specified artifact
 void importArtifacts(SessionProvider sp, java.io.File folder)
           
 void importArtifacts(SessionProvider sp, java.io.InputStream in)
          imports list of artifacts into maven repo
 void removeArtifact(SessionProvider sp, Descriptor artifact)
          removes artifact
 java.util.List<Descriptor> searchArtifacts(SessionProvider sp, SearchCriteria criteria)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArtifactManagingServiceImpl

public ArtifactManagingServiceImpl(org.exoplatform.container.xml.InitParams initParams,
                                   RepositoryService repositoryService,
                                   RegistryService registryService)
                            throws RepositoryConfigurationException
Parameters:
params -
repositoryService -
registryService -
Throws:
RepositoryConfigurationException

ArtifactManagingServiceImpl

public ArtifactManagingServiceImpl(org.exoplatform.container.xml.InitParams params,
                                   RepositoryService repositoryService)
                            throws RepositoryConfigurationException
without registry service

Parameters:
params -
repositoryService -
Throws:
RepositoryConfigurationException
Method Detail

addArtifact

public void addArtifact(SessionProvider sp,
                        ArtifactDescriptor artifact,
                        java.io.InputStream jarIStream,
                        java.io.InputStream pomIStream)
                 throws javax.jcr.RepositoryException
Description copied from interface: ArtifactManagingService
adds (deploys) artifact including creating necessary group folders, pom and checksum files

Specified by:
addArtifact in interface ArtifactManagingService
Parameters:
sp - the session provider
artifact - descriptor
Throws:
javax.jcr.RepositoryException

exportArtifacts

public void exportArtifacts(SessionProvider sp,
                            FolderDescriptor parentFolder,
                            java.io.OutputStream out)
                     throws javax.jcr.RepositoryException,
                            java.io.FileNotFoundException
Description copied from interface: ArtifactManagingService
exports list of artifacts from maven repo into output stream

Specified by:
exportArtifacts in interface ArtifactManagingService
Parameters:
sp - the session provider
parentFolder - the folder which children we need to get
Throws:
javax.jcr.RepositoryException
java.io.FileNotFoundException

exportArtifacts

public void exportArtifacts(SessionProvider sp,
                            FolderDescriptor parentFolder,
                            java.io.File destFolder)
                     throws javax.jcr.RepositoryException,
                            java.io.FileNotFoundException
Specified by:
exportArtifacts in interface ArtifactManagingService
Throws:
javax.jcr.RepositoryException
java.io.FileNotFoundException

getDescriptors

public java.util.List<Descriptor> getDescriptors(SessionProvider sp,
                                                 FolderDescriptor parentFolder)
                                          throws javax.jcr.RepositoryException
Specified by:
getDescriptors in interface ArtifactManagingService
Parameters:
sp - the session provider
parentFolder - the folder which children we need to get
Returns:
list of child descriptors
Throws:
javax.jcr.RepositoryException

importArtifacts

public void importArtifacts(SessionProvider sp,
                            java.io.InputStream in)
                     throws javax.jcr.RepositoryException,
                            java.io.FileNotFoundException
Description copied from interface: ArtifactManagingService
imports list of artifacts into maven repo

Specified by:
importArtifacts in interface ArtifactManagingService
Parameters:
sp - the session provider
Throws:
javax.jcr.RepositoryException
java.io.FileNotFoundException

importArtifacts

public void importArtifacts(SessionProvider sp,
                            java.io.File folder)
                     throws javax.jcr.RepositoryException,
                            java.io.FileNotFoundException
Specified by:
importArtifacts in interface ArtifactManagingService
Parameters:
sp - - Session provider
Throws:
javax.jcr.RepositoryException
java.io.FileNotFoundException

removeArtifact

public void removeArtifact(SessionProvider sp,
                           Descriptor artifact)
                    throws javax.jcr.RepositoryException
Description copied from interface: ArtifactManagingService
removes artifact

Specified by:
removeArtifact in interface ArtifactManagingService
Parameters:
sp - the session provider
artifact - descriptor
Throws:
javax.jcr.RepositoryException

getPermission

public java.util.List getPermission(SessionProvider sp,
                                    Descriptor artifact)
                             throws javax.jcr.RepositoryException
Description copied from interface: ArtifactManagingService
Returns acess control list for the specified artifact

Specified by:
getPermission in interface ArtifactManagingService
Parameters:
sp - the session provider
artifact - the artifact which ACL we need to get
Throws:
javax.jcr.RepositoryException

changePermission

public void changePermission(SessionProvider sp,
                             Descriptor artifact,
                             java.lang.String identity,
                             java.lang.String[] permissions,
                             boolean delete)
                      throws javax.jcr.RepositoryException
Description copied from interface: ArtifactManagingService
Changes acess permissions for the specified artifact ang given identity

Specified by:
changePermission in interface ArtifactManagingService
Parameters:
sp - the session provider
artifact - the artifact which will be changed
identity - identity for addin/removing permissions
permissions - array of permissions to set/remove
Throws:
javax.jcr.RepositoryException

searchArtifacts

public java.util.List<Descriptor> searchArtifacts(SessionProvider sp,
                                                  SearchCriteria criteria)
                                           throws javax.jcr.RepositoryException
Specified by:
searchArtifacts in interface ArtifactManagingService
Parameters:
sp - the session provider
criteria - for search
Returns:
list of descriptors
Throws:
javax.jcr.RepositoryException

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable

createSingleMetadata

protected java.io.File createSingleMetadata(java.lang.String groupId,
                                            java.lang.String artifactId,
                                            java.lang.String version)
                                     throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

createMultiMetadata

protected java.io.File createMultiMetadata(java.lang.String groupId,
                                           java.lang.String artifactId,
                                           java.lang.String current_version,
                                           java.util.List<java.lang.String> v_list)
                                    throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

getListErrors

public java.util.List getListErrors()
Specified by:
getListErrors in interface ArtifactManagingService


Copyright © 2012 eXo Platform SAS. All Rights Reserved.