Aw: Re: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

2013-09-17 Thread Garbage


Having this example comes in very handy, thanks for that.
But I have two questions: is it already foreseeable when the interface will 
be fixed ? Reason for my question is that I want to build our new solution on a 
final release and not on a milestone.
Second question: is there an example how to implement a partition with a custom 
backend ? I know there were examples for JDBC in 1.x but did not find one for 
2.0
 

| Gesendet: Samstag, 14. September 2013 um 15:16 Uhr
| Von: Kiran Ayyagari kayyag...@apache.org
| An: users@directory.apache.org
| Betreff: Re: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0
| Here[1] is the updated sample using M15 (M16 has changed the way a
| partition is initialized, so
| used M15 instead to keep it clear for the sake of understanding, except
| that there is no major change
| in initializing with M16)
| 
| ...
| [1]
| 
http://svn.apache.org/repos/asf/directory/sandbox/kayyagari/embedded-sample-trunk
 


Aw: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

2013-09-06 Thread Garbage

 

 3. do you know of any examples for this for 2.0 ? I only know examples for
 1.x and know that these won't work for 2.0

I guess not, I will update the example code to work with the latest trunk
and let you know
 
I do not want to rush anyone so please take this as what I indend it to be: a 
polite question.
Did you already find the time to update or can you estimate when this will be 
available ?

Regards,


Aw: Re: Re: [ApacheDS] Porting 1.x based custom partition to 2.0

2013-09-06 Thread Garbage

 I know where the problem is but haven't committed anything yet, I can
 commit it in the next week only

That would be great and I am looking forward to it.


[ApacheDS] Porting 1.x based custom partition to 2.0

2013-08-27 Thread Garbage
Over a year ago I developed a custom partition with ApacheDS that I want to 
port to 2.0 now. The partition is special because it is only used to connect 
to ApacheDS, the search in the sub tree is then taken care of in Javacode and 
not in a directory or database.
The result for the query needs to be determined live without copying any data 
to ApacheDS beforehand.

This is not my exact scenario but I want to give you an example which might 
explain what I want to do. Let's assume I want to use ApacheDS to look up 
square roots. It would not make sense to store all possible results in 
ApacheDS. 

A search for a square root would look like this:
ldapsearch -b ou=squareroot -M -h localhost -p 389 -x (value=25)

squareroot will be the name of the subtree / partition I write. The search is 
value=25 which tells the partition that I want to receive the square root of 
25. The partition would then simply calculate Math.sqrt(doubleTakenFromQuery) 
and return the value.

So my questions are:

1. do you rate 2.0 as mature enough to build my solution on it ? (I assume yes 
but perhaps a certain Milestone is a better fit)
2. is it still the best way to use a partition for this or does 2.0 offer 
better ways ?
3. do you know of any examples for this for 2.0 ? I only know examples for 1.x 
and know that these won't work for 2.0


Re: [ApacheDS] How to setup a debugging environment

2012-06-11 Thread Garbage

 Is this an error on my side is something wrong with the files I downloaded ?
 You can't run eclipse eclipse before having built the project at least once : 
 the SNAPSHOTs aren't stored into the maven repository.
 
 Just run mvn clean install -DskpiTests first, then re-run mvn eclipse:eclipse

So i obviously got the order wrong. Now I succeeded with these commands. I set 
maven opts to the mentioned xmx setting and had to add a maxpermsize parameter, 
but this might be because of the buggy jdk I had installed (updated afterwards):

C:
cd \workspaces
md apacheds
cd apacheds
svn co 
http://svn.apache.org/repos/asf/directory/apacheds/trunk-with-dependencies
cd trunk-with-dependencies
mvn clean install -DskipTests
(Results can be found in trunk-with-dependencies\apacheds\all\target and 
trunk-with-dependencies\apacheds\service\target)
mvn eclipse:eclipse
Then went to eclipse and chose File / Import / General / Existing Projects 
into Workspace. For root directory I chose 
C:\workspaces\apacheds\trunk-with-dependencies
 
 Now I have a snapshot M8, can I do the same for M7 ?
 

Re: [ApacheDS] how can a partition return more than one result ?

2012-06-11 Thread Garbage


Von meinem iPad gesendet


 But I am only able to return ONE entry, I didn't find or understand the 
 concept how MULTIPLE entries can be returned. Can someone show me the right 
 direction ?
 The idea is to use a Cursor that maps around the partition and fetch the 
 entries one by one.
 
 The way the server works is that based on your filter, you select the right 
 index to use to fetch the entries. There are may possibilities here :
 - first, you may have to do a full scan (the filter is not selective enough, 
 for instance). In this case, you don't use any index, you just use the 
 MasterTable to get the entries. Now, for each entry you fetch, you'll have to 
 filter them to see if it's a valid entry - or not.
 - or you can select an index. You will fetch the index elements, and for each 
 of them, fetch the associated entry.  Once done, you can check against the 
 filter if the entry is valid - or not
 
 In any case, the cursor is your friend here : it maps the next() operation on 
 top of your index.
 
 Now, if your Partition is a Btree, it's easier, as the AbstractBTreePartition 
 class already handles everyting for you. If you don't inherit from this 
 Abstract class, then it's way more complicated. I'll suggest you have a look 
 at the AbstractBTreePartition to get a clue about how we process a search 
 over a BTree based partition.
If I got you right I am to create my own cursor object which retrieves and 
stores the array with the items I want to deliver. The cursor then implements 
the next and get method in order to send the array one by one. But where is the 
cursor being called ? 
I tried to base my own partition on the abstract btree partition but what am I 
supposed to return from getRootId and getDefaultId and even worse from 
convertAndInit ?

Sorry for the beginner level questions but ApacheDS is quite complex and new to 
me.

Re: [ApacheDS] How to setup a debugging environment

2012-06-10 Thread Garbage

Am 09.06.2012 um 00:03 schrieb Emmanuel Lécharny elecha...@gmail.com:

 Le 6/8/12 11:38 PM, garb...@gmx.de a écrit :
 In order to broaden my understanding I want to connect Eclipse to a running 
 instance of ApacheDS 2.0M7. I retrieved the sources for M7 from the svn 
 repository but failed in combining them.
 I do NOT want to build ApacheDS, my only intention is to make all the 
 subprojects known to Eclipse to allow it to remotely debug ApacheDS. I want 
 to connect to a running instance and use the debugger to trace what's going 
 one in partitions.
 
 Can you explain me how to setup a debugging or if necessary a build 
 environment in Eclipse ?
 
 You can run 'mvn eclipse:eclipse' to produce all the .classpath and .projects 
 for Ads. I'm afraid you have to first build the project itself, which takes 
 quite some time, unless you run 'mvn clean install -DskipTests' to avoir 
 running the tests.

I have no maven infrastructure yet so I will start from scratch. Is it ok to 
use version 3 ?



[ApacheDS] how can a partition return more than one result ?

2012-06-08 Thread Garbage
I learned a lot about the implementation of custom partitions and see the 
changes in the API from search and lookup returning an Entry in 1.5.x and an 
EntryFilteringCursor later on.
I even was able to change an existing partition (shame on me: based on the 
1.5.5 example, but I will switch to 2.0 soon) in a way that lets it return a 
fake group object that was created in my custom POJO.

But I am only able to return ONE entry, I didn't find or understand the concept 
how MULTIPLE entries can be returned. Can someone show me the right direction ?

Re: [ApacheDS] how can a partition return more than one result ?

2012-06-08 Thread Garbage


Am 08.06.2012 um 13:58 schrieb Emmanuel Lécharny elecha...@gmail.com:

 Le 6/8/12 1:49 PM, Garbage a écrit :
 I learned a lot about the implementation of custom partitions and see the 
 changes in the API from search and lookup returning an Entry in 1.5.x and an 
 EntryFilteringCursor later on.
 I even was able to change an existing partition (shame on me: based on the 
 1.5.5 example, but I will switch to 2.0 soon) in a way that lets it return a 
 fake group object that was created in my custom POJO.
 
 But I am only able to return ONE entry, I didn't find or understand the 
 concept how MULTIPLE entries can be returned. Can someone show me the right 
 direction ?
 The idea is to use a Cursor that maps around the partition and fetch the 
 entries one by one.
 
 The way the server works is that based on your filter, you select the right 
 index to use to fetch the entries. There are may possibilities here :
 - first, you may have to do a full scan (the filter is not selective enough, 
 for instance). In this case, you don't use any index, you just use the 
 MasterTable to get the entries. Now, for each entry you fetch, you'll have to 
 filter them to see if it's a valid entry - or not.
 - or you can select an index. You will fetch the index elements, and for each 
 of them, fetch the associated entry.  Once done, you can check against the 
 filter if the entry is valid - or not
 
 In any case, the cursor is your friend here : it maps the next() operation on 
 top of your index.
 
 Now, if your Partition is a Btree, it's easier, as the AbstractBTreePartition 
 class already handles everyting for you. If you don't inherit from this 
 Abstract class, then it's way more complicated. I'll suggest you have a look 
 at the AbstractBTreePartition to get a clue about how we process a search 
 over a BTree based partition.
 
 -- 
 Regards,
 Cordialement,
 Emmanuel Lécharny
 www.iktek.com
 

Thanks, I will investigate this. What a pity, I am able to map searches to 
string arrays containing the name of groups I want to return. But I understand 
why you don't support arrays directly, I will somehow manage to map to the Bree 
example. And if not I will show up here again ;-)



[ApacheDS] How to setup a debugging environment

2012-06-08 Thread Garbage

In order to broaden my understanding I want to connect Eclipse to a running 
instance of ApacheDS 2.0M7. I retrieved the sources for M7 from the svn 
repository but failed in combining them.
I do NOT want to build ApacheDS, my only intention is to make all the 
subprojects known to Eclipse to allow it to remotely debug ApacheDS. I want to 
connect to a running instance and use the debugger to trace what's going one in 
partitions.

Can you explain me how to setup a debugging or if necessary a build environment 
in Eclipse ?

-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!  

Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a


Re: [ApacheDS] lost with decision where to implement custom permission

2012-06-07 Thread Garbage

Am 07.06.2012 um 17:59 schrieb Emmanuel Lécharny elecha...@gmail.com:

 Le 6/6/12 6:39 AM, Garbage a écrit
 
 1. Can M7 be considered stable enough for giving it a chance in a productive 
 system?
 No. I'm sad to say that but M7 still have a huge bug that we are tracking. 
 Not that you'll won't get a working server, but in some cases where 
 concurrent writes and searches are done, you are very likely to get some 
 failures during the searches. More than that, the database can get corrupted.
 
 We exactly know what is going wrong here, and we already have a fix, but this 
 is in a branch, and we are currenly merging this branch into trunk, which is 
 all but easy.
 
 M8 will solve this issue, and we expect to get it released ASAP. In the mean 
 time, you can use the directory/apacheds/branches/apacheds-txns branch whch 
 solve the issue.
 
 I only need ApacheDS to sit there and wait for incoming connections and 
 forward them to my custom partition. There is no need for replication and 
 all the other fancy stuff ApacheDS is able to do.
 You can still work on the trunk, until M8 get released.
 
 Just keep tuned, we are doing our best to get back to some solid and reliable 
 server soon.
 

I believe I can use the released milestone 7 because parallel reads / writes 
don't exist in my scenario. Or are there any other issues I should keep an eye 
on ?




[ApacheDS] Question regarding caching behavior

2012-06-07 Thread Garbage
From what I know ApacheDS supports caching of search results, that means when I 
issue the same search after e.g. one minute the result will be returned from 
the cache.
First question: is this correct ?

Is this something ApacheDS does on it's own or is this the job of the 
partitions involved ?
Second question: when implementing a custom partition would I need to take care 
of caching on my own ?

[ApacheDS] lost with decision where to implement custom permission

2012-06-05 Thread Garbage
I tried to build a working custom partition implementation for last days. I 
started with 1.5.7 but then found out that the working example I intended to 
base on does no longer compile because of some API changes. Because of this I 
switched to 1.5.5 and managed to get the example running (not that difficult, I 
have to admit ;-))

Unfortunately I don't have enough background knowledge to be able to extend the 
HelloWorldPartition example.

I'm willing to learn and invest time but need expert advice if I should 
continue with 1.5 or 2.0. In addition I will need some guidance. In exchange 
for that I can offer you to update the docs for custom partitions.

Re: [ApacheDS] lost with decision where to implement custom partition

2012-06-05 Thread Garbage


Sorry, I either mistyped or became a victim of auto correction: I meant 
PARTITION

Am 05.06.2012 um 18:28 schrieb Garbage garb...@gmx.de:

 I tried to build a working custom partition implementation for last days. I 
 started with 1.5.7 but then found out that the working example I intended to 
 base on does no longer compile because of some API changes. Because of this I 
 switched to 1.5.5 and managed to get the example running (not that difficult, 
 I have to admit ;-))
 
 Unfortunately I don't have enough background knowledge to be able to extend 
 the HelloWorldPartition example.
 
 I'm willing to learn and invest time but need expert advice if I should 
 continue with 1.5 or 2.0. In addition I will need some guidance. In exchange 
 for that I can offer you to update the docs for custom partitions.


Re: [ApacheDS] lost with decision where to implement custom permission

2012-06-05 Thread Garbage
Am 06.06.2012 um 05:16 schrieb Emmanuel Lécharny elecha...@gmail.com:

 Definitively go for 2.0. The API has changed a lot, but this is (hopefully) 
 for the best.
 
 Sadly, the documentation is not following the code modification pace :/
 
 Do you have any specific question ?

Thanks for that information, this might be the explanation why I got lost in 
the transition from 1.5.5 to 2.0: I simply didn't understand what changes were 
to see. So I will head for 2.0, I expected that answer ;-)

But I still have these questions:

1. Can M7 be considered stable enough for giving it a chance in a productive 
system?

I only need ApacheDS to sit there and wait for incoming connections and forward 
them to my custom partition. There is no need for replication and all the other 
fancy stuff ApacheDS is able to do.

2. Where should I start off in order to create a partition that uses data from 
my java objects and sends it back to the client ?

Some details to explain what I'm after: I need to integrate a google search 
appliance with at least three different directories. One is based on LDAP, one 
can be accessed via a web service and the other has a SQL interface. I 
discussed this topic on stackoverflow and even posted a question on the 
developer list of ApacheDS, back then I intended to use an interceptor but now 
I believe that a custom partition will be a much better solution. The easiest 
way to integrate these directories will be a LDAP interface because the GSA is 
able to connect to LDAP, the queries can be configured.
The main idea is to write a partition that listens on access to ou=user and 
answers to queries that follow this pattern: (username=johndoe). It should then 
deliver the two attributes distinguishedName and mail. 
In a second step the GSA will send a query that looks like this: 
(member=distinguishedName). The expected answer will then be a list of dns of 
groups the user belongs to. This information will be delivered by my java code 
and can be considered a blackbox. Just think of it returning a string array of 
groups in ldap format.