com.ibm.commerce.tools.contract.beans

Class AccountDataBean

  • java.lang.Object
    • com.ibm.commerce.tools.contract.beans.AccountDataBean
  • All Implemented Interfaces:
    com.ibm.commerce.beans.DataBean, com.ibm.commerce.beans.InputDataBean, com.ibm.commerce.beans.SmartDataBean, com.ibm.commerce.security.Delegator, com.ibm.commerce.security.Protectable, java.io.Serializable


    public class AccountDataBean
    extends java.lang.Object
    implements com.ibm.commerce.beans.SmartDataBean, com.ibm.commerce.security.Protectable, com.ibm.commerce.security.Delegator
    This data bean represents an account object. Account is the starting point for managing a store’s relationships with customer organizations. For example, an account records how invoices are delivered to the customer organization. When retrieving the data associated with an account, the data bean will be called. Sets an existing account id and language identifiers, or an existing AccountAccessBean and language identifier can construct an AccountDataBean. The data bean maps to a database table ACCOUNT
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from interface com.ibm.commerce.beans.DataBean

        emptyString
    • Constructor Summary

      Constructors 
      Constructor and Description
      AccountDataBean()
      Constructs an AccountDataBean.
      AccountDataBean(com.ibm.commerce.payment.objects.AccountAccessBean newAccountAccessBean, java.lang.Integer newLangId)
      Constructs an AccountDataBean by retrieving the account identifier from an existing AccountAccessBean
      AccountDataBean(java.lang.Long newAccountId, java.lang.Integer newLangId)
      Constructs an AccountDataBean from an existing account identifier
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Long findAccountForUserInStoreFromEligibleContracts(java.lang.Long memberId, java.lang.Integer storeId)
      Determines the business account for a given member in a store from their eligible contracts.
      java.lang.Long findAccountForUserInStoreFromOrganization(java.lang.Long memberId, java.lang.Integer storeId)
      Determines the business account for a given member in a store from their organization hierarchy.
      java.lang.Long findAccountHolderFromAccountForUserInStoreFromEligibleContracts(java.lang.Long memberId, java.lang.Integer storeId)
      Determines the account holder of a business account for a given member in a store from their eligible contracts.
      java.lang.Long findAccountHolderFromAccountForUserInStoreFromOrganization(java.lang.Long memberId, java.lang.Integer storeId)
      Determines the account holder of a business account for a given member in a store from their organization hierarchy.
      boolean fulfills(java.lang.Long member, java.lang.String relationship)
      Determines if a given member fulfills a given relationship with the resource.
      java.lang.String getAccountId()
      Gets the account identifier
      java.lang.String getAccountName()
      Gets the name of the account.
      java.lang.String getAccountRemarks()
      Gets the remarks in the account If it can't get the remarks in the account, it will return null.
      boolean getAllowCatalogPurchases()
      Returns if the user can purchase under the default contract
      com.ibm.commerce.command.CommandContext getCommandContext()
      Returns the current command's context
      java.lang.String getCustomerContactId()
      Gets the member id of the customer contact person.
      java.lang.String getCustomerContactInformation()
      Gets the customer contact information.
      java.lang.String getCustomerContactName()
      Gets the name of the customer contact person.
      java.lang.String getCustomerId()
      Gets the customer organization identifier.
      java.lang.String getCustomerName()
      Gets the name of the customer organization.
      com.ibm.commerce.security.Protectable getDelegate()
      Returns the access control delegate of this data bean
      boolean getMustUsePriceListPreference()
      Returns if the contracts under the account must use the price list preference
      java.lang.String getNumberOfContracts()
      Returns the number of contracts in this account
      java.lang.Long getOwner()
      Returns the member reference number of the owner of this account
      java.lang.String getOwnerReferenceNumber()
      Gets the member reference number of the owner of the account.
      java.lang.String getPriceListPreference()
      Gets the contract price list preference.
      java.lang.String getRepresentativeContactId()
      Gets the member reference number of the representative contact person.
      java.lang.String getRepresentativeContactName()
      Gets the name of the representative contact person.
      java.lang.String getRepresentativeId()
      Gets the member reference number of the account representative organization. If it can't get the number, it will return null.
      java.lang.String getRepresentativeName()
      Gets the name of the account representative organization.
      com.ibm.commerce.datatype.TypedProperty getRequestProperties()
      Gets the request properties
      java.lang.String getSellingOrgId()
      Gets the member reference number of the selling organization
      java.lang.String getSellingOrgName()
      Gets the name of the selling organization.
      java.lang.String getStoreId()
      Gets the store identifier in which to find the account
      java.lang.String getUpdateDate()
      Gets the update date of the contract If it can't get the date, it will return null.
      void populate()
      This method is used to populate the attributes from AccountAccessBean.
      void setAccountId(java.lang.String newAccountId)
      Sets the ID of the account
      void setAccountName(java.lang.String newAccountName)
      Sets the name of the account
      void setCommandContext(com.ibm.commerce.command.CommandContext newICommandContext)
      Sets the command context
      void setContractId(java.lang.String param)
      Sets the contract identifier for access control purposes
      void setCustomerContactName(java.lang.String newCustomerContactName)
      Sets the name of the customer contact person
      void setCustomerName(java.lang.String newCustomerName)
      Sets the name of the customer organization
      void setNumberOfContracts(java.lang.String newNumberOfContracts)
      Sets the number of contracts in this account
      void setRepresentativeName(java.lang.String newRepresentativeName)
      Sets the name of the representative contact person
      void setRequestProperties(com.ibm.commerce.datatype.TypedProperty param)
      Sets the request properties.
      void setStoreId(java.lang.String newStoreId)
      Sets the store identifier in which to find the account
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AccountDataBean

        public AccountDataBean()
        Constructs an AccountDataBean.
      • AccountDataBean

        public AccountDataBean(com.ibm.commerce.payment.objects.AccountAccessBean newAccountAccessBean,
                               java.lang.Integer newLangId)
        Constructs an AccountDataBean by retrieving the account identifier from an existing AccountAccessBean
        Parameters:
        newAccountAccessBean - an existing AccountAccessBean
        newLangId - language identifier for which language to retrieve the data
      • AccountDataBean

        public AccountDataBean(java.lang.Long newAccountId,
                               java.lang.Integer newLangId)
        Constructs an AccountDataBean from an existing account identifier
        Parameters:
        newAccountId - an existing account identifier
        newLangId - the language identifier for which language to retrieve the data
    • Method Detail

      • findAccountForUserInStoreFromEligibleContracts

        public java.lang.Long findAccountForUserInStoreFromEligibleContracts(java.lang.Long memberId,
                                                                             java.lang.Integer storeId)
        Determines the business account for a given member in a store from their eligible contracts.
        Parameters:
        memberId - the member id
        storeId - the store id
        Returns:
        returnId account id
      • findAccountForUserInStoreFromOrganization

        public java.lang.Long findAccountForUserInStoreFromOrganization(java.lang.Long memberId,
                                                                        java.lang.Integer storeId)
        Determines the business account for a given member in a store from their organization hierarchy.
        Parameters:
        memberId - the member id
        storeId - the store id
        Returns:
        returnId account id
      • findAccountHolderFromAccountForUserInStoreFromEligibleContracts

        public java.lang.Long findAccountHolderFromAccountForUserInStoreFromEligibleContracts(java.lang.Long memberId,
                                                                                              java.lang.Integer storeId)
        Determines the account holder of a business account for a given member in a store from their eligible contracts.
        Parameters:
        memberId - the member id
        storeId - the store id
        Returns:
        returnId account holder member id
      • findAccountHolderFromAccountForUserInStoreFromOrganization

        public java.lang.Long findAccountHolderFromAccountForUserInStoreFromOrganization(java.lang.Long memberId,
                                                                                         java.lang.Integer storeId)
        Determines the account holder of a business account for a given member in a store from their organization hierarchy.
        Parameters:
        memberId - the member id
        storeId - the store id
        Returns:
        returnId account holder member id
      • fulfills

        public boolean fulfills(java.lang.Long member,
                                java.lang.String relationship)
                         throws java.lang.Exception
        Determines if a given member fulfills a given relationship with the resource.
        Specified by:
        fulfills in interface com.ibm.commerce.security.Protectable
        Parameters:
        member - the member id of the account
        relationship - the relationship the member has with respect to the resource
        Returns:
        true if the member fulfills the relationship with the resource; false otherwise.
        Throws:
        java.lang.Exception
      • getAccountId

        public java.lang.String getAccountId()
        Gets the account identifier
        Returns:
        the account identifier
      • getAccountName

        public java.lang.String getAccountName()
        Gets the name of the account. If it can't get the name of the account, it will return null.
        Returns:
        the name of the account.
      • getAccountRemarks

        public java.lang.String getAccountRemarks()
        Gets the remarks in the account If it can't get the remarks in the account, it will return null.
        Returns:
        the remarks in the account.
      • getAllowCatalogPurchases

        public boolean getAllowCatalogPurchases()
        Returns if the user can purchase under the default contract
        Returns:
        true if a user can purchase under the default contract; false otherwise.
      • getCommandContext

        public com.ibm.commerce.command.CommandContext getCommandContext()
        Returns the current command's context
        Specified by:
        getCommandContext in interface com.ibm.commerce.beans.SmartDataBean
        Returns:
        the current command's context
      • getCustomerContactId

        public java.lang.String getCustomerContactId()
        Gets the member id of the customer contact person. If it can't get the id, it will return null.
        Returns:
        the member id of the customer contact person.
      • getCustomerContactInformation

        public java.lang.String getCustomerContactInformation()
        Gets the customer contact information. If it can't get the info, it will return empty string "".
        Returns:
        the customer contact information.
      • getCustomerContactName

        public java.lang.String getCustomerContactName()
        Gets the name of the customer contact person. If it can't get the person, it will return empty string "".
        Returns:
        the name of the customer contact person.
      • getCustomerId

        public java.lang.String getCustomerId()
        Gets the customer organization identifier. If it can't get the identifier, it will return null.
        Returns:
        the customer organization identifier.
      • getCustomerName

        public java.lang.String getCustomerName()
        Gets the name of the customer organization. If it can't get the organization, it will return null.
        Returns:
        the name of the customer organization.
      • getDelegate

        public com.ibm.commerce.security.Protectable getDelegate()
                                                          throws java.lang.Exception
        Returns the access control delegate of this data bean
        Specified by:
        getDelegate in interface com.ibm.commerce.security.Delegator
        Returns:
        the access control delegate of this data bean
        Throws:
        java.lang.Exception
      • getMustUsePriceListPreference

        public boolean getMustUsePriceListPreference()
        Returns if the contracts under the account must use the price list preference
        Returns:
        true if a the account must use the price list preference; false otherwise.
      • getNumberOfContracts

        public java.lang.String getNumberOfContracts()
        Returns the number of contracts in this account
        Returns:
        the number of contracts in this account
      • getOwner

        public java.lang.Long getOwner()
                                throws java.lang.Exception
        Returns the member reference number of the owner of this account
        Specified by:
        getOwner in interface com.ibm.commerce.security.Protectable
        Returns:
        the member reference number of the owner of this account
        Throws:
        java.lang.Exception
      • getOwnerReferenceNumber

        public java.lang.String getOwnerReferenceNumber()
        Gets the member reference number of the owner of the account. If it can't get the number, it will return null.
        Returns:
        the member reference number of the owner of the account.
      • getPriceListPreference

        public java.lang.String getPriceListPreference()
        Gets the contract price list preference. If it can't get the list or the list is empty, it will return empty string "".
        Returns:
        the contract price list preference in the account
      • getRepresentativeContactId

        public java.lang.String getRepresentativeContactId()
        Gets the member reference number of the representative contact person. If it can't get the number, it will return null.
        Returns:
        the member reference number of the representative contact person.
      • getRepresentativeContactName

        public java.lang.String getRepresentativeContactName()
        Gets the name of the representative contact person. If it can't get the name, it will return empty string "".
        Returns:
        the name of the representative contact person.
      • getRepresentativeId

        public java.lang.String getRepresentativeId()
        Gets the member reference number of the account representative organization. If it can't get the number, it will return null.
        Returns:
        the member reference number of the account representative organization.
      • getRepresentativeName

        public java.lang.String getRepresentativeName()
        Gets the name of the account representative organization. If it can't get the name, it will return null.
        Returns:
        the name of the account representative organization.
      • getRequestProperties

        public com.ibm.commerce.datatype.TypedProperty getRequestProperties()
        Gets the request properties
        Specified by:
        getRequestProperties in interface com.ibm.commerce.beans.InputDataBean
        Returns:
        null at this point
      • getSellingOrgId

        public java.lang.String getSellingOrgId()
        Gets the member reference number of the selling organization
        Returns:
        the member reference number of the selling organization
      • getSellingOrgName

        public java.lang.String getSellingOrgName()
        Gets the name of the selling organization. If it can't get the name, it will return null.
        Returns:
        the name of the selling organization.
      • getStoreId

        public java.lang.String getStoreId()
        Gets the store identifier in which to find the account
        Returns:
        store identifier in which to find the account
      • getUpdateDate

        public java.lang.String getUpdateDate()
        Gets the update date of the contract If it can't get the date, it will return null.
        Returns:
        the update date of the contract
      • populate

        public void populate()
                      throws java.lang.Exception
        This method is used to populate the attributes from AccountAccessBean. Loads data into the data bean when the DataBeanManager.activate() runs.
        Specified by:
        populate in interface com.ibm.commerce.beans.SmartDataBean
        Throws:
        java.lang.Exception
      • setAccountId

        public void setAccountId(java.lang.String newAccountId)
        Sets the ID of the account
        Parameters:
        newAccountId - ID of the account
      • setAccountName

        public void setAccountName(java.lang.String newAccountName)
        Sets the name of the account
        Parameters:
        newAccountName - name of the account
      • setCommandContext

        public void setCommandContext(com.ibm.commerce.command.CommandContext newICommandContext)
        Sets the command context
        Specified by:
        setCommandContext in interface com.ibm.commerce.beans.SmartDataBean
        Parameters:
        newICommandContext - the command context to be set
      • setContractId

        public void setContractId(java.lang.String param)
        Sets the contract identifier for access control purposes
        Parameters:
        param - the contract identifier to be set
      • setCustomerContactName

        public void setCustomerContactName(java.lang.String newCustomerContactName)
        Sets the name of the customer contact person
        Parameters:
        newCustomerContactName - the name of the customer contract person
      • setCustomerName

        public void setCustomerName(java.lang.String newCustomerName)
        Sets the name of the customer organization
        Parameters:
        newCustomerName - the name of the customer organization
      • setNumberOfContracts

        public void setNumberOfContracts(java.lang.String newNumberOfContracts)
        Sets the number of contracts in this account
        Parameters:
        newNumberOfContracts - the number of contracts in this account
      • setRepresentativeName

        public void setRepresentativeName(java.lang.String newRepresentativeName)
        Sets the name of the representative contact person
        Parameters:
        newRepresentativeName - the representative contact person
      • setRequestProperties

        public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty param)
        Sets the request properties.
        Specified by:
        setRequestProperties in interface com.ibm.commerce.beans.InputDataBean
        Parameters:
        param - the request properties to be set
      • setStoreId

        public void setStoreId(java.lang.String newStoreId)
        Sets the store identifier in which to find the account
        Parameters:
        newStoreId - store identifier in which to find the account