Skip to main content
summaryrefslogtreecommitdiffstats
blob: e8a68f4ede52868b37856812b7ebcb5f4447a54e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c) 2010-2011 Composent, Inc. and others. All rights reserved. This
 * program and the accompanying materials are made available under the terms of
 * the Eclipse Public License v1.0 which accompanies this distribution, and is
 * available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Composent, Inc. - initial API and implementation
 ******************************************************************************/
package org.eclipse.ecf.osgi.services.remoteserviceadmin;

import java.util.Arrays;
import java.util.Collection;

import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter;

/**
 * Exception class for the case when no remote reference is found during
 * {@link RemoteServiceAdmin#importService(org.osgi.service.remoteserviceadmin.EndpointDescription)}
 * . Instances of this class will be thrown when the call to
 * {@link IRemoteServiceContainerAdapter#getRemoteServiceReferences(ID, ID[], String, String)}
 * made in
 * {@link RemoteServiceAdmin#importService(org.osgi.service.remoteserviceadmin.EndpointDescription)}
 * fail to find any available remote references (e.g. due to connection problem
 * or remote reference lookup problem).
 * 
 */
public class RemoteReferenceNotFoundException extends Exception {

	private static final long serialVersionUID = -4174685192086828376L;

	private ID targetID;
	private ID[] idFilter;
	private Collection<String> interfaces;
	private String rsFilter;

	public RemoteReferenceNotFoundException(ID targetID, ID[] idFilter,
			Collection<String> interfaces, String rsFilter) {
		this.targetID = targetID;
		this.idFilter = idFilter;
		this.interfaces = interfaces;
		this.rsFilter = rsFilter;
	}

	public ID getTargetID() {
		return targetID;
	}

	public ID[] getIdFilter() {
		return idFilter;
	}

	public Collection<String> getInterfaces() {
		return interfaces;
	}

	public String getRsFilter() {
		return rsFilter;
	}

	public String toString() {
		return "RemoteReferenceNotFoundException[targetID=" + targetID //$NON-NLS-1$
				+ ", idFilter=" + Arrays.toString(idFilter) + ", interfaces=" //$NON-NLS-1$ //$NON-NLS-2$
				+ interfaces + ", rsFilter=" + rsFilter + "]"; //$NON-NLS-1$ //$NON-NLS-2$
	}

}

Back to the top