All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.storage.SharedAccessPolicy Maven / Gradle / Ivy

There is a newer version: 8.6.6
Show newest version
/**
 * Copyright Microsoft Corporation
 * 
 * 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 com.microsoft.azure.storage;

import java.util.Date;

/**
 * Represents a shared access policy, which specifies the start time, expiry time, and permissions for a shared access
 * signature.
 */
public abstract class SharedAccessPolicy {

    /**
     * The expiry time for a shared access signature associated with this shared access policy.
     */
    private Date sharedAccessExpiryTime;

    /**
     * The start time for a shared access signature associated with this shared access policy.
     */
    private Date sharedAccessStartTime;
    
    /**
     * Creates an instance of the SharedAccessPolicy class.
     */
    public SharedAccessPolicy() {
        // Empty Default Constructor.
    }
    
    /**
     * Gets the expiry time for a shared access signature associated with this shared access policy.
     * 
     * @return A java.util.Date object which contains the shared access signature expiry time.
     */
    public Date getSharedAccessExpiryTime() {
        return this.sharedAccessExpiryTime;
    }

    /**
     * Gets the start time for a shared access signature associated with this shared access policy.
     * 
     * @return A java.util.Date object which contains the shared access signature start time.
     */
    public Date getSharedAccessStartTime() {
        return this.sharedAccessStartTime;
    }

    /**
     * Sets the expiry time for a shared access signature associated with this shared access policy.
     * 
     * @param sharedAccessExpiryTime
     *        A java.util.Date object which represents the expiry time to set for the shared access signature.
     */
    public void setSharedAccessExpiryTime(final Date sharedAccessExpiryTime) {
        this.sharedAccessExpiryTime = sharedAccessExpiryTime;
    }

    /**
     * Sets the start time for a shared access signature associated with this shared access policy.
     * 
     * @param sharedAccessStartTime
     *        A java.util.Date object which represents the start time to set for the shared access signature.
     */
    public void setSharedAccessStartTime(final Date sharedAccessStartTime) {
        this.sharedAccessStartTime = sharedAccessStartTime;
    }

    /**
     * Converts this shared access policy's permissions to a string.
     * 
     * @return A String which represents the shared access permissions.
     */
    public abstract String permissionsToString();

    /**
     * Sets shared access permissions using the specified permissions string.
     * 
     * @param value
     *        A String which represents the shared access permissions.
     **/
    public abstract void setPermissionsFromString(final String value);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy