| 1 |
/* |
| 2 |
* junixsocket |
| 3 |
* |
| 4 |
* Copyright 2009-2022 Christian Kohlschütter |
| 5 |
* |
| 6 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 |
* you may not use this file except in compliance with the License. |
| 8 |
* You may obtain a copy of the License at |
| 9 |
* |
| 10 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
* |
| 12 |
* Unless required by applicable law or agreed to in writing, software |
| 13 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
* See the License for the specific language governing permissions and |
| 16 |
* limitations under the License. |
| 17 |
*/ |
| 18 |
package org.newsclub.net.unix.rmi; |
| 19 |
|
| 20 |
import java.io.IOException; |
| 21 |
import java.rmi.Remote; |
| 22 |
|
| 23 |
import org.newsclub.net.unix.AFUNIXSocketCredentials; |
| 24 |
|
| 25 |
/** |
| 26 |
* A test service. |
| 27 |
* |
| 28 |
* @author Christian Kohlschütter |
| 29 |
*/ |
| 30 |
public interface TestService extends Remote { |
| 31 |
RemoteFileDescriptor stdout() throws IOException; |
| 32 |
|
| 33 |
RemoteFileInput input() throws IOException; |
| 34 |
|
| 35 |
RemoteFileInput input(long skipBytes) throws IOException; |
| 36 |
|
| 37 |
RemoteFileOutput output() throws IOException; |
| 38 |
|
| 39 |
void verifyContents(byte[] expectedData) throws IOException; |
| 40 |
|
| 41 |
void verifyContents(int numBytes, byte[] expectedData) throws IOException; |
| 42 |
|
| 43 |
void touchFile() throws IOException; |
| 44 |
|
| 45 |
void deleteFile() throws IOException; |
| 46 |
|
| 47 |
NaiveFileInputStreamRemote naiveInputStreamRemote() throws IOException; |
| 48 |
|
| 49 |
AFUNIXSocketCredentials remotePeerCredentials() throws IOException; |
| 50 |
|
| 51 |
<T extends RemoteCloseableThing> RemoteCloseable<? extends T> remoteCloseable(Class<T> klass) |
| 52 |
throws IOException; |
| 53 |
|
| 54 |
<T extends RemoteCloseableThing> void remoteCloseableThingResetNumberOfCloseCalls(Class<T> klass) |
| 55 |
throws IOException; |
| 56 |
|
| 57 |
<T extends RemoteCloseableThing> int remoteCloseableThingNumberOfCloseCalls(Class<T> klass) |
| 58 |
throws IOException; |
| 59 |
} |