-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
293 additions
and
31 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...chbase-sample/src/main/java/io/jans/orm/couchbase/CouchbaseScimSubstringSearchSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. | ||
* | ||
* Copyright (c) 2020, Janssen Project | ||
*/ | ||
|
||
package io.jans.orm.couchbase; | ||
|
||
import java.util.List; | ||
|
||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.jans.orm.couchbase.impl.CouchbaseEntryManager; | ||
import io.jans.orm.couchbase.operation.impl.CouchbaseConnectionProvider; | ||
import io.jans.orm.model.base.SimpleUser; | ||
import io.jans.orm.search.filter.Filter; | ||
|
||
/** | ||
* @author Yuriy Movchan Date: 11/03/2022 | ||
*/ | ||
public final class CouchbaseScimSubstringSearchSample { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(CouchbaseConnectionProvider.class); | ||
|
||
private CouchbaseScimSubstringSearchSample() { | ||
} | ||
|
||
public static void main(String[] args) { | ||
// Prepare sample connection details | ||
CouchbaseEntryManagerSample couchbaseEntryManagerSample = new CouchbaseEntryManagerSample(); | ||
|
||
// Create Couchbase entry manager | ||
CouchbaseEntryManager couchbaseEntryManager = couchbaseEntryManagerSample.createCouchbaseEntryManager(); | ||
Filter filter = Filter.createORFilter(Filter.createORFilter(Filter.createSubstringFilter("oxTrustPhoneValue", null, new String[] {"\"type\":null"}, null).multiValued(), Filter.createSubstringFilter("oxTrustPhoneValue", null, new String[] {"\"value\":\"", "+", "\""}, null).multiValued()), | ||
Filter.createSubstringFilter("mail", null, null, "jans.io")); | ||
System.out.println(filter); | ||
|
||
List<SimpleUser> users = couchbaseEntryManager.findEntries("ou=people,o=jans", SimpleUser.class, filter); | ||
for (SimpleUser user : users) { | ||
LOG.info("User with uid: '{}' with DN: '{}'", user.getUserId(), user.getDn()); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...m/sql-sample/src/main/java/SqlScimSubstringSearchSample/SqlScimSubstringSearchSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* oxCore is available under the MIT License (2014). See http://opensource.org/licenses/MIT for full text. | ||
* | ||
* Copyright (c) 2020, Gluu | ||
*/ | ||
|
||
package SqlScimSubstringSearchSample; | ||
|
||
import java.util.List; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.jans.orm.model.base.SimpleUser; | ||
import io.jans.orm.search.filter.Filter; | ||
import io.jans.orm.sql.impl.SqlEntryManager; | ||
import io.jans.orm.sql.persistence.SqlEntryManagerSample; | ||
|
||
/** | ||
* @author Yuriy Movchan Date: 11/03/2016 | ||
*/ | ||
public final class SqlScimSubstringSearchSample { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(SqlScimSubstringSearchSample.class); | ||
|
||
private SqlScimSubstringSearchSample() { | ||
} | ||
|
||
public static void main(String[] args) { | ||
// Prepare sample connection details | ||
SqlEntryManagerSample sqlEntryManagerSample = new SqlEntryManagerSample(); | ||
|
||
// Create Couchbase entry manager | ||
SqlEntryManager sqlEntryManager = sqlEntryManagerSample.createSqlEntryManager(); | ||
Filter filter = Filter.createORFilter(Filter.createORFilter(Filter.createSubstringFilter("oxTrustPhoneValue", null, new String[] {"\"type\":null"}, null).multiValued(), Filter.createSubstringFilter("oxTrustPhoneValue", null, new String[] {"\"value\":\"", "+", "\""}, null).multiValued()), | ||
Filter.createSubstringFilter("mail", null, null, "gluu.org")); | ||
System.out.println(filter); | ||
|
||
List<SimpleUser> users = sqlEntryManager.findEntries("ou=people,o=gluu", SimpleUser.class, filter); | ||
for (SimpleUser user : users) { | ||
LOG.info("User with uid: '{}' with DN: '{}'", user.getUserId(), user.getDn()); | ||
} | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
jans-orm/sql-sample/src/main/java/io/jans/orm/sql/SqlScimUserSearchSample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* oxCore is available under the MIT License (2014). See http://opensource.org/licenses/MIT for full text. | ||
* | ||
* Copyright (c) 2014, Gluu | ||
*/ | ||
|
||
package io.jans.orm.sql; | ||
|
||
import java.util.List; | ||
|
||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import io.jans.orm.search.filter.Filter; | ||
import io.jans.orm.sql.impl.SqlEntryManager; | ||
import io.jans.orm.sql.model.SimpleUser; | ||
import io.jans.orm.sql.operation.impl.SqlConnectionProvider; | ||
import io.jans.orm.sql.persistence.SqlEntryManagerSample; | ||
|
||
/** | ||
* @author Yuriy Movchan Date: 01/15/2020 | ||
*/ | ||
public final class SqlScimUserSearchSample { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(SqlConnectionProvider.class); | ||
|
||
private SqlScimUserSearchSample() { | ||
} | ||
|
||
public static void main(String[] args) throws InterruptedException { | ||
// Prepare sample connection details | ||
final SqlEntryManagerSample sqlEntryManagerSample = new SqlEntryManagerSample(); | ||
final SqlEntryManager sqlEntryManager = sqlEntryManagerSample.createSqlEntryManager(); | ||
|
||
Filter filter0 = Filter.createEqualityFilter(Filter.createLowercaseFilter("uid"),"test-0.8372945581513689"); | ||
System.out.println(filter0); | ||
List<SimpleUser> users0 = sqlEntryManager.findEntries("ou=people,o=jans", SimpleUser.class, filter0); | ||
System.out.println(users0); | ||
|
||
Filter filter1 = Filter.createORFilter(Filter.createSubstringFilter("oxTrustImsValue",null, new String[] {"\"value\":\"Skype\""}, null).multiValued(), | ||
Filter.createEqualityFilter("nickname", null), Filter.createSubstringFilter("nickname",null, new String[] {}, null)); | ||
System.out.println(filter1); | ||
List<SimpleUser> users = sqlEntryManager.findEntries("ou=people,o=jans", SimpleUser.class, filter1); | ||
System.out.println(users); | ||
|
||
Filter filter2 = Filter.createGreaterOrEqualFilter("oxCreationTimestamp","2022-09-23T09:01:28.637"); | ||
System.out.println(filter2); | ||
List<SimpleUser> users2 = sqlEntryManager.findEntries("ou=people,o=gluu", SimpleUser.class, filter2); | ||
System.out.println(users2); | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
jans-orm/sql/src/main/java/io/jans/orm/sql/dsl/template/MySQLJsonTemplates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
jans-orm/sql/src/main/java/io/jans/orm/sql/dsl/template/PostgreSQLJsonTemplates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
jans-orm/sql/src/main/java/io/jans/orm/sql/dsl/types/PostgreSQLJsonType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.