Example usage for java.util SortedMap remove

List of usage examples for java.util SortedMap remove

Introduction

In this page you can find the example usage for java.util SortedMap remove.

Prototype

V remove(Object key);

Source Link

Document

Removes the mapping for a key from this map if it is present (optional operation).

Usage

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamISOTimezoneTable.java

public void deleteISOTimezone(CFAccAuthorization Authorization, CFAccISOTimezoneBuff Buff) {
    final String S_ProcName = "CFAccRamISOTimezoneTable.deleteISOTimezone() ";
    CFAccISOTimezonePKey pkey = schema.getFactoryISOTimezone().newPKey();
    pkey.setRequiredISOTimezoneId(Buff.getRequiredISOTimezoneId());
    CFAccISOTimezoneBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/* w  w  w.  j  a  v  a 2s. co m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOTimezone",
                pkey);
    }
    CFAccISOTimezoneByOffsetIdxKey keyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey();
    keyOffsetIdx.setRequiredTZHourOffset(existing.getRequiredTZHourOffset());
    keyOffsetIdx.setRequiredTZMinOffset(existing.getRequiredTZMinOffset());

    CFAccISOTimezoneByUTZNameIdxKey keyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey();
    keyUTZNameIdx.setRequiredTZName(existing.getRequiredTZName());

    CFAccISOTimezoneByIso8601IdxKey keyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey();
    keyIso8601Idx.setRequiredIso8601(existing.getRequiredIso8601());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAccISOTimezonePKey, CFAccISOTimezoneBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByOffsetIdx.get(keyOffsetIdx);
    subdict.remove(pkey);

    dictByUTZNameIdx.remove(keyUTZNameIdx);

    subdict = dictByIso8601Idx.get(keyIso8601Idx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamISOTimezoneTable.java

public void deleteISOTimezone(CFAstAuthorization Authorization, CFAstISOTimezoneBuff Buff) {
    final String S_ProcName = "CFAstRamISOTimezoneTable.deleteISOTimezone() ";
    CFAstISOTimezonePKey pkey = schema.getFactoryISOTimezone().newPKey();
    pkey.setRequiredISOTimezoneId(Buff.getRequiredISOTimezoneId());
    CFAstISOTimezoneBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from w w w  .  j a  va 2s. c  o m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteISOTimezone",
                pkey);
    }
    CFAstISOTimezoneByOffsetIdxKey keyOffsetIdx = schema.getFactoryISOTimezone().newOffsetIdxKey();
    keyOffsetIdx.setRequiredTZHourOffset(existing.getRequiredTZHourOffset());
    keyOffsetIdx.setRequiredTZMinOffset(existing.getRequiredTZMinOffset());

    CFAstISOTimezoneByUTZNameIdxKey keyUTZNameIdx = schema.getFactoryISOTimezone().newUTZNameIdxKey();
    keyUTZNameIdx.setRequiredTZName(existing.getRequiredTZName());

    CFAstISOTimezoneByIso8601IdxKey keyIso8601Idx = schema.getFactoryISOTimezone().newIso8601IdxKey();
    keyIso8601Idx.setRequiredIso8601(existing.getRequiredIso8601());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAstISOTimezonePKey, CFAstISOTimezoneBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByOffsetIdx.get(keyOffsetIdx);
    subdict.remove(pkey);

    dictByUTZNameIdx.remove(keyUTZNameIdx);

    subdict = dictByIso8601Idx.get(keyIso8601Idx);
    subdict.remove(pkey);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamSipConfTable.java

public void deleteSipConf(CFAstAuthorization Authorization, CFAstSipConfBuff Buff) {
    final String S_ProcName = "CFAstRamSipConfTable.deleteSipConf() ";
    CFAstConfigurationFilePKey pkey = schema.getFactoryConfigurationFile().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAstSipConfBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from w w  w  .j av a 2s.  c  o m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteSipConf",
                pkey);
    }
    CFAstSipConfBySipClusterIdxKey keySipClusterIdx = schema.getFactorySipConf().newSipClusterIdxKey();
    keySipClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    // Validate reverse foreign keys

    // Delete is valid

    SortedMap<CFAstConfigurationFilePKey, CFAstSipConfBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictBySipClusterIdx.get(keySipClusterIdx);
    subdict.remove(pkey);

    schema.getTableConfigurationFile().deleteConfigurationFile(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamTopDomainTable.java

public void deleteTopDomain(CFAccAuthorization Authorization, CFAccTopDomainBuff Buff) {
    final String S_ProcName = "CFAccRamTopDomainTable.deleteTopDomain() ";
    CFAccDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAccTopDomainBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from   w  w w. j ava2  s  . com*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTopDomain",
                pkey);
    }
    CFAccTopDomainByTLDIdxKey keyTLDIdx = schema.getFactoryTopDomain().newTLDIdxKey();
    keyTLDIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyTLDIdx.setRequiredTLDId(existing.getRequiredTLDId());

    CFAccTopDomainByNameIdxKey keyNameIdx = schema.getFactoryTopDomain().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyNameIdx.setRequiredTLDId(existing.getRequiredTLDId());
    keyNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableDomain().deleteDomainBySubDomIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    schema.getTableTopProject().deleteTopProjectByDomainIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAccDomainBasePKey, CFAccTopDomainBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByTLDIdx.get(keyTLDIdx);
    subdict.remove(pkey);

    dictByNameIdx.remove(keyNameIdx);

    schema.getTableDomainBase().deleteDomainBase(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamTopDomainTable.java

public void deleteTopDomain(CFAstAuthorization Authorization, CFAstTopDomainBuff Buff) {
    final String S_ProcName = "CFAstRamTopDomainTable.deleteTopDomain() ";
    CFAstDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAstTopDomainBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from w  w  w  .  j a v  a 2s.c o  m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteTopDomain",
                pkey);
    }
    CFAstTopDomainByTLDIdxKey keyTLDIdx = schema.getFactoryTopDomain().newTLDIdxKey();
    keyTLDIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyTLDIdx.setRequiredTLDId(existing.getRequiredTLDId());

    CFAstTopDomainByNameIdxKey keyNameIdx = schema.getFactoryTopDomain().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyNameIdx.setRequiredTLDId(existing.getRequiredTLDId());
    keyNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableDomain().deleteDomainBySubDomIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    schema.getTableTopProject().deleteTopProjectByDomainIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAstDomainBasePKey, CFAstTopDomainBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByTLDIdx.get(keyTLDIdx);
    subdict.remove(pkey);

    dictByNameIdx.remove(keyNameIdx);

    schema.getTableDomainBase().deleteDomainBase(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamDomainTable.java

public void deleteDomain(CFAccAuthorization Authorization, CFAccDomainBuff Buff) {
    final String S_ProcName = "CFAccRamDomainTable.deleteDomain() ";
    CFAccDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAccDomainBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from  w  ww  .ja  v  a 2 s .  co m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDomain",
                pkey);
    }
    CFAccDomainBySubDomIdxKey keySubDomIdx = schema.getFactoryDomain().newSubDomIdxKey();
    keySubDomIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keySubDomIdx.setRequiredSubDomainOfId(existing.getRequiredSubDomainOfId());

    CFAccDomainByNameIdxKey keyNameIdx = schema.getFactoryDomain().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyNameIdx.setRequiredSubDomainOfId(existing.getRequiredSubDomainOfId());
    keyNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableTopProject().deleteTopProjectByDomainIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAccDomainBasePKey, CFAccDomainBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictBySubDomIdx.get(keySubDomIdx);
    subdict.remove(pkey);

    dictByNameIdx.remove(keyNameIdx);

    schema.getTableDomainBase().deleteDomainBase(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamDomainTable.java

public void deleteDomain(CFAstAuthorization Authorization, CFAstDomainBuff Buff) {
    final String S_ProcName = "CFAstRamDomainTable.deleteDomain() ";
    CFAstDomainBasePKey pkey = schema.getFactoryDomainBase().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredId(Buff.getRequiredId());
    CFAstDomainBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;/*from   w ww . j  a  v a  2  s . c o m*/
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteDomain",
                pkey);
    }
    CFAstDomainBySubDomIdxKey keySubDomIdx = schema.getFactoryDomain().newSubDomIdxKey();
    keySubDomIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keySubDomIdx.setRequiredSubDomainOfId(existing.getRequiredSubDomainOfId());

    CFAstDomainByNameIdxKey keyNameIdx = schema.getFactoryDomain().newNameIdxKey();
    keyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    keyNameIdx.setRequiredSubDomainOfId(existing.getRequiredSubDomainOfId());
    keyNameIdx.setRequiredName(existing.getRequiredName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableTopProject().deleteTopProjectByDomainIdx(Authorization, Buff.getRequiredTenantId(),
            Buff.getRequiredId());
    SortedMap<CFAstDomainBasePKey, CFAstDomainBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictBySubDomIdx.get(keySubDomIdx);
    subdict.remove(pkey);

    dictByNameIdx.remove(keyNameIdx);

    schema.getTableDomainBase().deleteDomainBase(Authorization, Buff);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamHostNodeTable.java

public void deleteHostNode(CFAccAuthorization Authorization, CFAccHostNodeBuff Buff) {
    final String S_ProcName = "CFAccRamHostNodeTable.deleteHostNode() ";
    CFAccHostNodePKey pkey = schema.getFactoryHostNode().newPKey();
    pkey.setRequiredClusterId(Buff.getRequiredClusterId());
    pkey.setRequiredHostNodeId(Buff.getRequiredHostNodeId());
    CFAccHostNodeBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        return;//w  w w. ja v a  2 s  .c o m
    }
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "deleteHostNode",
                pkey);
    }
    CFAccHostNodeByClusterIdxKey keyClusterIdx = schema.getFactoryHostNode().newClusterIdxKey();
    keyClusterIdx.setRequiredClusterId(existing.getRequiredClusterId());

    CFAccHostNodeByUDescrIdxKey keyUDescrIdx = schema.getFactoryHostNode().newUDescrIdxKey();
    keyUDescrIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyUDescrIdx.setRequiredDescription(existing.getRequiredDescription());

    CFAccHostNodeByHostNameIdxKey keyHostNameIdx = schema.getFactoryHostNode().newHostNameIdxKey();
    keyHostNameIdx.setRequiredClusterId(existing.getRequiredClusterId());
    keyHostNameIdx.setRequiredHostName(existing.getRequiredHostName());

    // Validate reverse foreign keys

    // Delete is valid

    schema.getTableService().deleteServiceByHostIdx(Authorization, Buff.getRequiredClusterId(),
            Buff.getRequiredHostNodeId());
    SortedMap<CFAccHostNodePKey, CFAccHostNodeBuff> subdict;

    dictByPKey.remove(pkey);

    subdict = dictByClusterIdx.get(keyClusterIdx);
    subdict.remove(pkey);

    dictByUDescrIdx.remove(keyUDescrIdx);

    dictByHostNameIdx.remove(keyHostNameIdx);

}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamTldTable.java

public void updateTld(CFAccAuthorization Authorization, CFAccTldBuff Buff) {
    CFAccTldPKey pkey = schema.getFactoryTld().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTLDId(Buff.getRequiredTLDId());
    CFAccTldBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTld",
                "Existing record not found", "Tld", pkey);
    }//  w  w  w.  ja  v  a2 s .  com
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateTld", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAccTldByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTld().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAccTldByTenantIdxKey newKeyTenantIdx = schema.getFactoryTld().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFAccTldByNameIdxKey existingKeyNameIdx = schema.getFactoryTld().newNameIdxKey();
    existingKeyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyNameIdx.setRequiredName(existing.getRequiredName());

    CFAccTldByNameIdxKey newKeyNameIdx = schema.getFactoryTld().newNameIdxKey();
    newKeyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    if (!existingKeyNameIdx.equals(newKeyNameIdx)) {
        if (dictByNameIdx.containsKey(newKeyNameIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateTld",
                    "TLDNameIdx", newKeyNameIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTld",
                        "Container", "Tenant", "Tenant", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFAccTldPKey, CFAccTldBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByTenantIdx.get(existingKeyTenantIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
        subdict = dictByTenantIdx.get(newKeyTenantIdx);
    } else {
        subdict = new TreeMap<CFAccTldPKey, CFAccTldBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByNameIdx.remove(existingKeyNameIdx);
    dictByNameIdx.put(newKeyNameIdx, Buff);

}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamTldTable.java

public void updateTld(CFAstAuthorization Authorization, CFAstTldBuff Buff) {
    CFAstTldPKey pkey = schema.getFactoryTld().newPKey();
    pkey.setRequiredTenantId(Buff.getRequiredTenantId());
    pkey.setRequiredTLDId(Buff.getRequiredTLDId());
    CFAstTldBuff existing = dictByPKey.get(pkey);
    if (existing == null) {
        throw CFLib.getDefaultExceptionFactory().newStaleCacheDetectedException(getClass(), "updateTld",
                "Existing record not found", "Tld", pkey);
    }/*from ww w  .j  av a  2  s . co m*/
    if (existing.getRequiredRevision() != Buff.getRequiredRevision()) {
        throw CFLib.getDefaultExceptionFactory().newCollisionDetectedException(getClass(), "updateTld", pkey);
    }
    Buff.setRequiredRevision(Buff.getRequiredRevision() + 1);
    CFAstTldByTenantIdxKey existingKeyTenantIdx = schema.getFactoryTld().newTenantIdxKey();
    existingKeyTenantIdx.setRequiredTenantId(existing.getRequiredTenantId());

    CFAstTldByTenantIdxKey newKeyTenantIdx = schema.getFactoryTld().newTenantIdxKey();
    newKeyTenantIdx.setRequiredTenantId(Buff.getRequiredTenantId());

    CFAstTldByNameIdxKey existingKeyNameIdx = schema.getFactoryTld().newNameIdxKey();
    existingKeyNameIdx.setRequiredTenantId(existing.getRequiredTenantId());
    existingKeyNameIdx.setRequiredName(existing.getRequiredName());

    CFAstTldByNameIdxKey newKeyNameIdx = schema.getFactoryTld().newNameIdxKey();
    newKeyNameIdx.setRequiredTenantId(Buff.getRequiredTenantId());
    newKeyNameIdx.setRequiredName(Buff.getRequiredName());

    // Check unique indexes

    if (!existingKeyNameIdx.equals(newKeyNameIdx)) {
        if (dictByNameIdx.containsKey(newKeyNameIdx)) {
            throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), "updateTld",
                    "TLDNameIdx", newKeyNameIdx);
        }
    }

    // Validate foreign keys

    {
        boolean allNull = true;

        if (allNull) {
            if (null == schema.getTableTenant().readDerivedByIdIdx(Authorization, Buff.getRequiredTenantId())) {
                throw CFLib.getDefaultExceptionFactory().newUnresolvedRelationException(getClass(), "updateTld",
                        "Container", "Tenant", "Tenant", null);
            }
        }
    }

    // Update is valid

    SortedMap<CFAstTldPKey, CFAstTldBuff> subdict;

    dictByPKey.remove(pkey);
    dictByPKey.put(pkey, Buff);

    subdict = dictByTenantIdx.get(existingKeyTenantIdx);
    if (subdict != null) {
        subdict.remove(pkey);
    }
    if (dictByTenantIdx.containsKey(newKeyTenantIdx)) {
        subdict = dictByTenantIdx.get(newKeyTenantIdx);
    } else {
        subdict = new TreeMap<CFAstTldPKey, CFAstTldBuff>();
        dictByTenantIdx.put(newKeyTenantIdx, subdict);
    }
    subdict.put(pkey, Buff);

    dictByNameIdx.remove(existingKeyNameIdx);
    dictByNameIdx.put(newKeyNameIdx, Buff);

}