- public String readableErrMsg(Future<?> f) {
- String text = f.body();
- if(text==null || text.length()==0) {
- text = f.code() + ": **No Message**";
- } else if(text.contains("%")) {
- try {
- Error err = errDF.newData().in(TYPE.JSON).load(f.body()).asObject();
- return Vars.convert(err.getText(),err.getVariables());
- } catch (APIException e){
- access.log(e);
- }
- }
- return text;
- }
-
- public static AAFCon<?> newInstance(PropAccess pa) throws CadiException, LocatorException {
- // Potentially add plugin for other kinds of Access
- return new AAFConHttp(pa);
- }
+ public String getRealm() {
+ return realm;
+
+ }
+
+ /**
+ * This interface allows the AAFCon, even though generic, to pass in correctly typed values based on the above SS commands.
+ * @author Jonathan
+ *
+ */
+ public interface GetSetter {
+ public<CLIENT> SecuritySetter<CLIENT> get(AAFCon<CLIENT> con) throws CadiException;
+ }
+
+ public SecuritySetter<CLIENT> set(final SecuritySetter<CLIENT> ss) {
+ si.set(ss);
+ for (Rcli<CLIENT> client : clients.values()) {
+ client.setSecuritySetter(ss);
+ }
+ return ss;
+ }
+
+ public SecurityInfoC<CLIENT> securityInfo() {
+ return si;
+ }
+
+ public String defID() {
+ if (si!=null) {
+ return si.defSS.getID();
+ }
+ return "unknown";
+ }
+
+ public void invalidate() throws CadiException {
+ for (Rcli<CLIENT> client : clients.values()) {
+ client.invalidate();
+ }
+ clients.clear();
+ }
+
+ public String readableErrMsg(Future<?> f) {
+ String text = f.body();
+ if (text==null || text.length()==0) {
+ text = f.code() + ": **No Message**";
+ } else if (text.contains("%")) {
+ try {
+ Error err = errDF.newData().in(TYPE.JSON).load(f.body()).asObject();
+ return Vars.convert(err.getText(),err.getVariables());
+ } catch (APIException e){
+ access.log(e);
+ }
+ }
+ return text;
+ }
+
+ public static AAFCon<?> newInstance(PropAccess pa) throws CadiException, LocatorException {
+ // Potentially add plugin for other kinds of Access
+ return new AAFConHttp(pa);
+ }