Project

General

Profile

1
.. raw:: latex
2

    
3
  \newpage
4
  
5

    
6
Identifier Management
7
---------------------
8

    
9
.. index:: Identifiers
10

    
11
Author
12
  Matthew B. Jones
13

    
14
Date
15
  - 20100301 [MBJ] Initial draft of Identifier documentation
16

    
17
Goal
18
  Extend Metacat to support identifiers with arbitrary syntax
19

    
20
Summary 
21
  Metacat currently supports identifier strings called 'docids' that have
22
  the syntax 'scope.object.revision', such as 'foo.34.1' (we will refer to
23
  these as 'LocalIDs'). We now want Metacat to support identifiers that are 
24
  arbitrary strings, but still enforce uniqueness and proper revision
25
  handling (referred to these as GUIDs).  Metacat must be able to accept 
26
  these strings as identifiers for all CRUD operations, and reference them 
27
  in search results.
28

    
29
Identifier Resolution
30
=====================
31
Because Metacat uses LocalIDs throughout the code for references to objects,
32
and that LocalID has a constrained structure that includes semantics about
33
revisions in the identifier, it is difficult to wholesale replace it with
34
less-constrained string identifiers without re-writing much of Metacat.
35
Thus, our alternate strategy would is to wrap the Metacat APIs with a
36
identifier resolution layer that keeps track of the unconstrained GUIDs and
37
maps them to constrained local identifiers which are used internally within
38
Metacat. The basic identifer table model is shown in Figure 1, while the
39
basic strategy for retrieving an object is shown in Figure 2.
40

    
41

    
42
Identifier Table Structure
43
~~~~~~~~~~~~~~~~~~~~~~~~~~
44

    
45
.. figure:: images/identifiers.png
46

    
47
   Figure 1. Table structure for identifiers.
48

    
49
..
50
  This block defines the table structure diagram referenced above.
51
  @startuml images/identifiers.png
52

    
53
  identifiers "*" -- "1" xml_documents
54

    
55
  identifiers : String identifier
56
  identifiers : String docid
57
  identifiers : Integer rev
58

    
59
  xml_documents : String docid
60
  xml_documents : String rev
61

    
62
  note right of identifiers
63
    "identifiers.(docid,rev) is a foreign key into xml_documents"
64
  end note
65
  @enduml
66

    
67
.. raw:: latex
68

    
69
  \newpage
70

    
71
.. raw:: pdf
72

    
73
  PageBreak
74

    
75

    
76
Handling document read operations
77
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78

    
79
An overview of the process needed to read an object using a GUID.
80

    
81

    
82
.. figure:: images/guid_read.png
83

    
84
   Figure 2. Basic handling for string identifiers (GUIDs) as mapped to
85
   docids (LocalIDs) to retrieve an object.
86

    
87
..
88
  @startuml images/guid_read.png
89
  !include plantuml.conf
90
  actor User
91
  participant "Client" as app_client << Application >>
92
  participant "CRUD API" as c_crud << MetacatRestServlet >>
93
  participant "Identifier Manager" as ident_man << IdentifierManager >>
94
  participant "Handler" as handler << MetacatHandler >>
95
  User -> app_client
96
  app_client -> c_crud: get(token, GUID)
97
  c_crud -> ident_man: getLocalID(GUID)
98
  c_crud <-- ident_man: localID
99
  c_crud -> handler: handleReadAction(localID)
100
  c_crud <-- handler: object
101
  c_crud --> app_client: object
102
  
103
  @enduml
104

    
105
Handling document create operations
106
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107

    
108
An overview of the process needed to create an object using a GUID.
109

    
110
.. figure:: images/guid_insert.png
111

    
112
   Figure 3. Basic handling for string identifiers (GUIDs) as mapped to
113
   docids (LocalIDs) to create an object.
114

    
115
..
116
  @startuml images/guid_insert.png
117
  !include plantuml.conf
118
  actor User
119
  participant "Client" as app_client << Application >>
120
  participant "CRUD API" as c_crud << MetacatRestServlet >>
121
  participant "Identifier Manager" as ident_man << IdentifierManager >>
122
  participant "Handler" as handler << MetacatHandler >>
123
  User -> app_client
124
  app_client -> c_crud: create(token, GUID, object, sysmeta)
125
  c_crud -> ident_man: identifierExists(GUID)
126
  c_crud <-- ident_man: T or F 
127
  alt identifierExists == "F"
128
      c_crud -> ident_man: mapToLocalId(GUID)
129
      c_crud <-- ident_man: localID
130
      c_crud -> handler: handleInsertAction(localID)
131
      c_crud <-- handler: success
132
      note right of c_crud
133
        "Also need to address how to handle the sysmeta information wrt insertion methods"
134
      end note
135
      app_client <-- c_crud: success
136
  else identifierExists == "T"
137
      app_client <-- c_crud: IdentifierNotUnique
138
  end
139
  @enduml
140

    
141
Handling document update operations
142
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143

    
144
An overview of the process needed to update an object using a GUID.
145

    
146
.. figure:: images/guid_update.png
147

    
148
   Figure 4. Basic handling for string identifiers (GUIDs) as mapped to
149
   docids (LocalIDs) to update an object.
150

    
151
..
152
  @startuml images/guid_update.png
153
  !include plantuml.conf
154
  actor User
155
  participant "Client" as app_client << Application >>
156
  participant "CRUD API" as c_crud << MetacatRestServlet >>
157
  participant "Identifier Manager" as ident_man << IdentifierManager >>
158
  participant "Handler" as handler << MetacatHandler >>
159
  User -> app_client
160
  app_client -> c_crud: update(token, GUID, object, obsoletedGUID, sysmeta)
161

    
162
  c_crud -> ident_man: identifierExists(obsoletedGUID)
163
  c_crud <-- ident_man: T or F 
164
  alt identifierExists == "T"
165

    
166
      c_crud -> ident_man: identifierExists(GUID)
167
      c_crud <-- ident_man: T or F 
168
      alt identifierExists == "F"
169
          c_crud -> ident_man: mapToLocalId(GUID, obsoletedGUID)
170
          c_crud <-- ident_man: localID
171
          c_crud -> handler: handleUpdateAction(localID)
172
          c_crud <-- handler: success
173
          note right of c_crud
174
            "Also need to address how to handle the sysmeta information wrt update methods"
175
          end note
176
          app_client <-- c_crud: success
177
      else identifierExists == "T"
178
          app_client <-- c_crud: IdentifierNotUnique
179
      end
180
  else identifierExists == "F"
181
      app_client <-- c_crud: NotFound
182
  end
183
  @enduml
184

    
185
Handling document delete operations
186
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187

    
188
An overview of the process needed to delete an object using a GUID.
189

    
190
.. figure:: images/guid_delete.png
191

    
192
   Figure 5. Basic handling for string identifiers (GUIDs) as mapped to
193
   docids (LocalIDs) to delete an object.
194

    
195
..
196
  @startuml images/guid_delete.png
197
  !include plantuml.conf
198
  actor User
199
  participant "Client" as app_client << Application >>
200
  participant "CRUD API" as c_crud << MetacatRestServlet >>
201
  participant "Identifier Manager" as ident_man << IdentifierManager >>
202
  participant "Handler" as handler << MetacatHandler >>
203
  User -> app_client
204
  app_client -> c_crud: delete(token, GUID)
205
  c_crud -> ident_man: identifierExists(GUID)
206
  c_crud <-- ident_man: T or F 
207
  alt identifierExists == "T"
208
      c_crud -> ident_man: mapToLocalId(GUID)
209
      c_crud <-- ident_man: localID
210
      c_crud -> handler: handleDeleteAction(localID)
211
      c_crud <-- handler: success
212
      app_client <-- c_crud: success
213
  else identifierExists == "F"
214
      app_client <-- c_crud: NotFound
215
  end
216
  @enduml
217

    
218
..
219
  This block defines the interaction diagram referenced above.
220
  startuml images/01_interaction.png
221
    !include plantuml.conf
222
    actor User
223
    participant "Client" as app_client << Application >>
224
    User -> app_client
225

    
226
    participant "CRUD API" as c_crud << Coordinating Node >>
227
    activate c_crud
228
    app_client -> c_crud: resolve(GUID, auth_token)
229
    participant "Authorization API" as c_authorize << Coordinating Node >>
230
    c_crud -> c_authorize: isAuth(auth_token, GUID)
231
    participant "Verify API" as c_ver << Coordinating Node >>
232
    c_authorize -> c_ver: isValidToken (token)
233
    c_authorize <-- c_ver: T or F
234
    c_crud <-- c_authorize: T or F
235
    app_client <-- c_crud: handle_list
236
    deactivate c_crud
237

    
238
    participant "CRUD API" as m_crud << Member Node >>
239
    activate m_crud
240
    app_client -> m_crud: get(auth_token, handle)
241
    participant "Server Authentication API" as m_authenticate << Member Node >>
242
    m_crud -> m_authenticate: isAuth(auth_token, GUID)
243
    m_crud <-- m_authenticate: T or F
244
    m_crud -> m_crud: log(get, UserID, GUID)
245
    app_client <-- m_crud: object or unauth or doesNotExist
246
    deactivate m_crud
247
  enduml
(2-2/4)