* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import aafoauth.v2_0.Introspect;
public class AAF_OAuth extends AbsService<AuthzEnv,AuthzTrans> {
import aafoauth.v2_0.Introspect;
public class AAF_OAuth extends AbsService<AuthzEnv,AuthzTrans> {
public Map<String, Dated> cacheUser;
public AAFAuthn<?> aafAuthn;
public AAFLurPerm aafLurPerm;
private final OAuthService service;
private OAFacade1_0 facade1_0;
private final Question question;
public Map<String, Dated> cacheUser;
public AAFAuthn<?> aafAuthn;
public AAFLurPerm aafLurPerm;
private final OAuthService service;
private OAFacade1_0 facade1_0;
private final Question question;
// Initialize Facade for all uses
AuthzTrans trans = env.newTrans();
cluster = org.onap.aaf.auth.dao.CassAccess.cluster(env,null);
// Initialize Facade for all uses
AuthzTrans trans = env.newTrans();
cluster = org.onap.aaf.auth.dao.CassAccess.cluster(env,null);
aafLurPerm = aafCon().newLur();
// Note: If you need both Authn and Authz construct the following:
aafAuthn = aafCon().newAuthn(aafLurPerm);
// Start Background Processing
aafLurPerm = aafCon().newLur();
// Note: If you need both Authn and Authz construct the following:
aafAuthn = aafCon().newAuthn(aafLurPerm);
// Start Background Processing
- // Question question =
- question = new Question(trans, cluster, CassAccess.KEYSPACE, true);
+ // Question question =
+ question = new Question(trans, cluster, CassAccess.KEYSPACE);
+ question.startTimers(env);
// Have AAFLocator object Create DirectLocators for Location needs
AbsAAFLocator.setCreator(new DirectLocatorCreator(env, question.locateDAO));
// Have AAFLocator object Create DirectLocators for Location needs
AbsAAFLocator.setCreator(new DirectLocatorCreator(env, question.locateDAO));
* We do this by taking the Code passed in and creating clones of these with the appropriate Facades and properties
* to do Versions and Content switches
* We do this by taking the Code passed in and creating clones of these with the appropriate Facades and properties
* to do Versions and Content switches
*/
public void route(HttpMethods meth, String path, API api, HttpCode<AuthzTrans, OAFacade<Introspect>> code) throws Exception {
String version = "1.0";
// Get Correct API Class from Mapper
*/
public void route(HttpMethods meth, String path, API api, HttpCode<AuthzTrans, OAFacade<Introspect>> code) throws Exception {
String version = "1.0";
// Get Correct API Class from Mapper
if (respCls==null) throw new Exception("Unknown class associated with " + api.getClass().getName() + ' ' + api.name());
// setup Application API HTML ContentTypes for JSON and Route
String application = applicationJSON(respCls, version);
if (respCls==null) throw new Exception("Unknown class associated with " + api.getClass().getName() + ' ' + api.name());
// setup Application API HTML ContentTypes for JSON and Route
String application = applicationJSON(respCls, version);
route(env,meth,path,code,application,"application/json;version="+version,"*/*");
}
}
route(env,meth,path,code,application,"application/json;version="+version,"*/*");
}
}
if (additionalTafLurs.length>0) {
System.arraycopy(additionalTafLurs, 0, atl, 2, additionalTafLurs.length);
}
if (additionalTafLurs.length>0) {
System.arraycopy(additionalTafLurs, 0, atl, 2, additionalTafLurs.length);
}
return new Filter[] {
new AuthzTransFilter(env,aafCon(),
new AAFTrustChecker((Env)env),
return new Filter[] {
new AuthzTransFilter(env,aafCon(),
new AAFTrustChecker((Env)env),
@SuppressWarnings("unchecked")
@Override
public Registrant<AuthzEnv>[] registrants(final int port) throws CadiException {
@SuppressWarnings("unchecked")
@Override
public Registrant<AuthzEnv>[] registrants(final int port) throws CadiException {
Log4JLogIt logIt = new Log4JLogIt(args, "oauth");
PropAccess propAccess = new PropAccess(logIt,args);
Log4JLogIt logIt = new Log4JLogIt(args, "oauth");
PropAccess propAccess = new PropAccess(logIt,args);
- AAF_OAuth service = new AAF_OAuth(new AuthzEnv(propAccess));
- JettyServiceStarter<AuthzEnv,AuthzTrans> jss = new JettyServiceStarter<AuthzEnv,AuthzTrans>(service);
- jss.start();
+ try {
+ new JettyServiceStarter<AuthzEnv,AuthzTrans>(
+ new AAF_OAuth(new AuthzEnv(propAccess)),true)
+ .start();
+ } catch (Exception e) {
+ propAccess.log(e);
+ }