Return-Path: X-Original-To: apmail-ace-commits-archive@www.apache.org Delivered-To: apmail-ace-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B131C932A for ; Thu, 14 Jun 2012 16:39:21 +0000 (UTC) Received: (qmail 35682 invoked by uid 500); 14 Jun 2012 16:39:21 -0000 Delivered-To: apmail-ace-commits-archive@ace.apache.org Received: (qmail 35654 invoked by uid 500); 14 Jun 2012 16:39:21 -0000 Mailing-List: contact commits-help@ace.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ace.apache.org Delivered-To: mailing list commits@ace.apache.org Received: (qmail 35640 invoked by uid 99); 14 Jun 2012 16:39:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 16:39:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 16:39:18 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6E5C12388A32 for ; Thu, 14 Jun 2012 16:38:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1350321 [3/3] - in /ace/sandbox/paulb/acerepository: ./ cnf/ cnf/buildrepo/ cnf/buildrepo/ee.minimum/ cnf/buildrepo/junit.osgi/ cnf/buildrepo/org.apache.felix.framework/ cnf/buildrepo/org.eclipse.osgi/ cnf/buildrepo/osgi.core/ cnf/cache/ c... Date: Thu, 14 Jun 2012 16:38:57 -0000 To: commits@ace.apache.org From: paulb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120614163858.6E5C12388A32@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: ace/sandbox/paulb/acerepository/cnf/cache/.obr/http%3A%2F%2Fbundles.bndtools.org/repository.xml.etag URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/cache/.obr/http%253A%252F%252Fbundles.bndtools.org/repository.xml.etag?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/cnf/cache/.obr/http%3A%2F%2Fbundles.bndtools.org/repository.xml.etag (added) +++ ace/sandbox/paulb/acerepository/cnf/cache/.obr/http%3A%2F%2Fbundles.bndtools.org/repository.xml.etag Thu Jun 14 16:38:53 2012 @@ -0,0 +1 @@ +"e5dbe01fd92232a6b3b7c939c63c518e" \ No newline at end of file Added: ace/sandbox/paulb/acerepository/cnf/cache/OSGI-OPT/bnd.bnd URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/cache/OSGI-OPT/bnd.bnd?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/cnf/cache/OSGI-OPT/bnd.bnd (added) +++ ace/sandbox/paulb/acerepository/cnf/cache/OSGI-OPT/bnd.bnd Thu Jun 14 16:38:53 2012 @@ -0,0 +1,8 @@ +#Generated by BND, at Wed Jun 13 10:12:57 CEST 2012 +#Wed Jun 13 10:12:57 CEST 2012 +Bundle-Version=1.1.0.RC2-120613-1012 +-includeresource= +-resourceonly=true +Service-Component= +Include-Resource=biz.aQute.launcher/\=${repo;biz.aQute.launcher;[1.0.3,2)},biz.aQute.junit/\=${repo;biz.aQute.junit;[1.0.3,2)} +project.dir=/Users/paul/work/bndtools-master/org.bndtools.embeddedrepo Added: ace/sandbox/paulb/acerepository/cnf/cache/biz.aQute.junit/biz.aQute.junit-1.1.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/cache/biz.aQute.junit/biz.aQute.junit-1.1.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/cache/biz.aQute.junit/biz.aQute.junit-1.1.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/cache/biz.aQute.launcher/biz.aQute.launcher-1.0.3.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/cache/biz.aQute.launcher/biz.aQute.launcher-1.0.3.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/cache/biz.aQute.launcher/biz.aQute.launcher-1.0.3.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/ext/defaults.bnd URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/ext/defaults.bnd?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/cnf/ext/defaults.bnd (added) +++ ace/sandbox/paulb/acerepository/cnf/ext/defaults.bnd Thu Jun 14 16:38:53 2012 @@ -0,0 +1,29 @@ +# General Options +project.dependson = ${p-dependson;:} +project.bootclasspath = ${p-bootclasspath;:} +project.buildpath = ${p-buildpath;:} +project.sourcepath = ${p-sourcepath;:} +project.allsourcepath = ${p-allsourcepath;:} +project.output = ${p-output} +project.testpath = ${p-testpath;:} + +-verbose: true +project: ${basedir} +src: src +bin: bin +target-dir: generated +target: ${project}/${target-dir} +build: ${workspace}/cnf +p: ${basename;${project}} +project.name: ${p} + +# Java Compiler Options +java: java +javac: javac +javac.source: 1.5 +javac.target: 1.5 +javac.debug: on + +# Bnd Options +-sources: true +-sourcepath: ${project}/src Added: ace/sandbox/paulb/acerepository/cnf/ext/repositories.bnd URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/ext/repositories.bnd?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/cnf/ext/repositories.bnd (added) +++ ace/sandbox/paulb/acerepository/cnf/ext/repositories.bnd Thu Jun 14 16:38:53 2012 @@ -0,0 +1,18 @@ +plugindir: ${workspace}/cnf/plugins + +-pluginpath:\ + ${plugindir}/biz.aQute.repository/biz.aQute.repository-1.0.0.jar,\ + ${plugindir}/org.osgi.impl.bundle.bindex/org.osgi.impl.bundle.bindex-2.2.0.jar,\ + ${workspace}/org.apache.ace.bnd.repository/generated/org.apache.ace.bnd.repository.jar + + +-plugin:\ + aQute.lib.deployer.obr.LocalOBR; name='Release'; local=${workspace}/cnf/releaserepo,\ + aQute.lib.deployer.FileRepo; name=Build; location=${workspace}/cnf/buildrepo;,\ + aQute.lib.deployer.obr.LocalOBR; name='Local'; local=${workspace}/cnf/localrepo,\ + aQute.lib.deployer.obr.OBR; name='Bndtools Hub'; locations='http://bundles.bndtools.org/repository.xml',\ + org.osgi.impl.bundle.bindex.BundleIndexerImpl,\ + org.apache.ace.bnd.repository.AceRepository;name='Apache ACE'; location='http://localhost:8080' + + +-releaserepo: Release \ No newline at end of file Added: ace/sandbox/paulb/acerepository/cnf/localrepo/com.springsource.org.apache.commons.httpclient/com.springsource.org.apache.commons.httpclient-3.1.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/localrepo/com.springsource.org.apache.commons.httpclient/com.springsource.org.apache.commons.httpclient-3.1.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/localrepo/com.springsource.org.apache.commons.httpclient/com.springsource.org.apache.commons.httpclient-3.1.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/localrepo/jackson-core-asl/jackson-core-asl-1.9.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/localrepo/jackson-core-asl/jackson-core-asl-1.9.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/localrepo/jackson-core-asl/jackson-core-asl-1.9.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/localrepo/jackson-mapper-asl/jackson-mapper-asl-1.9.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/localrepo/jackson-mapper-asl/jackson-mapper-asl-1.9.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/localrepo/jackson-mapper-asl/jackson-mapper-asl-1.9.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/localrepo/repository.xml URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/localrepo/repository.xml?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/cnf/localrepo/repository.xml (added) +++ ace/sandbox/paulb/acerepository/cnf/localrepo/repository.xml Thu Jun 14 16:38:53 2012 @@ -0,0 +1,297 @@ + + + + + + + 308181 + + +

