View Javadoc

1   /*
2    * $Id: MySpaceFileType.java,v 1.2 2004/06/14 23:08:51 jdt Exp $
3    *
4    * Copyright 2003 AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid Software License,
7    * a copy of which has been included with this distribution in the LICENSE.txt file.
8    */
9   
10  package org.astrogrid.store.delegate.myspaceItn05;
11  
12  import java.util.Hashtable;
13  import org.astrogrid.util.TypeSafeEnumerator;
14  
15  /***
16   * File Types for MySpace.  Enumerated, indexed by the string returned
17   * by the getDataHolding methods
18   *
19   * @author mch.  Could/Should probably be replaced by new templaty stuff.
20   */
21  
22  
23  public class MySpaceFileType extends TypeSafeEnumerator
24  {
25     private int managerRef = 0;
26     private String mimeType = null;
27     
28     private static Hashtable holdingIdx = new Hashtable();
29     
30     public static final MySpaceFileType UNKNOWN = new MySpaceFileType(EntryCodes.UNKNOWN, "Unknown", null);
31     public static final MySpaceFileType FOLDER = new MySpaceFileType(EntryCodes.CON, "Folder", null);
32     public static final MySpaceFileType VOTABLE = new MySpaceFileType(EntryCodes.VOT, "VOTable", "text/votable");
33     public static final MySpaceFileType QUERY = new MySpaceFileType(EntryCodes.QUERY, "Query", "text/xml");
34     public static final MySpaceFileType WORKFLOW = new MySpaceFileType(EntryCodes.WORKFLOW, "Workflow", "text/xml");
35     public static final MySpaceFileType XML = new MySpaceFileType(EntryCodes.XML, "Xml", "text/xml");
36  
37     
38     private MySpaceFileType(int givenRef, String userDesc, String givenMimeType)
39     {
40        super(userDesc);
41        holdingIdx.put(new Integer(managerRef), this);
42        managerRef = givenRef;
43        mimeType = givenMimeType;
44     }
45  
46     public static MySpaceFileType getForManagerRef(int managerRef)
47     {
48        return (MySpaceFileType) holdingIdx.get(new Integer(managerRef));
49     }
50     
51     public static MySpaceFileType getForHoldingRef(String holdingRef)
52     {
53        return (MySpaceFileType) holdingIdx.get(holdingRef);
54     }
55  
56     public final int getManagerRef() {
57        return managerRef;
58     }
59     
60     public final String getMimeType() {
61        return mimeType;
62     }
63  }
64  
65  /*
66  $Log: MySpaceFileType.java,v $
67  Revision 1.2  2004/06/14 23:08:51  jdt
68  Merge from branches
69  ClientServerSplit_JDT
70  and
71  MySpaceClientServerSplit_JDT
72  
73  MySpace now split into a client/delegate jar
74  astrogrid-myspace-<version>.jar
75  and a server/manager war
76  astrogrid-myspace-server-<version>.war
77  
78  Revision 1.1.2.1  2004/06/14 22:33:20  jdt
79  Split into delegate jar and server war.  
80  Delegate: astrogrid-myspace-SNAPSHOT.jar
81  Server/Manager: astrogrid-myspace-server-SNAPSHOT.war
82  
83  Package names unchanged.
84  If you regenerate the axis java/wsdd/wsdl files etc you'll need
85  to move some files around to ensure they end up in the client
86  or the server as appropriate.
87  As of this check-in the tests/errors/failures is 162/1/22 which
88  matches that before the split.
89  
90  Revision 1.1  2004/05/03 08:55:53  mch
91  Fixes to getFiles(), introduced getSize(), getOwner() etc to StoreFile
92  
93  Revision 1.2  2004/04/23 11:38:19  mch
94  Fixes to return correct AGSL plus change to File model for It05 delegate
95  
96  Revision 1.1  2004/03/04 12:51:31  mch
97  Moved delegate implementations into subpackages
98  
99  Revision 1.2  2004/03/01 22:50:08  mch
100 added finals, oops
101 
102 Revision 1.1  2004/02/24 15:59:56  mch
103 Moved It04.1 Datacenter VoSpaceClient stuff to myspace as StoreClient stuff
104 
105 Revision 1.1  2004/02/15 23:16:06  mch
106 New-style VoSpace delegates.  Not agreed so private to datacenter for the moment
107 
108  */
109