/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm;
import org.apache.felix.dm.DependencyActivatorBase;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm;
import java.sql.Connection;
-/* Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+/*
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm;
import static org.opendaylight.aaa.idm.persistence.StoreBuilder.DEFAULT_DOMAIN;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.config;
/**
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
@XmlRootElement(name = "Claim")
public class Claim {
private Integer domainid;
- private Integer userid;
+ private Integer userid;
private String username;
private List<Role> roles;
public void setUsername(String name) {
this.username = name;
- }
+ }
public List<Role> getRoles() {
return roles;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setName(String name) {
this.name = name;
- }
+ }
public String getDescription() {
return description;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setDomains(List<Domain> domains) {
this.domains = domains;
- }
+ }
public List<Domain> getDomains() {
return domains;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setDomainid(Integer id) {
this.domainid = id;
}
-
+
public Integer getUserid() {
return userid;
}
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setGrants(List<Grant> grants) {
this.grants = grants;
- }
+ }
public List<Grant> getGrants() {
return grants;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
this.details=details;
}
- public Response response() {
+ public Response response() {
logger.error("error: " + this.message + " details: " + this.details + " status: " + code);
return Response.status(this.code).entity(this).build();
}
-
+
}
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setName(String name) {
this.name = name;
- }
+ }
public String getDescription() {
return description;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setRoles(List<Role> roles) {
this.roles = roles;
- }
+ }
public List<Role> getRoles() {
return roles;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setName(String name) {
this.name = name;
- }
+ }
public String getDescription() {
return description;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setUsername(String name) {
this.username = name;
- }
+ }
public String getUserpwd() {
return userpwd;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
public void setUsers(List<User> users) {
this.users = users;
- }
+ }
public List<User> getUsers() {
return users;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.model;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
/**
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
/**
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
/**
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
- *
*/
package org.opendaylight.aaa.idm.persistence;
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
import org.opendaylight.aaa.idm.persistence.DomainStore;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
import org.slf4j.Logger;
private static Logger logger = LoggerFactory.getLogger(StoreException.class);
public String message=null;
-
+
public StoreException(String msg) {
- logger.error(msg);
+ logger.error(msg);
message = new String(msg);
}
}
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
/**
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.rest;
/**
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.rest;
/**
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.rest;
/**
/*
- * Copyright (c) 2014 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.rest;
/**
*
- * @author peter.mellquist@hp.com
+ * @author peter.mellquist@hp.com
*
*/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.aaa.idm.model.Version;
-
+
@Path("/")
public class VersionHandler {
- private static Logger logger = LoggerFactory.getLogger(VersionHandler.class);;
-
+ private static Logger logger = LoggerFactory.getLogger(VersionHandler.class);;
+
protected static String CURRENT_VERSION = "v1";
protected static String LAST_UPDATED = "2014-04-18T18:30:02.25Z";
- protected static String CURRENT_STATUS = "CURRENT";
-
+ protected static String CURRENT_STATUS = "CURRENT";
+
@GET
@Produces("application/json")
public Version getVersion(@Context HttpServletRequest request) {
Version version = new Version();
version.setId(CURRENT_VERSION);
version.setUpdated(LAST_UPDATED);
- version.setStatus(CURRENT_STATUS);
- return version;
+ version.setStatus(CURRENT_STATUS);
+ return version;
}
-
+
}
/*
- * Copyright (c) 2014-2015 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
/*
- * Copyright (c) 2014-2015 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
- *
*/
+
package org.opendaylight.aaa.idm.persistence;
+
import java.io.File;
import org.junit.After;
/*
- * Copyright (c) 2014-2015 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
+
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import static org.mockito.Matchers.*;
/*
- * Copyright (c) 2014-2015 Hewlett-Packard Development Company, L.P. and others.
- * All rights reserved.
+ * Copyright (c) 2014, 2015 Hewlett-Packard Development Company, L.P. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
- * terms of the Eclipse License v1.0 which accompanies this distribution,
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.aaa.idm.persistence;
+
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import static org.mockito.Matchers.*;