Multi-key storage

are there any map or list, anything that can store data with same key?
Thanks.
Vincent

I usually just put a List into the Map against the given key:
public void add(Object key, Object item)
  List list = (List)map.get(key);
  if(list == null)
    list = new ArrayList();
    map.put(key, list);
  list.add(item);
public void remove(Object key, Object item)
  List list = (List)map.get(key);
  if(list != null)
    list.remove(item);
public Iterator get(Object key)
  List list = (List)map.get(key);
  if(list != null)
    return list.iterator();
  return null;
}I know it's not quite the Map interface but you'll always differ from the API slightly since your get method doesn't return what was put in. The remove method could maybe do with some alteration so that it doesn't require a key.
Hope this helps.

Similar Messages

  • Error while deleting certificate from key storage in visual admin.

    Hi,
    I am reconfiguring SSO with our ERP system.
    I need to delete certificate of abap system.
    when i try to delete certificate from visulal admin>server>services>key storage>ticketkeystore
    i get error stating
    com.sap.engine.services.keystore.exception.BaseRemoteException:Remote call errored
    at com.sap.engine.services.keystore.impl.KeystoreManagerManagementimpl.deleteEntry(KeystoreManagerManagementimpl.java:83)
    Pls help
    Thanks & Regards
    Raj Kiran

    I solved it.
    Visual Admin > Key Storage service ....
    1) Take note of all your Entries under the "TicketKeystore" view. You could export all of your Entries here except for the "SAPLogonTicketKeypair" in case you need this to be replaced by a new one
    2) Select the "TicketKeyStore" view and DELETE it
    3) Create the "TicketKeyStore" view again. It should be empty now.
    3) Recreate the SAPLogonTicketKeypair, and import all of the ones that you exported in step (1)
    Hope this helps
    Cheers

  • Error while importing CSR into key storage?

    Dear All,
    I am trying to implement the SSL certificates on our production server. I have generated the CSR from Visual Admin --> Key Storage. I forwarded it to CA and got the certificate response also. Now while importing the certificate into key storage, it is giving me following error:
    The private ket pair doesnt match the certificate response file: Invalid PKCS#1 padding, no leading zeros.
    What can be the cause and probable solution on this issue? Any help on this will be highly appreciated. Kindly reply..
    Thank you,
    Ameya

    Hi,
    I resolved this error by making it sure that there are no extra spaces or unwanted caracter copied while copying the certificate response from the CA. Make sure you are copying the certificate response properly. In my case, some extra space was getting copied so after re-copyinf it properly, it worked.

  • Multi-key dimension handling in OTBI report design - How?

    In OTBI reporting (i.e. from transactional DB) design , how to handle multi-key dimensions? I don't have option to have a staging/DW area where I can generate surrogate key for dimensions & use it in facts. Currently we are thinking creating Views on top of transactional tables and use it as dimensions & facts. What is the best way to tackle?

    In OTBI reporting (i.e. from transactional DB) design , how to handle multi-key dimensions? I don't have option to have a staging/DW area where I can generate surrogate key for dimensions & use it in facts. Currently we are thinking creating Views on top of transactional tables and use it as dimensions & facts. What is the best way to tackle?

  • Permissions to access Key Storage at /nwa/key-storage

    Although I have the typical UME and Portal roles assigned, I am told that "You do not have the neccessary permissions to access the Key Storage configuration profile." (Yes there are 2 c in neccessary).
    SAP help only mentions "You must be assigned to the System Administration role in NWA to use the keystore and authentication administration functions"
    Please let me know if you have any ideas. I am using the trial version of CE.
    Thanks, Florian

    You may want to make sure you're part of the Administrators group...
    Cheers

  • Cannot access key storage in Visual Administrator

    Hi,
    I cannot access the key storage node (==> Host ==> Server ==> Services ==> Key Storage) in Visual Administrator.
    Everytime I click on the key storage node an error message pops up. It says:
    <b>IAIK security library not found
    java.lang.NoClassDefFoundError:iaik/security/provider/IAIK</b>
    According to SAP (http://help.sap.com/saphelp_nw04/helpdata/en/e9/a1dd44d2c83c43afb5ec8a4292f3e0/content.htm) the SAP Cryptographic Toolkit has to be installed to use the Key Storage functionality of the Visual Administrator. The SAP Cryptographic toolkit has been deployed.
    Does anyone know where I can get that library and where I am supposed to put it? We work with <b>SAP NetWeaver '04 WebAS Java 6.40 SP14</b>.
    I appreciate any kind of help.
    Regards,
    Martin

    Hi,
    The missing class should be in the iaik_jce.jar
    archive. This archive is present in folder \usr\sap\<SID>
    \sys\global\security\lib\tools(or)engine.
    Copying this archive to the visual admin's <j2ee-install>
    \admin\lib folder, this workaround can solve your issue.
    You may also need unlimited strength jurisdiction
    policy depending on your JDK version. For more info:
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/a1dd44d2c83c43afb5ec8a4292f3e0/content.htm ->
    Deploying SAP Java Cryptographic Toolkit.
    Also check SAP Note: 891666
    Hope it helps..
    Regards
    Srikishan

  • Multi-Keys for Maps

    Is there a recommended way of storing values that depend on two keys? I need to get a value associated with (not calculated from) two parameters. For a simple example, I have a matrix of values like so:
    \| A | B | C | D
    -+---------------
    &#945;| 2 | 5 | 7 | 9
    -+---+---+---+---
    &#946;| 5 | 8 | 1 | 4
    -+---+---+---+---
    &#947;| 3 | 7 | 9 | 2
    -+---+---+---+---
    &#948;| 6 | 0 | 5 | 1 In my case, the headers A-D and &#945;-&#948; are enums. For a given RomanLetter (A-D) and GreekLetter (&#945;-&#948;), I need the value. I have a set of data like this for each of a few thousand objects, though it could easily be a million some time in the future.
    I could create a class which has three attributes: an int, a RomanLetter, and a GreekLetter, create a collection of these objects, and then iterate over the collection until I find the one that matches, but I'd like to do something a little more elegant than that for performance reasons as well as for uniqueness (there should never be more than one number for any given pair).
    What would be the recommended way of doing this? A HashMap of HashMaps comes to mind, like so:
    HashMap<RomanLetter, HashMap<GreekLetter, Integer>> But that seems awfully confusing and not very scalable.
    I also thought of some kind of database-like data structure that I could query, but don't think this use case justifies using one of those fairly heavy-weight third-party solutions.
    Any ideas?

    JavaJason wrote:
    Yes, I could do either of those. I didn't use the correct term in my original post. I said it that approach wasn't very "scalable". What I meant to say is that in the future if, say, I need a value based on three or four or more attributes, the code will become an unmaintainable mess. So while I technically could do that, I'd like to do something a bit easier to maintain.This will work perfectly:
    Map<Pair<RomanLetter, GreekLetter>, Integer>Or rather,
    Map<YourKey, Integer>Now, you would define your key using RomanLetter and GreekLetter. If you need to add another attribute you would tweak the definition of YourKey. Seems very reasonable to me.
    >
    The other possibility I thought of was creating a multi-dimensional array. So in the case of my example, the multi-dimensional array would look much like the matrix I listed. I tend to shy away from using the index of arrays to represent a particular association, because I feel that the association is often not obvious and when things get changed down the road, the association will be broken. However, I suppose if I create the matrix based on the ordinal of the enum, if and when the enum changes, the matrix will as well.That's equivalent to the nested Maps you first suggested.

  • Java API, problem with secondary keys using multi key creator

    Hi,
    I'm developing an application that inserts a few 100k or so records into a Queue DB, then access them using one of four Hash SecondaryDatabases. Three of these secondary dbs use a SecondaryMultiKeyCreator to generate the keys, and one uses a SecondaryKeyCreator. As a test, I'm trying to iterate through each secondary key. When trying to iterate through the keys of any of the secondary databases that use a SecondaryMultiKeyCreator, I have problems. I'm attempting to iterate through the keys by:
    1: creating a StoredMap of the SecondaryDatabase
    2: getting a StoredKeySet from said map
    3: getting a StoredIterator on said StoredKeySet
    4: iterate
    The first call to StoredIterator.next() fails at my key binding (TupleBinding) because it is only receiving 2 bytes of data for the key, when it should be getting more, so an Exception is thrown. I suspected a problem with my SecondaryMultiKeyCreator, so I added some debug code to check the size of the DatabaseEntries it creates immediately before adding them to the results key Set. It checks out right. I also checked my key binding like so:
    1: use binding to convert the key object to a DatabaseEntry
    2: use binding to convert the created DatabaseEntry back to a key object
    3: check to see if the old object contains the same data as the new one
    Everything checked out ok.
    What it boils down to is this: my key creator is adding DatabaseEntries of the correct size to the results set, but when the keys are being read back later on, my key binding is only receiving 2 bytes of data. For the one SecondaryDatabase that doesn't use a SecondaryMultiKeyCreator, but just a SecondaryKeyCreator, there are no issues and I am able to iterate through its secondary keys as expected.
    EDIT: New discovery: if I only add ONE DatabaseEntry to the results set in my SecondaryMultiKeyCreator, I am able to iterate through the keys as I would like to.
    Any ideas or suggestions?
    Thank you for your attention,
    -Justin
    Message was edited by:
    Steamroller

    Hi Justin,
    Sorry about the delayed response here. I have created a patch that resolves the problem.
    If you apply the patch to your 4.6.21 source tree, and then rebuild Berkeley DB, the improper behavior should be resolved.
    Regards,
    Alex
    diff -rc db/db_am.c db/db_am.c
    *** db/db_am.c     Thu Jun 14 04:21:30 2007
    --- db/db_am.c     Fri Jun 13 11:20:28 2008
    *** 331,338 ****
           F_SET(dbc, DBC_TRANSIENT);
    !      switch (flags) {
    !      case DB_APPEND:
                 * If there is an append callback, the value stored in
                 * data->data may be replaced and then freed.  To avoid
    --- 331,337 ----
           F_SET(dbc, DBC_TRANSIENT);
    !       if (flags == DB_APPEND && LIST_FIRST(&dbp->s_secondaries) == NULL) {
                 * If there is an append callback, the value stored in
                 * data->data may be replaced and then freed.  To avoid
    *** 367,388 ****
    -            * Secondary indices:  since we've returned zero from an append
    -            * function, we've just put a record, and done so outside
    -            * __dbc_put.  We know we're not a secondary-- the interface
    -            * prevents puts on them--but we may be a primary.  If so,
    -            * update our secondary indices appropriately.
    -            * If the application is managing this key's data, we need a
    -            * copy of it here.  It will be freed in __db_put_pp.
    -           DB_ASSERT(dbenv, !F_ISSET(dbp, DB_AM_SECONDARY));
    -           if (LIST_FIRST(&dbp->s_secondaries) != NULL &&
    -               (ret = __dbt_usercopy(dbenv, key)) == 0)
    -                ret = __db_append_primary(dbc, key, &tdata);
                 * The append callback, if one exists, may have allocated
                 * a new tdata.data buffer.  If so, free it.
    --- 366,371 ----
    *** 390,401 ****
                /* No need for a cursor put;  we're done. */
                goto done;
    !      default:
    !           /* Fall through to normal cursor put. */
    !           break;
    !      if (ret == 0)
                ret = __dbc_put(dbc,
                    key, data, flags == 0 ? DB_KEYLAST : flags);
    --- 373,379 ----
                /* No need for a cursor put;  we're done. */
                goto done;
    !      } else
                ret = __dbc_put(dbc,
                    key, data, flags == 0 ? DB_KEYLAST : flags);
    diff -rc db/db_cam.c db/db_cam.c
    *** db/db_cam.c     Tue Jun  5 21:46:24 2007
    --- db/db_cam.c     Thu Jun 12 16:41:29 2008
    *** 899,905 ****
           DB_ENV *dbenv;
           DB dbp, sdbp;
           DBC dbc_n, oldopd, opd, sdbc, *pdbc;
    !      DBT olddata, oldpkey, newdata, pkey, temppkey, tempskey;
           DBT all_skeys, skeyp, *tskeyp;
           db_pgno_t pgno;
           int cmp, have_oldrec, ispartial, nodel, re_pad, ret, s_count, t_ret;
    --- 899,905 ----
           DB_ENV *dbenv;
           DB dbp, sdbp;
           DBC dbc_n, oldopd, opd, sdbc, *pdbc;
    !      DBT olddata, oldpkey, newdata, pkey, temppkey, tempskey, tdata;
           DBT all_skeys, skeyp, *tskeyp;
           db_pgno_t pgno;
           int cmp, have_oldrec, ispartial, nodel, re_pad, ret, s_count, t_ret;
    *** 1019,1026 ****
            * should have been caught by the checking routine, but
            * add a sprinkling of paranoia.
    !      DB_ASSERT(dbenv, flags == DB_CURRENT || flags == DB_KEYFIRST ||
    !            flags == DB_KEYLAST || flags == DB_NOOVERWRITE);
            * We'll want to use DB_RMW in a few places, but it's only legal
    --- 1019,1027 ----
            * should have been caught by the checking routine, but
            * add a sprinkling of paranoia.
    !       DB_ASSERT(dbenv, flags == DB_APPEND || flags == DB_CURRENT ||
    !             flags == DB_KEYFIRST || flags == DB_KEYLAST ||
    !             flags == DB_NOOVERWRITE);
            * We'll want to use DB_RMW in a few places, but it's only legal
    *** 1048,1053 ****
    --- 1049,1107 ----
                     goto err;
                have_oldrec = 1; /* We've looked for the old record. */
    +      } else if (flags == DB_APPEND) {
    +           /*
    +            * With DB_APPEND, we need to do the insert to populate the
    +            * key value. So we swap the 'normal' order of updating
    +            * secondary / verifying foreign databases and inserting.
    +            *
    +            * If there is an append callback, the value stored in
    +            * data->data may be replaced and then freed.  To avoid
    +            * passing a freed pointer back to the user, just operate
    +            * on a copy of the data DBT.
    +            */
    +           tdata = *data;
    +           /*
    +            * If this cursor is going to be closed immediately, we don't
    +            * need to take precautions to clean it up on error.
    +            */
    +           if (F_ISSET(dbc_arg, DBC_TRANSIENT))
    +                dbc_n = dbc_arg;
    +           else if ((ret = __dbc_idup(dbc_arg, &dbc_n, 0)) != 0)
    +                goto err;
    +
    +           pgno = PGNO_INVALID;
    +
    +           /*
    +            * Append isn't a normal put operation;  call the appropriate
    +            * access method's append function.
    +            */
    +           switch (dbp->type) {
    +           case DB_QUEUE:
    +                if ((ret = __qam_append(dbc_n, key, &tdata)) != 0)
    +                     goto err;
    +                break;
    +           case DB_RECNO:
    +                if ((ret = __ram_append(dbc_n, key, &tdata)) != 0)
    +                     goto err;
    +                break;
    +           default:
    +                /* The interface should prevent this. */
    +                DB_ASSERT(dbenv,
    +                    dbp->type == DB_QUEUE || dbp->type == DB_RECNO);
    +
    +                ret = __db_ferr(dbenv, "DBC->put", 0);
    +                goto err;
    +           }
    +           /*
    +            * The append callback, if one exists, may have allocated
    +            * a new tdata.data buffer.  If so, free it.
    +            */
    +           FREE_IF_NEEDED(dbenv, &tdata);
    +           pkey.data = key->data;
    +           pkey.size = key->size;
    +           /* An append cannot be replacing an existing item. */
    +           nodel = 1;
           } else {
                /* Set pkey so we can use &pkey everywhere instead of key.  */
                pkey.data = key->data;
    *** 1400,1405 ****
    --- 1454,1465 ----
      skip_s_update:
    +       * If this is an append operation, the insert was done prior to the
    +       * secondary updates, so we are finished.
    +       */
    +      if (flags == DB_APPEND)
    +           goto done;
    +      /*
            * If we have an off-page duplicates cursor, and the operation applies
            * to it, perform the operation.  Duplicate the cursor and call the
            * underlying function.

  • Multi key (or composite key) dimension for operational reporting

    Hi, I am creating operational reports in OBIEE 11g with PeopleSoft FSCM as source. As they are straight forward reports, I am planning to use OLTP tables directly for my OBIEE reporting.
    Here is the simplified scenario - ACCOUNT_TBL_VW is dimension table which has BUSINESS_UNIT & ACCOUNT_ID as keys.
    I have LEDGER Fact that has BUSINESS_UNIT, ACCOUNT_ID & other dimension keys with amount measures.
    How do I link my LEDGER Fact with ACCOUNT Dimension?
    Can I join multiple keys of Dimension with multiple keys of Fact? like this
    ACCDIM.BUSINESS_UNIT ---> LEDGFACT.BUSINESS_UNIT
    ACCDIM.ACCOUNT_ID ---> LEDGFACT.ACCOUNT_ID
    As it is operational reporting, I don't have any ETL type process to prepare single column primary key(surrogate key) in Dimension Table & modifying Fact Table with dimension surrogate key value.

    Hi,
    on the principal of how (in the absence of ETL); -
    1. Physical layer should reflect the actual physical joins, in some cases you may need the same table more than once to reflect self joins
    2. The business model layer is where you transform the physical into your desired star schema, hence here you will frequently (when using RDBMS tables) have numerous physical tables forming the source for a single logical table - this is also where you flatten the snowflake (or worse) into a star
    Make sense?
    regards,
    Robert.

  • How to input multi-key into card in JCOP with secure channel ?

    When I input multiple keys into JCOP ,it returs 6982. It seems I calculate the wrong C-MAC value. The steps as follows:
    //auth mac
    --> 80 50 00 00 08 DE 6E AB 3C 27 16 74 23 00
    <--00 00 71 25 00 11 96 91 17 84 FF 02 00 07 2E CC EB B6 BA 1F B0 9C 4D 0A 23 D8 39 1A 90 00
    --> 84 82 01 00 10 62 68 D5 CE 75 B6 39 41 14 E9 94 B1 50 E1 C8 49
    <--90 00
    //put keyset 1
    --> 84 D8 00 81 4B 01 80 10 6C CC 3D 43 CF C2 CD E6 CE AB C7 60 46 8B 7E FF 03 8B AF 47 80 10 6C CC 3D 43 CF C2 CD E6 CE AB C7 60 46 8B 7E FF 03 8B AF 47 80 10 6C CC 3D 43 CF C2 CD E6 CE AB C7 60 46 8B 7E FF 03 8B AF 47 27 02 3E BF DE 0E FE B6 00
    <--69 82
    When I auth without mac, I can put-keyset correctly.So It seems something wrong with C-MAC value.But I can send other command and get correct response with C-MAC.
    The source data I input to calculate C-MAC is:
    84 D8 00 81 4B 01 80 10 6C CC 3D 43 CF C2 CD E6 CE AB C7 60 46 8B 7E FF 03 8B AF 47 80 10 6C CC 3D 43 CF C2 CD E6 CE AB C7 60 46 8B 7E FF 03 8B AF 47 80 10 6C CC 3D 43 CF C2 CD E6 CE AB C7 60 46 8B 7E FF 03 8B AF 47.

    The reason you get an error is because you did not encrypt sensitive data. GP mandates that security domain keys must be encrypted with the encryption session key (derived from Data Encryption Key), regardless of the security level used.

  • [SOLVED?] Problem with multi key macros in emacs

    I recently made the switch from gentoo to arch, for the most part everything is up and working. The only thing I am having a problem with is GNU emacs, for some reason i can't use some macros that need more than 2 keys to be pressed. For example M-< will not work but for some reason C-_ will. I haven't got the faintest clue as to what the problem is. I am running xfce and using the us keyboard layout. If i run emacs outside of X than all the macros work fine. Any ideas?
    Thanks in advance.
    Last edited by flarkis (2010-03-01 22:57:24)

    seeing as this problem persists in both the terminal and gui versions i don't think that is possible. I also tried running both versions in twm to see if anything was different. The keys still aren't seen correctly but this time they are replaced with random characters that are not part of my keymap. An X11 problem or keyboard configuration problem?
    <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
    <deviceinfo version="0.2">
    <device>
    <match key="info.capabilities" contains="input.keymap">
    <append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
    </match>
    <match key="info.capabilities" contains="input.keys">
    <merge key="input.xkb.rules" type="string">base</merge>
    <!-- If we're using Linux, we use evdev by default (falling back to
    keyboard otherwise). -->
    <merge key="input.xkb.model" type="string">keyboard</merge>
    <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
    string="Linux">
    <merge key="input.xkb.model" type="string">evdev</merge>
    </match>
    <merge key="input.xkb.layout" type="string">us</merge>
    <merge key="input.xkb.variant" type="string" />
    </match>
    </device>
    </deviceinfo>
    Last edited by flarkis (2010-02-25 03:28:08)

  • Key frames switch to SMOOTH when they started as linear for multi key frame video animation ?

    When i create a series of animated moves on a freeze frame or pic...the second key frame which begins a "hold" ...always changes to smooth from linear after I add a few additional key frames and moves..  I use the key frame button on top left of viewer to add the key frames...I have tried adding the key frames in the inspector but smae results..2nd key frame changes to smooth after I add 4 additonal key frames and moves.  why?

    thanks for the reply Steve. I will battle through with this project and show the end result, but you may celebrate a birthday or six before I finish.But I will finish. It is part of a project I am creating from a recent stay on the Abrolhos Islands off the coast of Geraldton Western Australia. It is isolated like few places in the world, pristine and protected. We have friends who are proffessional fisherman and are allowed to stay there on shacks during the limited fishing/rock lobster fishing season.I have some really great photos and video to make use of.

  • Key Storage on a database

    Hi
    Does anyone have any ideas on the best way to store a public key on a database (oracle)??
    thx
    joj

    Just call getEncoded() from your key, and save it as a byte array or use Base64 encoding to put it into String field.

  • Multi-key accelerator

    Hi,
    I want to assign a multi keyboard accelerator to a JMenuItem.
    (I want that the shortcut will be something like: Ctrl+P,M).
    How can I do it?
    Thanks,
    Efrat

    Hi,
    this can help:
    http://forum.java.sun.com/thread.jspa?threadID=735609&messageID=4228658
    L.P.

  • Multi Key Listeners??

    In a nutshell, I've got a zoom tool (magnifying glass cursor)
    that toggles between the plus/minus when the user presses CONTROL.
    I have also created a class file with my magnifying functions in it
    - it shrinks the target when the user is holding down the CONTROL
    key. Both listeners work when activated individually, but not at
    the same time.
    Does anyone know how I can make these two listeners work
    together, short of packaging the cursor with the class?
    thanks to anyone with input.
    Jim

    I tried using various keys and key combinations, the latest
    being control + N. Here is the list of Flash Shortcuts that I could
    find:
    Press this To do this
    CTRL+O Open a file
    SHIFT+CTRL+O Open from web
    SPACEBAR Play or pause an open animation
    PERIOD Stop the playback
    CTRL+LEFT ARROW, NUMPAD 4 Previous movie
    CTRL+RIGHT ARROW, NUMPAD 6 Next movie
    LEFT ARROW Rewind 20 frames
    RIGHT ARROW Forward 20 frames
    ALT+LEFT ARROW Rewind 1 frame
    ALT+RIGHT ARROW Forward 1 frame
    ALT+ENTER, F11 Enter/exit fullscreen mode
    ESC (Fullscreen mode) Return from Fullscreen mode
    ALT (Fullscreen mode) Show/hide the seek bar and controls
    ALT+E Show/hide the Playlist Editor window
    ALT+G Toggle Game Mode
    ALT+S Take a snapshot
    CTRL+UP ARROW Volume Up
    CTRL+DOWN ARROW Volume Down
    CTRL+M Mute

Maybe you are looking for