1 package org.apache.archiva.event.context;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
20 import org.apache.archiva.event.EventContext;
22 import java.io.Serializable;
23 import java.util.HashMap;
27 * This context provides repository data.
29 * @author Martin Schreier <martin_s@apache.org>
31 public class RepositoryContext implements EventContext, Serializable
33 private static final long serialVersionUID = -4172663291198878307L;
35 private static final String PREFIX = "repository";
37 private final String id;
38 private final String type;
39 private final String flavour;
41 public RepositoryContext( String id, String type, String flavour )
45 this.flavour = flavour;
49 * Returns the repository id
50 * @return the repository id
52 public String getId( )
58 * Returns the repository type (e.g. MAVEN)
59 * @return the string representation of the repository type
61 public String getType( )
67 * Returns the repository flavour (e.g. Remote, Managed, Group)
70 public String getFlavour( )
76 public Map<String, String> getData( )
78 Map<String, String> values = new HashMap<>( );
79 values.put( PREFIX+".id", id );
80 values.put( PREFIX+".type", type );
81 values.put( PREFIX+".flavour", flavour );
86 public String getPrefix( )