gluu
公開メンバ関数 | 非公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.gluu.oxtrust.ldap.service.ScopeService クラス
org.gluu.oxtrust.ldap.service.ScopeService の継承関係図
Inheritance graph
org.gluu.oxtrust.ldap.service.ScopeService 連携図
Collaboration graph

公開メンバ関数

void addScope (OxAuthScope scope) throws Exception
 
void removeScope (OxAuthScope scope) throws Exception
 
OxAuthScope getScopeByInum (String inum) throws Exception
 
String getDnForScope (String inum) throws Exception
 
void updateScope (OxAuthScope scope) throws Exception
 
String generateInumForNewScope () throws Exception
 
List< OxAuthScopesearchScopes (String pattern, int sizeLimit) throws Exception
 
OxAuthScope getScopeByDn (String Dn) throws Exception
 
List< ScopeTypegetScopeTypes ()
 
OxAuthScope getScopeByDisplayName (String DisplayName) throws Exception
 

非公開メンバ関数

String generateInumForNewScopeImpl () throws Exception
 

非公開変数類

PersistenceEntryManager ldapEntryManager
 
OrganizationService organizationService
 
Logger logger
 

静的非公開変数類

static final long serialVersionUID = 65734145678106186L
 

詳解

Provides operations with Scopes

著者
Reda Zerrad Date: 06.18.2012

関数詳解

◆ addScope()

void org.gluu.oxtrust.ldap.service.ScopeService.addScope ( OxAuthScope  scope) throws Exception
inline

Add new scope entry

引数
scopescope
52  {
53  ldapEntryManager.persist(scope);
54  }
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39

◆ generateInumForNewScope()

String org.gluu.oxtrust.ldap.service.ScopeService.generateInumForNewScope ( ) throws Exception
inline

Generate new inum for scope

戻り値
New inum for scope
116  {
117  OxAuthScope scope = new OxAuthScope();
118  String newInum = null;
119  do {
120  newInum = generateInumForNewScopeImpl();
121  String newDn = getDnForScope(newInum);
122  scope.setDn(newDn);
123  } while (ldapEntryManager.contains(scope));
124 
125  return newInum;
126  }
String getDnForScope(String inum)
Definition: ScopeService.java:92
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39
String generateInumForNewScopeImpl()
Definition: ScopeService.java:161

◆ generateInumForNewScopeImpl()

String org.gluu.oxtrust.ldap.service.ScopeService.generateInumForNewScopeImpl ( ) throws Exception
inlineprivate

Generate new inum for Scope

戻り値
New inum for Scope
例外
Exception
161  {
162  String orgInum = organizationService.getInumForOrganization();
163  return orgInum + OxTrustConstants.inumDelimiter + "0009" + OxTrustConstants.inumDelimiter
164  + INumGenerator.generate(2);
165 
166  }
OrganizationService organizationService
Definition: ScopeService.java:41
String getInumForOrganization()
Definition: OrganizationService.java:189

◆ getDnForScope()

String org.gluu.oxtrust.ldap.service.ScopeService.getDnForScope ( String  inum) throws Exception
inline

Build DN string for scope

引数
inumscope Inum
戻り値
DN string for specified scope or DN for scopes branch if inum is null
例外
Exception
92  {
94  if (StringHelper.isEmpty(inum)) {
95  return String.format("ou=scopes,%s", orgDn);
96  }
97 
98  return String.format("inum=%s,ou=scopes,%s", inum, orgDn);
99  }
OrganizationService organizationService
Definition: ScopeService.java:41
String getDnForOrganization(String inum)
Definition: OrganizationService.java:106

◆ getScopeByDisplayName()

OxAuthScope org.gluu.oxtrust.ldap.service.ScopeService.getScopeByDisplayName ( String  DisplayName) throws Exception
inline

Get scope by DisplayName

引数
DisplayName
戻り値
scope
197  {
198  OxAuthScope scope = new OxAuthScope();
199  scope.setBaseDn(getDnForScope(null));
200  scope.setDisplayName(DisplayName);
201 
202  List<OxAuthScope> scopes = ldapEntryManager.findEntries(scope);
203 
204  if ((scopes != null) && (scopes.size() > 0)) {
205  return scopes.get(0);
206  }
207 
208  return null;
209  }
String getDnForScope(String inum)
Definition: ScopeService.java:92
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39

