| 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | * contributor license agreements. See the NOTICE file distributed with |
| 4 | * this work for additional information regarding copyright ownership. |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | * (the "License"); you may not use this file except in compliance with |
| 7 | * the License. You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | package org.jclouds.glesys.options; |
| 18 | |
| 19 | /** |
| 20 | * @author Adam Lowe |
| 21 | */ |
| 22 | public class UpdateRecordOptions extends AddRecordOptions { |
| 23 | |
| 24 | public static class Builder { |
| 25 | /** |
| 26 | * @see UpdateRecordOptions#host |
| 27 | */ |
| 28 | public static UpdateRecordOptions host(String host) { |
| 29 | return new UpdateRecordOptions().host(host); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @see UpdateRecordOptions#type |
| 34 | */ |
| 35 | public static UpdateRecordOptions type(String type) { |
| 36 | return new UpdateRecordOptions().type(type); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * @see UpdateRecordOptions#data |
| 41 | */ |
| 42 | public static UpdateRecordOptions data(String data) { |
| 43 | return new UpdateRecordOptions().data(data); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * @see UpdateRecordOptions#ttl |
| 48 | */ |
| 49 | public static UpdateRecordOptions ttl(int ttl) { |
| 50 | return UpdateRecordOptions.class.cast(new UpdateRecordOptions().ttl(ttl)); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | |
| 55 | /** Configure the hostname attached to this record */ |
| 56 | public UpdateRecordOptions host(String host) { |
| 57 | formParameters.put("host", host); |
| 58 | return this; |
| 59 | } |
| 60 | |
| 61 | /** Configure the type of record, ex. "A", "CNAME" or "MX" */ |
| 62 | public UpdateRecordOptions type(String type) { |
| 63 | formParameters.put("type", type); |
| 64 | return this; |
| 65 | } |
| 66 | |
| 67 | /** Set the content of this record (depending on type, for an "A" record this would be an ip address) */ |
| 68 | public UpdateRecordOptions data(String data) { |
| 69 | formParameters.put("data", data); |
| 70 | return this; |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public UpdateRecordOptions ttl(int ttl) { |
| 75 | return UpdateRecordOptions.class.cast(super.ttl(ttl)); |
| 76 | } |
| 77 | } |