Interface ADEPT2RemoteObjectIdentifierFactory
-
public interface ADEPT2RemoteObjectIdentifierFactory
This factory is responsible to create remote object identifiers and callback object identifiers valid for the communication service this factory is assigned to.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
checkServiceURI(URI serviceURI)
Validates whether the designated URI is well-formed and may identify a service instance.default URI
createCallbackIdentifier(Class<?> callbackInterface)
Deprecated.UsecreateCallbackIds(Class)
instead.Pair<URI,String>
createCallbackIds(Class<?> callbackIface)
Creates a URI as remote object identifier and a name for a callback object of the designated type.default URI
createRemoteObjectIdentifier(String serviceType, String serviceInstance)
Deprecated.UsecreateRemoteObjectIds(String, String)
instead.Pair<URI,String>
createRemoteObjectIds(String serviceType, String serviceInst)
Creates a URI and a service name with which to export and register the designated designated ADEPT2 service.String
getCallbackObjectIface(URI callbackUri)
Gets the callback ID (name, which is also the interface of the callback object) the designated URI refers to.Pair<String,Boolean>
getCallbackObjectName(URI callbackUri)
Gets the callback ID (name and count) as path of the callback object the designated URI refers to and whether the URI refers to the logical host of this host or not.static String
getHostnameCombined(String hostname, Integer port)
Gets the name of the designated host and port combined into one string.default String
getInstanceNameFromServiceURI(URI serviceURI)
Deprecated.UsegetServiceInstName(URI)
instead.Pair<String,Boolean>
getServiceInstName(URI serviceUri)
Gets the hierarchical name of the service instance the designated URI refers to and whether the URI refers to the logical host of this host or not.Pair<String,String>
getServiceInstNames(URI serviceUri)
Gets the component type name and the simple instance name of the service instance the designated URI refers to.
-
-
-
Method Detail
-
createRemoteObjectIdentifier
@Deprecated default URI createRemoteObjectIdentifier(String serviceType, String serviceInstance)
Deprecated.UsecreateRemoteObjectIds(String, String)
instead.Creates a remote object identifier for the specified ADEPT2 service.- Parameters:
serviceType
- The type of the requested ADEPT2 service as it is known to the ADEPT2 registry.serviceInstance
- The name of the service instance as it is known to the ADEPT2 registry.- Returns:
- The remote object identifier for the designated remote service.
-
createCallbackIdentifier
@Deprecated default URI createCallbackIdentifier(Class<?> callbackInterface)
Deprecated.UsecreateCallbackIds(Class)
instead.Creates a remote object identifier for an callback object of the specified type.- Parameters:
callbackInterface
- The type of the callback object to identify.- Returns:
- The remote object identifier for the designated callback object.
-
createRemoteObjectIds
Pair<URI,String> createRemoteObjectIds(String serviceType, String serviceInst)
Creates a URI and a service name with which to export and register the designated designated ADEPT2 service.- Parameters:
serviceType
- The type of the requested ADEPT2 service as it is known to the ADEPT2 registry.serviceInst
- The name of the service instance as it is known to the ADEPT2 registry.- Returns:
- A URI as remote object identifier and a name for the designated ADEPT2 service.
-
createCallbackIds
Pair<URI,String> createCallbackIds(Class<?> callbackIface)
Creates a URI as remote object identifier and a name for a callback object of the designated type.- Parameters:
callbackIface
- The type of the callback object to identify.- Returns:
- A URI as remote object identifier and a name for a callback object of the designated type.
-
checkServiceURI
void checkServiceURI(URI serviceURI)
Validates whether the designated URI is well-formed and may identify a service instance.- Parameters:
serviceURI
- The URI to check for validity.- Throws:
IllegalArgumentException
- If the service URI is invalid, anIllegalArgumentException
will be thrown.
-
getInstanceNameFromServiceURI
@Deprecated default String getInstanceNameFromServiceURI(URI serviceURI)
Deprecated.UsegetServiceInstName(URI)
instead.Returns the hierarchical instance name from the service URI.
Only to be called by the registry or communication framework.Whenever the instance name needs to be derived from a services URI, this method should be called. This keeps the way, how the instance name is stored in the URI more exchangeable.
- Parameters:
serviceURI
- The service URI.- Returns:
- The hierarchical instance name from the service URI.
- Throws:
IllegalArgumentException
- If the service URI is invalid for this communication service, anIllegalArgumentException
will be thrown.
-
getServiceInstName
Pair<String,Boolean> getServiceInstName(URI serviceUri)
Gets the hierarchical name of the service instance the designated URI refers to and whether the URI refers to the logical host of this host or not. If the URI does not contain a logical host, this cannot be decided andnull
will be returned. If logical host is disabled completely for this communication service, the network host will be checked, therefore in this case theBoolean
will never benull
.- Parameters:
serviceUri
- The URI of the service called remotely.- Returns:
- The hierarchical name of the service instance the designated URI refers to and whether
the URI refers to the logical host of this host or not. If it does not contain a
logical host,
null
will be returned unless logical host is disabled for this communication service which will compare the network hosts. - Throws:
IllegalArgumentException
- If the designated URI is invalid for this communication service or does not refer to a service URI, anIllegalArgumentException
will be thrown.
-
getServiceInstNames
Pair<String,String> getServiceInstNames(URI serviceUri)
Gets the component type name and the simple instance name of the service instance the designated URI refers to.- Parameters:
serviceUri
- The URI of the service called remotely.- Returns:
- The component type name and the simple instance name of the service instance the designated URI refers to.
- Throws:
IllegalArgumentException
- If the designated URI is invalid for this communication service or does not refer to a service URI, anIllegalArgumentException
will be thrown.
-
getCallbackObjectName
Pair<String,Boolean> getCallbackObjectName(URI callbackUri)
Gets the callback ID (name and count) as path of the callback object the designated URI refers to and whether the URI refers to the logical host of this host or not. If the URI does not contain a logical host, this cannot be decided andnull
will be returned. If logical host is disabled completely for this communication service, the network host will be checked, therefore in this case theBoolean
will never benull
.- Parameters:
callbackUri
- The URI of the callback object.- Returns:
- The callback ID (name and count) as path of the callback object the designated URI
refers to and whether the URI refers to the logical host of this host or not. If it
does not contain a logical host,
null
will be returned unless logical host is disabled for this communication service which will compare the network hosts. - Throws:
IllegalArgumentException
- If the designated URI is invalid for this communication service or does not refer to a callback object, anIllegalArgumentException
will be thrown.
-
getCallbackObjectIface
String getCallbackObjectIface(URI callbackUri)
Gets the callback ID (name, which is also the interface of the callback object) the designated URI refers to.- Parameters:
callbackUri
- The URI of the callback object.- Returns:
- The callback ID (name, which is also the interface of the callback object) the designated URI refers to.
- Throws:
IllegalArgumentException
- If the designated URI is invalid for this communication service or does not refer to a callback object, anIllegalArgumentException
will be thrown.
-
getHostnameCombined
static String getHostnameCombined(String hostname, Integer port)
Gets the name of the designated host and port combined into one string. If the designated hostname isnull
,null
will be returned. If the designated port isnull
or <0, the returned name will not contain a port.- Parameters:
hostname
- The name of the host ornull
.port
- The port of the host ornull
.- Returns:
- The name of the host combining the designated name and port or
null
.
-
-