◆ getScopeByDn()

OxAuthScope org.gluu.oxtrust.ldap.service.ScopeService.getScopeByDn ( String  Dn) throws Exception
inline

returns oxAuthScope by Dn

戻り値
oxAuthScope
174  {
175  OxAuthScope result = ldapEntryManager.find(OxAuthScope.class, Dn);
176 
177  return result;
178  }
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39

◆ getScopeByInum()

OxAuthScope org.gluu.oxtrust.ldap.service.ScopeService.getScopeByInum ( String  inum) throws Exception
inline

Get scope by inum

引数
inumscope Inum
戻り値
scope
74  {
75  OxAuthScope result = null;
76  try {
77  result = ldapEntryManager.find(OxAuthScope.class, getDnForScope(inum));
78  } catch (Exception e) {
79  logger.debug("", e);
80  }
81  return result;
82  }
String getDnForScope(String inum)
Definition: ScopeService.java:92
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39
Logger logger
Definition: ScopeService.java:44

◆ getScopeTypes()

List<ScopeType> org.gluu.oxtrust.ldap.service.ScopeService.getScopeTypes ( )
inline

Get all available scope types

戻り値
Array of scope types
185  {
186  List<ScopeType> scopeTypes = new ArrayList<ScopeType>(
187  Arrays.asList(org.xdi.oxauth.model.common.ScopeType.values()));
188  return scopeTypes;
189  }
Definition: ScopeType.java:21
Definition: AuthenticationMethod.java:7

◆ removeScope()

void org.gluu.oxtrust.ldap.service.ScopeService.removeScope ( OxAuthScope  scope) throws Exception
inline

Remove scope entry

引数
scopescope
62  {
63 
64  ldapEntryManager.remove(scope);
65  }
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39

◆ searchScopes()

List<OxAuthScope> org.gluu.oxtrust.ldap.service.ScopeService.searchScopes ( String  pattern,
int  sizeLimit 
) throws Exception
inline

Search scopes by pattern

引数
patternPattern
sizeLimitMaximum count of results
戻り値
List of scopes
例外
Exception
138  {
139  Filter searchFilter = null;
140  if (StringHelper.isNotEmpty(pattern)) {
141  String[] targetArray = new String[] { pattern };
142  Filter displayNameFilter = Filter.createSubstringFilter(OxTrustConstants.displayName, null, targetArray,
143  null);
144  Filter descriptionFilter = Filter.createSubstringFilter(OxTrustConstants.description, null, targetArray,
145  null);
146  Filter inameFilter = Filter.createSubstringFilter(OxTrustConstants.iname, null, targetArray, null);
147  searchFilter = Filter.createORFilter(displayNameFilter, descriptionFilter, inameFilter);
148  }
149  List<OxAuthScope> result = ldapEntryManager.findEntries(getDnForScope(null), OxAuthScope.class, searchFilter,
150  sizeLimit);
151 
152  return result;
153  }
String getDnForScope(String inum)
Definition: ScopeService.java:92
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39

◆ updateScope()

void org.gluu.oxtrust.ldap.service.ScopeService.updateScope ( OxAuthScope  scope) throws Exception
inline

Update scope entry

引数
scopescope
107  {
108  ldapEntryManager.merge(scope);
109  }
PersistenceEntryManager ldapEntryManager
Definition: ScopeService.java:39

メンバ詳解

◆ ldapEntryManager

PersistenceEntryManager org.gluu.oxtrust.ldap.service.ScopeService.ldapEntryManager
private

◆ logger

Logger org.gluu.oxtrust.ldap.service.ScopeService.logger
private

◆ organizationService

OrganizationService org.gluu.oxtrust.ldap.service.ScopeService.organizationService
private

◆ serialVersionUID

final long org.gluu.oxtrust.ldap.service.ScopeService.serialVersionUID = 65734145678106186L
staticprivate

このクラス詳解は次のファイルから抽出されました: