]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1490] REST services : expose repository scanning configuration : missed to add...
authorOlivier Lamy <olamy@apache.org>
Fri, 9 Sep 2011 14:38:45 +0000 (14:38 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 9 Sep 2011 14:38:45 +0000 (14:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1167219 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileType.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RepositoryScanning.java [new file with mode: 0644]

diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileType.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/FileType.java
new file mode 100644 (file)
index 0000000..489c456
--- /dev/null
@@ -0,0 +1,127 @@
+package org.apache.archiva.rest.api.model;
+/*
+ * 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;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+@XmlRootElement( name = "fileType" )
+public class FileType
+    implements Serializable
+{
+    /**
+     * Field id.
+     */
+    private String id;
+
+    /**
+     * Field patterns.
+     */
+    private List<String> patterns;
+
+    public FileType()
+    {
+        // no op
+    }
+
+    public FileType( String id, List<String> patterns )
+    {
+        this.id = id;
+        this.patterns = patterns;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    public List<String> getPatterns()
+    {
+        if ( patterns == null )
+        {
+            this.patterns = new ArrayList<String>();
+        }
+        return patterns;
+    }
+
+    public void setPatterns( List<String> patterns )
+    {
+        this.patterns = patterns;
+    }
+
+    public void addPattern( String pattern )
+    {
+        getPatterns().add( pattern );
+    }
+
+    public void removePattern( String pattern )
+    {
+        getPatterns().remove( pattern );
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        FileType fileType = (FileType) o;
+
+        if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return id != null ? 37 + id.hashCode() : 0;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "FileType" );
+        sb.append( "{id='" ).append( id ).append( '\'' );
+        sb.append( ", patterns=" ).append( patterns );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RepositoryScanning.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RepositoryScanning.java
new file mode 100644 (file)
index 0000000..2810e20
--- /dev/null
@@ -0,0 +1,116 @@
+package org.apache.archiva.rest.api.model;
+/*
+ * 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 org.apache.archiva.admin.repository.admin.FileType;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Olivier Lamy
+ */
+@XmlRootElement( name = "repositoryScanning" )
+public class RepositoryScanning
+    implements Serializable
+{
+    /**
+     * Field fileTypes.
+     */
+    private List<FileType> fileTypes;
+
+    /**
+     * Field knownContentConsumers.
+     */
+    private List<String> knownContentConsumers;
+
+    /**
+     * Field invalidContentConsumers.
+     */
+    private List<String> invalidContentConsumers;
+
+    public RepositoryScanning()
+    {
+        // no op
+    }
+
+    public RepositoryScanning( List<FileType> fileTypes,
+                               List<String> knownContentConsumers, List<String> invalidContentConsumers )
+    {
+        this.fileTypes = fileTypes;
+        this.knownContentConsumers = knownContentConsumers;
+        this.invalidContentConsumers = invalidContentConsumers;
+    }
+
+    public List<FileType> getFileTypes()
+    {
+        if ( this.fileTypes == null )
+        {
+            this.fileTypes = new ArrayList<FileType>();
+        }
+        return fileTypes;
+    }
+
+    public void setFileTypes( List<FileType> fileTypes )
+    {
+        this.fileTypes = fileTypes;
+    }
+
+    public List<String> getKnownContentConsumers()
+    {
+        if ( this.knownContentConsumers == null )
+        {
+            this.knownContentConsumers = new ArrayList<String>();
+        }
+        return knownContentConsumers;
+    }
+
+    public void setKnownContentConsumers( List<String> knownContentConsumers )
+    {
+        this.knownContentConsumers = knownContentConsumers;
+    }
+
+    public List<String> getInvalidContentConsumers()
+    {
+        if ( this.invalidContentConsumers == null )
+        {
+            this.invalidContentConsumers = new ArrayList<String>();
+        }
+        return invalidContentConsumers;
+    }
+
+    public void setInvalidContentConsumers( List<String> invalidContentConsumers )
+    {
+        this.invalidContentConsumers = invalidContentConsumers;
+    }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder();
+        sb.append( "RepositoryScanning" );
+        sb.append( "{fileTypes=" ).append( fileTypes );
+        sb.append( ", knownContentConsumers=" ).append( knownContentConsumers );
+        sb.append( ", invalidContentConsumers=" ).append( invalidContentConsumers );
+        sb.append( '}' );
+        return sb.toString();
+    }
+}