+

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + + Import package javax.crypto + + + Import package javax.crypto.spec + + + Import package javax.net + + + Import package javax.net.ssl + + + Import package org.apache.commons.codec ;version=[1.3.0,2.0.0) + + + Import package org.apache.commons.codec.binary ;version=[1.3.0,2.0.0) + + + Import package org.apache.commons.codec.net ;version=[1.3.0,2.0.0) + + + Import package org.apache.commons.logging ;version=[1.1.1,2.0.0) + + + + + 228294 + + + http://www.apache.org/licenses/LICENSE-2.0.txt + + +

+

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+ + +

+

+

+ + +

+

+

+ + +

+

+ + + Import package org.codehaus.jackson ;version=1.9.0 + + + Import package org.codehaus.jackson.annotate ;version=1.9.0 + + + Import package org.codehaus.jackson.format ;version=1.9.0 + + + Import package org.codehaus.jackson.impl ;version=1.9.0 + + + Import package org.codehaus.jackson.io ;version=1.9.0 + + + Import package org.codehaus.jackson.sym ;version=1.9.0 + + + Import package org.codehaus.jackson.type ;version=1.9.0 + + + Import package org.codehaus.jackson.util ;version=1.9.0 + + + Execution Environment (|(ee=J2SE-1.5)(ee=JavaSE-1.6)) + + + + + 764083 + + + http://www.apache.org/licenses/LICENSE-2.0.txt + + +

