/** * Constructs a new Proxy Resolution endpoint. * @param resolvers - The Uri(s) where the proxy is implemented. * @param providerID - The global i-number of the I-Broker providing this Proxy Resolution Service. * @param trustType - The Trust Type supported by the proxy * @param refs - Whether the proxy supports following references * @param sep - Whether the proxy supports service endpoint selection */ public ProxyResolutionService(Uri[] proxies, string providerID, TrustType trustType, bool? refs, bool? sep) { /* * The ProviderID of a Proxy Resolution Service is OPTIONAL. */ if (providerID != null) this.setProviderId(providerID); /* * This setting is REQUIRED. */ this.addType(new SEPType(SERVICE_TYPE, null, true)); /* * This setting is REQUIRED. */ for (int i = 0; i < SERVICE_MEDIA_TYPES.Length; i++) { string mediaType = SERVICE_MEDIA_TYPES[i]; if (trustType != null && !trustType.Equals(TrustType.TRUST_NONE)) { mediaType += TRUST_TYPE_SEPARATOR + trustType.getParameterPair(); if (refs != null) mediaType += REFS_SEPARATOR + refs; if (sep != null) mediaType += SEP_SEPARATOR + sep; } this.addMediaType(new SEPMediaType(mediaType, null, false)); } /* * These are the URIs where the Proxy Resolution Service is implemented. */ for (int i = 0; i < proxies.Length; i++) { Uri resolver = proxies[i]; try { int? priority = resolver.Scheme.Equals("https", StringComparison.OrdinalIgnoreCase) ? URI_PRIORITY_HTTPS : URI_PRIORITY_DEFAULT; this.addURI(new SEPUri(resolver.ToString(), priority, SEPUri.APPEND_NONE)); } catch (UriFormatException) { continue; } } }
/** * Constructs a new Authority Resolution 2.0 endpoint. * @param resolvers - The Uri(s) where the authority will be resolved. * @param providerID - The global i-number of the I-Broker providing this Authority Resolution Service. * @param append - The append attribute to use for the URIs. */ public AuthorityResolutionService(Uri[] resolvers, string providerID, TrustType trustType, string append) { if (append == null) append = SEPUri.APPEND_NONE; /* * The ProviderID of an untrusted Authority Resolution Service is OPTIONAL, otherwise REQUIRED. */ if (providerID != null) this.setProviderId(providerID); /* * This setting is REQUIRED. */ this.addType(new SEPType(SERVICE_TYPE, null, true)); /* * This setting is REQUIRED. */ string mediaType = SERVICE_MEDIA_TYPE; if (trustType != null && !trustType.Equals(TrustType.TRUST_NONE)) { mediaType += TRUST_TYPE_SEPARATOR + trustType.getParameterPair(); } this.addMediaType(new SEPMediaType(mediaType, null, false)); /* * These are the URIs where the Authority Resolution Service is implemented. */ for (int i = 0; i < resolvers.Length; i++) { Uri resolver = resolvers[i]; try { int? priority = resolver.Scheme.Equals("https", StringComparison.OrdinalIgnoreCase) ? URI_PRIORITY_HTTPS : URI_PRIORITY_DEFAULT; this.addURI(new SEPUri(resolver.ToString(), priority, append)); } catch (UriFormatException) { continue; } } }