001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.camel.model.cloud; 018 019import javax.xml.bind.annotation.XmlAccessType; 020import javax.xml.bind.annotation.XmlAccessorType; 021import javax.xml.bind.annotation.XmlAttribute; 022import javax.xml.bind.annotation.XmlRootElement; 023 024import org.apache.camel.spi.Metadata; 025 026@Metadata(label = "routing,cloud,load-balancing") 027@XmlRootElement(name = "ribbonLoadBalancer") 028@XmlAccessorType(XmlAccessType.FIELD) 029public class RibbonServiceCallServiceLoadBalancerConfiguration extends ServiceCallServiceLoadBalancerConfiguration { 030 @XmlAttribute 031 private String namespace; 032 @XmlAttribute 033 private String username; 034 @XmlAttribute 035 private String password; 036 @XmlAttribute 037 private String clientName; 038 039 public RibbonServiceCallServiceLoadBalancerConfiguration() { 040 this(null); 041 } 042 043 public RibbonServiceCallServiceLoadBalancerConfiguration(ServiceCallDefinition parent) { 044 super(parent, "ribbon-service-load-balancer"); 045 } 046 047 // ************************************************************************* 048 // Properties 049 // ************************************************************************* 050 051 public String getNamespace() { 052 return namespace; 053 } 054 055 /** 056 * The namespace 057 */ 058 public void setNamespace(String namespace) { 059 this.namespace = namespace; 060 } 061 062 public String getUsername() { 063 return username; 064 } 065 066 /** 067 * The username 068 */ 069 public void setUsername(String username) { 070 this.username = username; 071 } 072 073 public String getPassword() { 074 return password; 075 } 076 077 /** 078 * The password 079 */ 080 public void setPassword(String password) { 081 this.password = password; 082 } 083 084 public String getClientName() { 085 return clientName; 086 } 087 088 /** 089 * Sets the Ribbon client name 090 */ 091 public void setClientName(String clientName) { 092 this.clientName = clientName; 093 } 094 095 // ************************************************************************* 096 // Fluent API 097 // ************************************************************************* 098 099 /** 100 * Sets the namespace 101 */ 102 public RibbonServiceCallServiceLoadBalancerConfiguration namespace(String namespace) { 103 setNamespace(namespace); 104 return this; 105 } 106 107 /** 108 * Sets the username 109 */ 110 public RibbonServiceCallServiceLoadBalancerConfiguration username(String username) { 111 setUsername(username); 112 return this; 113 } 114 115 /** 116 * Sets the password 117 */ 118 public RibbonServiceCallServiceLoadBalancerConfiguration password(String password) { 119 setPassword(password); 120 return this; 121 } 122 123 /** 124 * Sets the Ribbon client name 125 */ 126 public RibbonServiceCallServiceLoadBalancerConfiguration clientName(String clientName) { 127 setClientName(clientName); 128 return this; 129 } 130}