+

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + +

+

+

+ + + Import package javax.xml.datatype + + + Import package javax.xml.namespace + + + Import package javax.xml.parsers + + + Import package org.codehaus.jackson ;version=1.9.0 + + + Import package org.codehaus.jackson.annotate ;version=1.9.0 + + + Import package org.codehaus.jackson.format ;version=1.9.0 + + + Import package org.codehaus.jackson.impl ;version=1.9.0 + + + Import package org.codehaus.jackson.io ;version=1.9.0 + + + Import package org.codehaus.jackson.type ;version=1.9.0 + + + Import package org.codehaus.jackson.util ;version=1.9.0 + + + Import package org.w3c.dom + + + Import package org.xml.sax + + + Execution Environment (|(ee=J2SE-1.5)(ee=JavaSE-1.6)) + + + \ No newline at end of file Added: ace/sandbox/paulb/acerepository/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-1.52.3.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-1.52.3.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/plugins/biz.aQute.bnd/biz.aQute.bnd-1.52.3.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/plugins/biz.aQute.repository/biz.aQute.repository-1.0.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/plugins/biz.aQute.repository/biz.aQute.repository-1.0.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/plugins/biz.aQute.repository/biz.aQute.repository-1.0.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/plugins/org.osgi.impl.bundle.bindex/org.osgi.impl.bundle.bindex-2.2.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/plugins/org.osgi.impl.bundle.bindex/org.osgi.impl.bundle.bindex-2.2.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/cnf/plugins/org.osgi.impl.bundle.bindex/org.osgi.impl.bundle.bindex-2.2.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/cnf/releaserepo/repository.xml URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/cnf/releaserepo/repository.xml?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/cnf/releaserepo/repository.xml (added) +++ ace/sandbox/paulb/acerepository/cnf/releaserepo/repository.xml Thu Jun 14 16:38:53 2012 @@ -0,0 +1,2 @@ + + \ No newline at end of file Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.classpath URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.classpath?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.classpath (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.classpath Thu Jun 14 16:38:53 2012 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.project URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.project?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.project (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/.project Thu Jun 14 16:38:53 2012 @@ -0,0 +1,23 @@ + + + org.apache.ace.bnd.repository + + + + + + org.eclipse.jdt.core.javabuilder + + + + + bndtools.core.bndbuilder + + + + + + org.eclipse.jdt.core.javanature + bndtools.core.bndnature + + Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/bnd.bnd URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/bnd.bnd?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/bnd.bnd (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/bnd.bnd Thu Jun 14 16:38:53 2012 @@ -0,0 +1,9 @@ +-includeresource: @libs/com.springsource.org.apache.commons.codec-1.3.0.jar,\ + @libs/com.springsource.org.apache.commons.httpclient-3.1.0.jar,\ + @libs/com.springsource.org.apache.commons.logging-1.1.1.jar,\ + @libs/gson-1.7.1.jar,\ + @libs/org.amdatu.ace.client-0.0.1-SNAPSHOT.jar,\ + @libs/org.apache.commons.io-2.1.0.jar +Private-Package: org.apache.ace.bnd.repository +-buildpath: biz.aQute.bndlib;version=1.44,\ + org.mockito.mockito-all \ No newline at end of file Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/build.xml URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/build.xml?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/build.xml (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/build.xml Thu Jun 14 16:38:53 2012 @@ -0,0 +1,7 @@ + + + + + + + Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.codec-1.3.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.codec-1.3.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.codec-1.3.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.httpclient-3.1.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.httpclient-3.1.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.httpclient-3.1.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.logging-1.1.1.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.logging-1.1.1.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/com.springsource.org.apache.commons.logging-1.1.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/gson-1.7.1.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/gson-1.7.1.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/gson-1.7.1.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/org.amdatu.ace.client-0.0.1-SNAPSHOT.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/org.amdatu.ace.client-0.0.1-SNAPSHOT.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/org.amdatu.ace.client-0.0.1-SNAPSHOT.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/org.apache.commons.io-2.1.0.jar URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/org.apache.commons.io-2.1.0.jar?rev=1350321&view=auto ============================================================================== Binary file - no diff available. Propchange: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/libs/org.apache.commons.io-2.1.0.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepository.java URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepository.java?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepository.java (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepository.java Thu Jun 14 16:38:53 2012 @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ace.bnd.repository; + +import java.io.File; +import java.util.List; + +import org.amdatu.ace.client.model.Artifact; + +import aQute.lib.osgi.Jar; +/** + * Interface that contains the required methods to communicate with an actual ACE server. + */ +public interface AceRemoteRepository { + + List listArtifacts(); + + File downloadRemoteArtifact(String url, String obrDir); + + Artifact uploadArtifact(Jar jar, String obrUrl); +} \ No newline at end of file Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepositoryClientDefaultImpl.java URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepositoryClientDefaultImpl.java?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepositoryClientDefaultImpl.java (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRemoteRepositoryClientDefaultImpl.java Thu Jun 14 16:38:53 2012 @@ -0,0 +1,145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.ace.bnd.repository; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import org.amdatu.ace.client.AceClient; +import org.amdatu.ace.client.AceClientException; +import org.amdatu.ace.client.AceClientWorkspace; +import org.amdatu.ace.client.model.Artifact; +import org.amdatu.ace.client.model.ArtifactBuilder; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.URI; +import org.apache.commons.httpclient.methods.InputStreamRequestEntity; +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.RequestEntity; +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; + +import aQute.lib.osgi.Jar; + +/** + * Implementation that does the actual communication with the ACE server using the REST interface and the OBR directly. + */ +public class AceRemoteRepositoryClientDefaultImpl implements AceRemoteRepository { + private String m_aceUrl; + + public AceRemoteRepositoryClientDefaultImpl(String aceUrl) { + m_aceUrl = aceUrl; + } + + @Override + public List listArtifacts() { + try { + AceClient aceClient = new AceClient(m_aceUrl + "/client/work"); + AceClientWorkspace workspace = aceClient.createNewWorkspace(); + Artifact[] resources = workspace.getResources(Artifact.class); + List result = new ArrayList(); + + for (Artifact artifact : resources) { + if (artifact.getBundleSymbolicName() != null) { + result.add(artifact); + } + } + + workspace.remove(); + return result; + } catch (AceClientException e) { + throw new RuntimeException(e); + } + } + + @Override + public File downloadRemoteArtifact(String url, String obrDir) { + File artifactFile = new File(obrDir, url.substring(url.lastIndexOf("/"))); + if (!artifactFile.exists()) { + InputStream inputStream = null; + + try { + inputStream = new URL(url).openConnection().getInputStream(); + FileUtils.writeByteArrayToFile(artifactFile, IOUtils.toByteArray(inputStream)); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + } + + return artifactFile; + } + + public Artifact uploadArtifact(Jar jar, String obrUrl) { + HttpClient httpClient = new HttpClient(); + PostMethod post = new PostMethod(); + + try { + String generatedJarName = jar.getBsn() + "-" + jar.getVersion() + ".jar"; + String fileUrl = obrUrl + generatedJarName; + post.setURI(new URI(fileUrl, false)); + Artifact artifact = new ArtifactBuilder().setBundleSymbolicName(jar.getBsn()) + .setBundleVersion(jar.getVersion()).setBundleName(jar.getName()).setUrl(fileUrl) + .setName(generatedJarName).setMimeType("application/vnd.osgi.bundle").build(); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + jar.write(out); + InputStream decodedInput = new ByteArrayInputStream(((ByteArrayOutputStream) out).toByteArray()); + + RequestEntity requestEntity = new InputStreamRequestEntity(decodedInput); + + post.setRequestEntity(requestEntity); + httpClient.executeMethod(post); + AceClient aceClient = new AceClient(m_aceUrl + "/client/work"); + try { + AceClientWorkspace workspace = aceClient.createNewWorkspace(); + workspace.createResource(artifact); + workspace.commit(); + workspace.remove(); + } catch (AceClientException e) { + e.printStackTrace(); + } + + return artifact; + + } catch (Exception e) { + throw new RuntimeException(e); + + } finally { + } + + } +} Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRepository.java URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRepository.java?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRepository.java (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/src/org/apache/ace/bnd/repository/AceRepository.java Thu Jun 14 16:38:53 2012 @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.ace.bnd.repository; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.amdatu.ace.client.model.Artifact; + +import aQute.bnd.service.Plugin; +import aQute.bnd.service.RepositoryPlugin; +import aQute.lib.osgi.Jar; +import aQute.libg.reporter.Reporter; +import aQute.libg.version.Version; +import aQute.libg.version.VersionRange; + +/** + * Implementation of the RepositoryPlugin interface as used by BND. + */ +public class AceRepository implements RepositoryPlugin, Plugin { + private static final String ACEURL_PROPERTY = "aceurl"; + private static final String OBR_DIR_PROPERTY = "obrdir"; + private static final String NAME_PROPERTY = "name"; + private String m_obrCacheDir; + private AceRemoteRepository m_remoteRepository; + private String m_name; + private String m_aceUrl; + + public AceRepository() { + + } + + public AceRepository(AceRemoteRepository aceRemoteRepository) { + m_remoteRepository = aceRemoteRepository; + } + + @Override + public void setProperties(Map map) { + m_aceUrl = map.containsKey(ACEURL_PROPERTY) ? map.get(ACEURL_PROPERTY) : "http://localhost:8080"; + String obrCacheDir = map.containsKey(OBR_DIR_PROPERTY) ? map.get(OBR_DIR_PROPERTY) : System.getProperty("java.io.tmpdir"); + obrCacheDir += "/obr"; + + m_obrCacheDir = obrCacheDir; + + m_name = map.containsKey(NAME_PROPERTY) ? map.get(NAME_PROPERTY) : "Apache ACE"; + m_remoteRepository = new AceRemoteRepositoryClientDefaultImpl(m_aceUrl); + } + + @Override + public void setReporter(Reporter processor) { + + } + + @Override + public File[] get(String bsn, String range) throws Exception { + SortedMap foundVersion = new TreeMap(); + for (Artifact artifact : m_remoteRepository.listArtifacts()) { + Version version = new Version(artifact.getBundleVersion()); + boolean exact = range.matches("[0-9]+\\.[0-9]+\\.[0-9]+"); + if ("latest".equals(range) || matchVersion(range, version, exact)) { + File downloadedFile = m_remoteRepository.downloadRemoteArtifact(artifact.getUrl(), m_obrCacheDir); + foundVersion.put(version, downloadedFile); + } + } + + File[] result = new File[foundVersion.size()]; + result = foundVersion.values().toArray(result); + if (!"latest".equals(range)) { + return result; + } else { + if (result.length > 0) { + return new File[] { result[0] }; + } else { + return new File[0]; + } + } + } + + @Override + public File get(String bsn, String range, Strategy strategy, Map properties) throws Exception { + File[] files = get(bsn, range); + + if (files.length == 0) { + return null; + } + + if (strategy == Strategy.EXACT) { + return files[0]; + } else if (strategy == Strategy.HIGHEST) { + return files[files.length - 1]; + } else if (strategy == Strategy.LOWEST) { + return files[0]; + } + + return null; + } + + private boolean matchVersion(String range, Version version, boolean exact) { + if (range == null || range.trim().length() == 0) + return true; + VersionRange vr = new VersionRange(range); + + boolean result; + if (exact) { + if (vr.isRange()) + result = false; + else + result = vr.getHigh().equals(version); + } else { + result = vr.includes(version); + } + return result; + } + + @Override + public boolean canWrite() { + return true; + } + + @Override + public File put(Jar jar) throws Exception { + Artifact artifact = m_remoteRepository.uploadArtifact(jar, m_aceUrl + "/obr/"); + + list(null); + return m_remoteRepository.downloadRemoteArtifact(artifact.getUrl(), m_obrCacheDir); + } + + @Override + public List list(String regex) throws Exception { + List names = new ArrayList(); + + for (Artifact artifact : m_remoteRepository.listArtifacts()) { + String bsn = artifact.getBundleSymbolicName(); + if (regex != null) { + Pattern pattern = Pattern.compile(regex); + Matcher matcher = pattern.matcher(bsn); + if (matcher.matches()) { + if(!names.contains(bsn)) { + names.add(bsn); + } + } + } else { + if(!names.contains(bsn)) { + names.add(bsn); + } + } + } + + return names; + } + + @Override + public List versions(String bsn) throws Exception { + List versions = new ArrayList(); + + for (Artifact artifact : m_remoteRepository.listArtifacts()) { + if (artifact.getBundleSymbolicName().equals(bsn)) { + versions.add(new Version(artifact.getBundleVersion())); + } + } + + return versions; + } + + @Override + public String getName() { + return m_name; + } + +} Added: ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/test/org/apache/ace/bnd/repository/AceRepositoryTest.java URL: http://svn.apache.org/viewvc/ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/test/org/apache/ace/bnd/repository/AceRepositoryTest.java?rev=1350321&view=auto ============================================================================== --- ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/test/org/apache/ace/bnd/repository/AceRepositoryTest.java (added) +++ ace/sandbox/paulb/acerepository/org.apache.ace.bnd.repository/test/org/apache/ace/bnd/repository/AceRepositoryTest.java Thu Jun 14 16:38:53 2012 @@ -0,0 +1,154 @@ +package org.apache.ace.bnd.repository; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.assertThat; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.when; + +import java.io.File; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import junit.framework.Assert; + +import org.amdatu.ace.client.model.ArtifactBuilder; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import aQute.bnd.service.RepositoryPlugin.Strategy; +import aQute.libg.version.Version; + +@RunWith(MockitoJUnitRunner.class) +public class AceRepositoryTest { + @Mock private AceRemoteRepository aceRemoteRepository; + private AceRepository aceRepository; + + @Before + public void before() throws Exception{ + aceRepository = new AceRepository(aceRemoteRepository); + + when(aceRemoteRepository.listArtifacts()).thenReturn( + Arrays.asList( + new ArtifactBuilder().setBundleSymbolicName("a").setBundleVersion("2.0.0").setUrl("a-2.0.0.jar").build(), + new ArtifactBuilder().setBundleSymbolicName("a").setBundleVersion("1.0.0").setUrl("a-1.0.0.jar").build(), + new ArtifactBuilder().setBundleSymbolicName("a").setBundleVersion("1.0.1").setUrl("a-1.0.1.jar").build(), + new ArtifactBuilder().setBundleSymbolicName("a").setBundleVersion("1.1.0").setUrl("a-1.1.0.jar").build(), + new ArtifactBuilder().setBundleSymbolicName("b").setBundleVersion("2.0.0").setUrl("a-2.0.0.jar").build(), + new ArtifactBuilder().setBundleSymbolicName("b").setBundleVersion("2.0.1").setUrl("a-2.0.1.jar").build())); + + aceRepository.setProperties(new HashMap()); + } + + @Test + public void testGetSingleExact() throws Exception { + File[] files = aceRepository.get("a", "1.0.0"); + assertThat(files.length, is(1)); + } + + @Test + public void testRange() throws Exception { + File[] files = aceRepository.get("a", "[1.0,2)"); + assertThat(files.length, is(3)); + } + + @Test + public void testRangeMinor() throws Exception { + File[] files = aceRepository.get("a", "[1.1,2)"); + assertThat(files.length, is(1)); + } + + @Test + public void testGetLatest() throws Exception { + + File file = new File("test.jar"); + when(aceRemoteRepository.downloadRemoteArtifact(any(String.class), any(String.class))).thenReturn(file); + aceRepository.setProperties(new HashMap()); + + File[] files = aceRepository.get("a", "latest"); + assertThat(files.length, is(1)); + assertThat(files[0].getName(), is("test.jar")); + } + + @Test + public void testGetSingleHighest() throws Exception { + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.0.0.jar"), any(String.class))).thenReturn(new File("a-1.0.0.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.0.1.jar"), any(String.class))).thenReturn(new File("a-1.0.1.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.1.0.jar"), any(String.class))).thenReturn(new File("a-1.1.0.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-2.0.0.jar"), any(String.class))).thenReturn(new File("a-2.0.0.jar")); + + File result = aceRepository.get("a", "[1.0.0,2)", Strategy.HIGHEST, null); + Assert.assertNotNull(result); + assertThat(result.getName(), is("a-1.1.0.jar")); + } + + @Test + public void testGetSingleLowest() throws Exception { + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.0.0.jar"), any(String.class))).thenReturn(new File("a-1.0.0.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.0.1.jar"), any(String.class))).thenReturn(new File("a-1.0.1.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.1.0.jar"), any(String.class))).thenReturn(new File("a-1.1.0.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-2.0.0.jar"), any(String.class))).thenReturn(new File("a-2.0.0.jar")); + + File result = aceRepository.get("a", "[1.0.0,2)", Strategy.LOWEST, null); + Assert.assertNotNull(result); + assertThat(result.getName(), is("a-1.0.0.jar")); + } + + @Test + public void testGetExact() throws Exception { + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.0.0.jar"), any(String.class))).thenReturn(new File("a-1.0.0.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.0.1.jar"), any(String.class))).thenReturn(new File("a-1.0.1.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-1.1.0.jar"), any(String.class))).thenReturn(new File("a-1.1.0.jar")); + when(aceRemoteRepository.downloadRemoteArtifact(eq("a-2.0.0.jar"), any(String.class))).thenReturn(new File("a-2.0.0.jar")); + + File result = aceRepository.get("a", "1.0.1", Strategy.EXACT, null); + Assert.assertNotNull(result); + assertThat(result.getName(), is("a-1.0.1.jar")); + } + + @Test + public void testCanWrite() { + assertThat(aceRepository.canWrite(), is(true)); + } + + @Test + public void testList() throws Exception { + List list = aceRepository.list(null); + assertThat(list.size(), is(2)); + } + + @Test + public void testVersions() throws Exception { + when(aceRemoteRepository.listArtifacts()).thenReturn( + Arrays.asList( + new ArtifactBuilder().setBundleSymbolicName("a").setBundleVersion("1.0.0").build(), + new ArtifactBuilder().setBundleSymbolicName("a").setBundleVersion("1.0.1").build(), + new ArtifactBuilder().setBundleSymbolicName("b").build())); + + aceRepository.setProperties(new HashMap()); + + List list = aceRepository.versions("a"); + assertThat(list.size(), is(2)); + assertThat(list.get(0).getMicro(), is(0)); + assertThat(list.get(1).getMicro(), is(1)); + } + + @Test + public void testGetDefaultName() { + assertThat(aceRepository.getName(), is("Apache ACE")); + } + + @Test + public void testGetName() { + Map map = new HashMap(); + map.put("name", "test"); + aceRepository.setProperties(map); + assertThat(aceRepository.getName(), is("test")); + } + +}