
org.jclouds.aws.sqs.options.CreateQueueOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jclouds-aws Show documentation
Show all versions of jclouds-aws Show documentation
jclouds Core components to access Amazon AWS
The newest version!
/**
*
* Copyright (C) 2010 Cloud Conscious, LLC.
*
* ====================================================================
* Licensed 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.
* ====================================================================
*/
package org.jclouds.aws.sqs.options;
import org.jclouds.http.options.BaseHttpRequestOptions;
/**
* Contains options supported in the Form API for the CreateQueue operation.
* Usage
The recommended way to instantiate a CreateQueueOptions object is to statically import
* CreateQueueOptions.Builder.* and invoke a static creation method followed by an instance mutator
* (if needed):
*
*
* import static org.jclouds.aws.sqs.options.CreateQueueOptions.Builder.*
*
* SQSClient connection = // get connection
* Queue queue = connection.createQueueInRegion(defaultVisibilityTimeout("foo"));
*
*
* @author Adrian Cole
* @see
*/
public class CreateQueueOptions extends BaseHttpRequestOptions {
/**
* A default value for the queue's visibility timeout (30 seconds) is set when the queue is
* created. You can override this value with the DefaultVisibilityTimeout request parameter. For
* more information, see Visibility Timeout in the Amazon SQS Developer Guide.
*
* @param seconds
* The visibility timeout (in seconds) to use for this queue. 0 to 43200 (maximum 12
* hours); Default: 30 seconds
*/
public CreateQueueOptions defaultVisibilityTimeout(int seconds) {
//TODO validate
formParameters.put("DefaultVisibilityTimeout", seconds+"");
return this;
}
public String getRestorableBy() {
return getFirstFormOrNull("DefaultVisibilityTimeout");
}
public static class Builder {
/**
* @see CreateQueueOptions#defaultVisibilityTimeout(int )
*/
public static CreateQueueOptions defaultVisibilityTimeout(int seconds) {
CreateQueueOptions options = new CreateQueueOptions();
return options.defaultVisibilityTimeout(seconds);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy