- Define.set(access);
- ROOT_NS = Define.ROOT_NS();
- this.access = access;
- this.env = env;
-
- String component = access.getProperty(Config.AAF_COMPONENT, null);
- final String[] locator_deploy;
-
- if(component == null) {
- locator_deploy = null;
- } else {
- locator_deploy = Split.splitTrim(':', component);
- }
-
- if(component == null || locator_deploy==null || locator_deploy.length<2) {
- throw new CadiException("AAF Component must include the " + Config.AAF_COMPONENT + " property, <fully qualified service name>:<full deployed version (i.e. 2.1.3.13)");
- }
- final String[] version = Split.splitTrim('.', locator_deploy[1]);
- if(version==null || version.length<2) {
- throw new CadiException("AAF Component Version must have at least Major.Minor version");
- }
- app_name = Define.varReplace(locator_deploy[0]);
- app_version = locator_deploy[1];
- app_interface_version = version[0]+'.'+version[1];
-
- // Print Cipher Suites Available
- if(access.willLog(Level.DEBUG)) {
- SSLContext context;
- try {
- context = SSLContext.getDefault();
- } catch (NoSuchAlgorithmException e) {
- throw new CadiException("SSLContext issue",e);
- }
- SSLSocketFactory sf = context.getSocketFactory();
- StringBuilder sb = new StringBuilder("Available Cipher Suites: ");
- boolean first = true;
- int count=0;
- for( String cs : sf.getSupportedCipherSuites()) {
- if(first)first = false;
- else sb.append(',');
- sb.append(cs);
- if(++count%4==0){sb.append('\n');}
- }
- access.log(Level.DEBUG,sb);
- }
+ Define.set(access);
+ rootNs = Define.ROOT_NS();
+ this.access = access;
+ this.env = env;
+
+ String str = access.getProperty(Config.AAF_LOCATOR_ENTRIES, null);
+ String[] scomp = Split.splitTrim(',', str);
+ if(scomp.length==0) {
+ throw new CadiException(Config.AAF_LOCATOR_ENTRIES + " must be defined.");
+ } else {
+ str = rootNs + '.' + scomp[0];
+ }
+ appName = str;
+
+ str = access.getProperty(Config.AAF_LOCATOR_VERSION, null);
+ if(str==null) {
+ str = Defaults.AAF_VERSION;
+ env.setProperty(Config.AAF_LOCATOR_VERSION, str);
+ }
+ appVersion = access.getProperty(Config.AAF_DEPLOYED_VERSION, str);
+
+ // Print Cipher Suites Available
+ if (access.willLog(Level.DEBUG)) {
+ SSLContext context;
+ try {
+ context = SSLContext.getDefault();
+ } catch (NoSuchAlgorithmException e) {
+ throw new CadiException("SSLContext issue",e);
+ }
+ SSLServerSocketFactory sf = context.getServerSocketFactory();
+ StringBuilder sb = new StringBuilder("Available Cipher Suites: ");
+ boolean first = true;
+ int count=0;
+ for ( String cs : sf.getSupportedCipherSuites()) {
+ if (first)first = false;
+ else sb.append(',');
+ sb.append(cs);
+ if (++count%4==0){sb.append('\n');}
+ }
+ access.log(Level.DEBUG,sb);
+ }
+ }
+
+ public void setProtocol(String proto) {
+ env.setProperty(Config.AAF_LOCATOR_PROTOCOL, proto);
+ }
+
+ public void setSubprotocol(String subproto) {
+ env.setProperty(Config.AAF_LOCATOR_SUBPROTOCOL, subproto);
+ }
+
+ protected abstract Filter[] _filters(Object ... additionalTafLurs) throws CadiException, LocatorException;
+
+ /**
+ * Overload this method to add new TAF or LURs
+ *
+ * @return
+ * @throws CadiException
+ * @throws LocatorException
+ */
+ public Filter[] filters() throws CadiException, LocatorException {
+ return _filters();