summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-repository-admin
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-08-23 12:20:00 +0000
committerOlivier Lamy <olamy@apache.org>2011-08-23 12:20:00 +0000
commit0f0a3486c97300183cee73ad223d83c87b4f4e8a (patch)
tree0ae2110052afb4641a2cf98d0662258a9c765363 /archiva-modules/archiva-base/archiva-repository-admin
parentd27077404aa8bb2db886d46b1db79df1cd948dd1 (diff)
downloadarchiva-0f0a3486c97300183cee73ad223d83c87b4f4e8a.tar.gz
archiva-0f0a3486c97300183cee73ad223d83c87b4f4e8a.zip
start working on interfaces for module archiva-repository-admin
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1160654 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-admin')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/pom.xml16
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryAdminException.java33
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepository.java196
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java20
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java124
5 files changed, 389 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/pom.xml
index 481a3df15..b013c8213 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/pom.xml
+++ b/archiva-modules/archiva-base/archiva-repository-admin/pom.xml
@@ -29,6 +29,22 @@
<name>Archiva Base :: Repository Admin</name>
<dependencies>
<dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryAdminException.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryAdminException.java
new file mode 100644
index 000000000..2116fd895
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/RepositoryAdminException.java
@@ -0,0 +1,33 @@
+package org.apache.archiva.admin.repository;
+/*
+ * 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.
+ */
+
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+public class RepositoryAdminException
+ extends Exception
+{
+ public RepositoryAdminException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepository.java
new file mode 100644
index 000000000..d55f9ac46
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepository.java
@@ -0,0 +1,196 @@
+package org.apache.archiva.admin.repository.managed;
+
+/*
+ * 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.
+ */
+
+import java.io.Serializable;
+
+/**
+ * @since 1.4
+ */
+public class ManagedRepository
+ implements Serializable
+{
+ private String id;
+
+ private String name;
+
+ private String url;
+
+ private String layout;
+
+ private boolean snapshots = false;
+
+ private boolean releases = false;
+
+ private boolean blockRedeployments;
+
+ private String cronExpression;
+
+ /**
+ * not need when creating the repo : only available when reading
+ */
+ private ManagedRepository stagingRepository;
+
+ public ManagedRepository()
+ {
+ // no op
+ }
+
+ public ManagedRepository( String id, String name, String url, String layout, boolean snapshots, boolean releases,
+ boolean blockRedeployments, String cronExpression )
+ {
+ this.id = id;
+ this.name = name;
+ this.url = url;
+ this.layout = layout;
+ this.snapshots = snapshots;
+ this.releases = releases;
+ this.blockRedeployments = blockRedeployments;
+ this.cronExpression = cronExpression;
+ }
+
+ public String getId()
+ {
+ return this.id;
+ }
+
+ public String getLayout()
+ {
+ return this.layout;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public String getUrl()
+ {
+ return this.url;
+ }
+
+
+ public boolean isReleases()
+ {
+ return this.releases;
+ }
+
+ /**
+ * Get null
+ */
+ public boolean isSnapshots()
+ {
+ return this.snapshots;
+ }
+
+ public void setId( String id )
+ {
+ this.id = id;
+ }
+
+ public void setLayout( String layout )
+ {
+ this.layout = layout;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ public void setReleases( boolean releases )
+ {
+ this.releases = releases;
+ }
+
+ public void setSnapshots( boolean snapshots )
+ {
+ this.snapshots = snapshots;
+ }
+
+ public void setUrl( String url )
+ {
+ this.url = url;
+ }
+
+ public boolean isBlockRedeployments()
+ {
+ return blockRedeployments;
+ }
+
+ public void setBlockRedeployments( boolean blockRedeployments )
+ {
+ this.blockRedeployments = blockRedeployments;
+ }
+
+ public String getCronExpression()
+ {
+ return cronExpression;
+ }
+
+ public void setCronExpression( String cronExpression )
+ {
+ this.cronExpression = cronExpression;
+ }
+
+ public ManagedRepository getStagingRepository()
+ {
+ return stagingRepository;
+ }
+
+
+ public void setStagingRepository( ManagedRepository stagingRepository )
+ {
+ this.stagingRepository = stagingRepository;
+ }
+
+ public int hashCode()
+ {
+ int result = 17;
+ result = 37 * result + ( id != null ? id.hashCode() : 0 );
+ return result;
+ }
+
+ public boolean equals( Object other )
+ {
+ if ( this == other )
+ {
+ return true;
+ }
+
+ if ( !( other instanceof ManagedRepository ) )
+ {
+ return false;
+ }
+
+ ManagedRepository that = (ManagedRepository) other;
+ boolean result = true;
+ result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+ return result;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "ManagedRepository{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", url='" + url + '\''
+ + ", layout='" + layout + '\'' + ", snapshots=" + snapshots + ", releases=" + releases
+ + ", blockRedeployments=" + blockRedeployments + ", cronExpression='" + cronExpression + '\'' + '}';
+ }
+} \ No newline at end of file
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java
index 64c880cb4..b425574f4 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdmin.java
@@ -19,11 +19,31 @@ package org.apache.archiva.admin.repository.managed;
*/
+import org.apache.archiva.admin.repository.RepositoryAdminException;
+
+import java.util.List;
+
/**
* @author Olivier Lamy
* @since 1.4
*/
public interface ManagedRepositoryAdmin
{
+ List<ManagedRepository> getManagedRepositories()
+ throws RepositoryAdminException;
+
+ ManagedRepository getManagedRepository( String repositoryId )
+ throws RepositoryAdminException;
+
+ Boolean deleteManagedRepository( String repositoryId )
+ throws RepositoryAdminException;
+
+ Boolean addManagedRepository( ManagedRepository managedRepository, boolean needStageRepo )
+ throws RepositoryAdminException;
+
+
+ Boolean updateManagedRepository( ManagedRepository managedRepository, boolean needStageRepo )
+ throws RepositoryAdminException;
+
}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java
new file mode 100644
index 000000000..7b060f044
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/RemoteRepository.java
@@ -0,0 +1,124 @@
+package org.apache.archiva.admin.repository.remote;
+
+/*
+ * 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.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+
+
+public class RemoteRepository
+ implements Serializable
+{
+ private String id;
+
+ private String name;
+
+ private String url;
+
+ private String layout;
+
+ public RemoteRepository()
+ {
+ // no op
+ }
+
+ public RemoteRepository( String id, String name, String url, String layout )
+ {
+ this.id = id;
+ this.name = name;
+ this.url = url;
+ this.layout = layout;
+ }
+
+
+ public String getId()
+ {
+ return this.id;
+ }
+
+ public String getLayout()
+ {
+ return this.layout;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public String getUrl()
+ {
+ return this.url;
+ }
+
+
+ public void setId( String id )
+ {
+ this.id = id;
+ }
+
+ public void setLayout( String layout )
+ {
+ this.layout = layout;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ public void setUrl( String url )
+ {
+ this.url = url;
+ }
+
+
+ public int hashCode()
+ {
+ int result = 17;
+ result = 37 * result + ( id != null ? id.hashCode() : 0 );
+ return result;
+ }
+
+ public boolean equals( Object other )
+ {
+ if ( this == other )
+ {
+ return true;
+ }
+
+ if ( !( other instanceof RemoteRepository ) )
+ {
+ return false;
+ }
+
+ RemoteRepository that = (RemoteRepository) other;
+ boolean result = true;
+ result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
+ return result;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "RemoteRepository{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", url='" + url + '\''
+ + ", layout='" + layout + '\'' + '}';
+ }
+} \ No newline at end of file