~cgb-cs/appscale/appscale-main

« back to all changes in this revision

Viewing changes to AppController/doc/DatastoreFactory.html

  • Committer: Chris Bunch
  • Date: 2012-02-27 04:59:38 UTC
  • Revision ID: cgb@cs.ucsb.edu-20120227045938-mc8x1ff7520zz3sp
added datastore_s3 tests and regenerated coverage/rdoc

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        
113
113
          <li><a href="./DatastoreFactory.html">DatastoreFactory</a></li>
114
114
        
 
115
          <li><a href="./DatastoreRepo.html">DatastoreRepo</a></li>
 
116
        
 
117
          <li><a href="./DatastoreRepoOnAppEngine.html">DatastoreRepoOnAppEngine</a></li>
 
118
        
115
119
          <li><a href="./DatastoreRepoOnAppScale.html">DatastoreRepoOnAppScale</a></li>
116
120
        
117
121
          <li><a href="./DatastoreS3.html">DatastoreS3</a></li>
228
232
          <div class="method-source-code"
229
233
            id="get_datastore-source">
230
234
<pre>
231
 
<span class="ruby-comment"># File lib/datastore_factory.rb, line 14</span>
 
235
<span class="ruby-comment"># File lib/datastore_factory.rb, line 15</span>
232
236
def self.get_datastore(name, credentials)
233
237
  case name
234
238
  when <span class="ruby-constant">DatastoreS3</span>::<span class="ruby-constant">NAME</span>
235
 
    return <span class="ruby-constant">DatastoreS3</span>.new(credentials)
 
239
    s3_creds = {:EC2_ACCESS_KEY =&gt; credentials[<span class="ruby-string">'@EC2_ACCESS_KEY'</span>], 
 
240
      :EC2_SECRET_KEY =&gt; credentials[<span class="ruby-string">'@EC2_SECRET_KEY'</span>],
 
241
      :S3_URL =&gt; credentials[<span class="ruby-string">'@S3_URL'</span>]}
 
242
    return <span class="ruby-constant">DatastoreS3</span>.new(s3_creds)
 
243
  when <span class="ruby-constant">DatastoreRepoOnAppEngine</span>::<span class="ruby-constant">NAME</span>
 
244
    return <span class="ruby-constant">DatastoreRepoOnAppEngine</span>.new(credentials)
236
245
  when <span class="ruby-constant">DatastoreRepoOnAppScale</span>::<span class="ruby-constant">NAME</span>
237
246
    <span class="ruby-comment"># Since Repo in AppScale is authenticated w / the secret that we</span>
238
247
    <span class="ruby-comment"># can get at anytime, we don't need to give it any credentials.</span>