Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2000-2011 Regents of the University of California and the
4
 *              National Center for Ecological Analysis and Synthesis
5
 *
6
 *   '$Author: cjones $'
7
 *     '$Date: 2011-06-22 11:03:46 -0700 (Wed, 22 Jun 2011) $'
8
 *
9
 * This program is free software; you can redistribute it and/or modify
10
 * it under the terms of the GNU General Public License as published by
11
 * the Free Software Foundation; either version 2 of the License, or
12
 * (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
 */
23

    
24
package edu.ucsb.nceas.metacat.dataone;
25

    
26
import java.io.InputStream;
27
import java.util.Date;
28

    
29
import org.dataone.service.exceptions.InvalidRequest;
30
import org.dataone.service.exceptions.InvalidToken;
31
import org.dataone.service.exceptions.NotAuthorized;
32
import org.dataone.service.exceptions.NotFound;
33
import org.dataone.service.exceptions.NotImplemented;
34
import org.dataone.service.exceptions.ServiceFailure;
35
import org.dataone.service.types.AccessPolicy;
36
import org.dataone.service.types.Checksum;
37
import org.dataone.service.types.Event;
38
import org.dataone.service.types.Identifier;
39
import org.dataone.service.types.Log;
40
import org.dataone.service.types.Permission;
41
import org.dataone.service.types.Session;
42
import org.dataone.service.types.SystemMetadata;
43

    
44
public abstract class D1NodeService {
45
  
46
	/* Methods common to CNCore and MNCore APIs */
47

    
48
	/**
49
	 * Return the log records associated with a given event between the start and 
50
	 * end dates listed given a particular Subject listed in the Session
51
	 * 
52
	 * @param session - the Session object containing the credentials for the Subject
53
	 * @param fromDate - the start date of the desired log records
54
	 * @param toDate - the end date of the desired log records
55
	 * @param event - restrict log records of a specific event type
56
	 * @param start - zero based offset from the first record in the 
57
	 *                set of matching log records. Used to assist with 
58
	 *                paging the response.
59
	 * @param count - maximum number of log records to return in the response. 
60
	 *                Used to assist with paging the response.
61
	 * 
62
	 * @return the desired log records
63
	 * 
64
	 * @throws InvalidToken
65
	 * @throws ServiceFailure
66
	 * @throws NotAuthorized
67
	 * @throws InvalidRequest
68
	 * @throws NotImplemented
69
	 */
70
	public Log getLogRecords(Session session, Date fromDate, Date toDate, 
71
      Event event, Integer start, Integer count) throws InvalidToken, ServiceFailure,
72
	    NotAuthorized, InvalidRequest, NotImplemented {
73

    
74
		return null;
75
	}
76
	
77
	/* End methods common to CNCore and MNCore APIs */
78

    
79
	/* Methods common to CNRead and MNRead APIs */
80
	
81
	/**
82
	 * Return the object identified by the given object identifier
83
	 * 
84
	 * @param session - the Session object containing the credentials for the Subject
85
	 * @param pid - the object identifier for the given object
86
	 * 
87
	 * @return inputStream - the input stream of the given object
88
	 * 
89
	 * @throws InvalidToken
90
	 * @throws ServiceFailure
91
	 * @throws NotAuthorized
92
	 * @throws InvalidRequest
93
	 * @throws NotImplemented
94
	 */
95
	public InputStream get(Session session, Identifier pid) 
96
	  throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, 
97
	  NotImplemented, InvalidRequest {
98

    
99
		return null;
100
	}
101

    
102
	/**
103
	 * Return the system metadata for a given object
104
	 * 
105
	 * @param session - the Session object containing the credentials for the Subject
106
	 * @param pid - the object identifier for the given object
107
	 * 
108
	 * @return inputStream - the input stream of the given system metadata object
109
	 * 
110
	 * @throws InvalidToken
111
	 * @throws ServiceFailure
112
	 * @throws NotAuthorized
113
	 * @throws NotFound
114
	 * @throws InvalidRequest
115
	 * @throws NotImplemented
116
	 */
117
	public SystemMetadata getSystemMetadata(Session session, Identifier pid)
118
    throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
119
    InvalidRequest, NotImplemented {
120

    
121
		return null;
122
  }
123
	
124
	/* End methods common to CNRead and MNRead APIs */
125

    
126
	/* Methods common to CNAuthorization and MNAuthorization APIs */
127
  
128
	/**
129
	 * Set access for a given object using the object identifier and a Subject
130
	 * under a given Session.
131
	 * 
132
	 * @param session - the Session object containing the credentials for the Subject
133
	 * @param pid - the object identifier for the given object to apply the policy
134
	 * @param policy - the access policy to be applied
135
	 * 
136
	 * @return true if the application of the policy succeeds
137
	 * @throws InvalidToken
138
	 * @throws ServiceFailure
139
	 * @throws NotFound
140
	 * @throws NotAuthorized
141
	 * @throws NotImplemented
142
	 * @throws InvalidRequest
143
	 */
144
	public boolean setAccessPolicy(Session session, Identifier pid, 
145
    AccessPolicy accessPolicy) 
146
	  throws InvalidToken, ServiceFailure, NotFound, NotAuthorized, 
147
	  NotImplemented, InvalidRequest {
148

    
149
		return false;
150
	}
151

    
152
	/* End methods common to CNAuthorization and MNAuthorization APIs */
153

    
154
}
(4-4/8)