![JAR search and dependency download from the Maven repository](/logo.png)
com.wadpam.oauth2.service.ConnectionServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oauth2-client Show documentation
Show all versions of oauth2-client Show documentation
Implements OAuth2 authentication on top of Open-Server security
The newest version!
/*
* INSERT COPYRIGHT HERE
*/
package com.wadpam.oauth2.service;
import com.wadpam.oauth2.dao.DConnectionDao;
import com.wadpam.oauth2.domain.DConnection;
import com.wadpam.open.mvc.MardaoCrudService;
import java.util.ArrayList;
import java.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
/**
*
* @author sosandstrom
*/
public class ConnectionServiceImpl extends MardaoCrudService
implements ConnectionService {
@Override
public Iterable queryByAppArg0(String appArg0) {
return dao.queryByAppArg0(appArg0);
}
public Iterable queryByProviderIdProviderUserId(String providerId, String providerUserId) {
return dao.queryByProviderIdProviderUserId(providerId, providerUserId);
}
public static String convertRoles(Iterable from) {
if (null == from) {
return null;
}
final StringBuffer to = new StringBuffer();
boolean first = true;
for (String s : from) {
if (!first) {
to.append(ROLE_SEPARATOR);
}
to.append(s.trim());
first = false;
}
return to.toString();
}
public static ArrayList convertRoles(String from) {
final ArrayList to = new ArrayList();
if (null != from) {
final String roles[] = from.split(ROLE_SEPARATOR);
for (String r : roles) {
to.add(r.trim());
}
}
return to;
}
@Autowired
public void setDConnectionDao(DConnectionDao dConnectionDao) {
this.dao = dConnectionDao;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy