View Javadoc

1   /*
2    * Copyright 2023 Bloomreach B.V. (https://www.bloomreach.com)
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *         http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.onehippo.forge.camel.component.hippo;
17  
18  import java.util.HashMap;
19  import java.util.Map;
20  
21  import org.apache.camel.Endpoint;
22  import org.apache.camel.support.DefaultComponent;
23  import org.slf4j.Logger;
24  import org.slf4j.LoggerFactory;
25  
26  /**
27   * 
28   */
29  public class HippoEventComponent extends DefaultComponent {
30  
31      private static final Logger LOG = LoggerFactory.getLogger(HippoEventComponent.class);
32  
33      @Override
34      protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> properties) throws Exception {
35          Map<String, Object> endPointProps;
36  
37          if (properties == null) {
38              endPointProps = new HashMap<String, Object>();
39          } else {
40              endPointProps = new HashMap<String, Object>(properties);
41              properties.clear();
42          }
43  
44          HippoEventEndpoint endpoint = new HippoEventEndpoint(uri, this, endPointProps);
45  
46          return endpoint;
47      }
48  }