com.adobe.cq.address.api.AddressManager Maven / Gradle / Ivy
/*************************************************************************
*
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2013 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by trade secret or copyright law.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
**************************************************************************/
package com.adobe.cq.address.api;
import java.util.Collection;
import java.util.Map;
/**
* The AddressManager
provides methods to retrieve, update, create and update addresses.
* @deprecated As of AEM 6.4
*/
@Deprecated
public interface AddressManager {
/**
* Returns the addresses belonging to a user.
*
* @param userID The user ID
* @return The addresses or null
if there are none
*/
public Collection getAddresses(String userID);
/**
* Returns the address based on a path if represented in the repository or based on an ID uniquely identifying
* the address in an external provider.
*
* @param userID The user ID
* @param path The path identifying the address or an ID uniquely identifying the address in an external provider
*
* @return The address or null
if it does not exist or if it does not belong to the user
*/
public Address getAddress(String userID, String path);
/**
* Removes the address.
*
* @param userID The user ID
* @param address The address
* @param autoSave If true
the operation is persisted
* @throws AddressException when the address does not belong to the user or when the operation fails.
*/
public void removeAddress(String userID, Address address, boolean autoSave) throws AddressException;
/**
* Adds an address to the user.
*
* @param userID The user ID
* @param properties The address properties
* @param autoSave If true
the operation is persisted
* @return The new address
* @throws AddressException when the operation fails.
*/
public Address addAddress(String userID, Map properties, boolean autoSave) throws AddressException;
/**
* Updates the address.
*
* @param userID The user ID
* @param address The address
* @param properties The address properties
* @param autoSave If true
the operation is persisted
* @return The updated address
* @throws AddressException when the address does not belong to the user or when the operation fails.
*/
public Address updateAddress(String userID, Address address, Map properties, boolean autoSave) throws AddressException;
/**
* Returns the generic default address of the user.
*
* @param userID The user ID
* @return the generic default address of the user
*/
public Address getDefaultAddress(String userID);
/**
* Returns the default address that is defined for the given type (e.g.: billing, shipping.).
*
* @param userID The user ID
* @param type The type of the default address. E.g.: billing, shipping.
* If the type is null
or empty, the generic default address is returned.
* @return the generic default address of the user
*/
public Address getDefaultAddress(String userID, String type);
/**
* Sets the generic default address of the user.
*
* @param userID The user ID
* @param address The address
* @param autoSave If true
the operation is persisted
* @throws AddressException when the address does not belong to the user or when the operation fails.
*/
public void setDefaultAddress(String userID, Address address, boolean autoSave) throws AddressException;
/**
* Sets the default address for the given type (e.g.: billing, shipping.).
*
* @param userID The user ID
* @param address The address
* @param type The type of the default address. E.g.: billing, shipping.
* If the given type is null
or empty, the generic default address is set.
* @param autoSave If true
the operation is persisted
* @throws AddressException when the address does not belong to the user or when the operation fails.
*/
public void setDefaultAddress(String userID, Address address, String type, boolean autoSave) throws AddressException;
}