File Watcher/Notifier - Design Question

I am considering a scenario that just scans a directory and notifies via email if any files exist.  Pretty simple to do with a few unix commands, but what is the best way with PI?
I figure a file comm channel in test mode and then an SMTP receiver.  Problem is, you would get an email for every file that exists....even if you just run it once on a schedule.
Do I need to use BPM and collect files...then send a single email?  I was hoping to avoid BPM for such a task.
Thanks,
Keith

Okay how about this?
have a java code for file existence check.
something like
File file=new File;
if(file.exists())
have this code as an adapter module?
errr..looks like i'm complicating things..;)
Regards,
Ravi

Similar Messages

  • LDAP design question for multiple sites

    LDAP design question for multiple sites
    I'm planning to implement the Sun Java System Directory Server 5.2 2005Q1 for replacing the NIS.
    Currently we have 3 sites with different NIS domains.
    Since the NFS over the WAN connection is very unreliable, I would like to implement as follows:
    1. 3 LDAP servers + replica for each sites.
    2. Single username and password for every end user cross those 3 sites.
    3. Different auto_master, auto_home and auto_local maps for three sites. So when user login to different site, the password is the same but the home directory is different (local).
    So the questions are
    1. Should I need to have 3 domains for LDAP?
    2. If yes for question 1, then how can I keep the username password sync for three domains? If no for question 1, then what is the DIT (Directory Infrastructure Tree) or directory structure I should use?
    3. How to make auto map work on LDAP as well as mount local home directory?
    I really appreciate that some LDAP experta can light me up on this project.

    Thanks for your information.
    My current environment has 3 sites with 3 different NIS domainname: SiteA: A.com, SiteB:B.A.com, SiteC:C.A.com (A.com is our company domainname).
    So everytime I add a new user account and I need to create on three NIS domains separately. Also, the password is out of sync if user change the password on one site.
    I would like to migrate NIS to LDAP.
    I want to have single username and password for each user on 3 sites. However, the home directory is on local NFS filer.
    Say for userA, his home directory is /user/userA in passwd file/map. On location X, his home directory will mount FilerX:/vol/user/userA,
    On location Y, userA's home directory will mount FilerY:/vol/user/userA.
    So the mount drive is determined by auto_user map in NIS.
    In other words, there will be 3 different auto_user maps in 3 different LDAP servers.
    So userA login hostX in location X will mount home directory on local FilerX, and login hostY in location Y will mount home directory on local FilerY.
    But the username and password will be the same on three sites.
    That'd my goal.
    Some LDAP expert suggest me the MMR (Multiple-Master-Replication). But I still no quite sure how to do MMR.
    It would be appreciated if some LDAP guru can give me some guideline at start point.
    Best wishes

  • I like to have the option of saving downloaded files in my designated locations instead of in the 'downloads' folder. How do I do this?

    # Question
    I like to have the option of saving downloaded files in my designated locations instead of in the 'downloads' folder. How do I do this?

    There are also other things that need attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    # Shockwave Flash 10.0 r45
    # Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    Update the [[Java]] plugin to the latest version.
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • File Watcher issue...

    I am hoping someone can nail this or point me in the right direction because I seem to be hitting a brick wall...
    Until last night I was successfully using my file watcher job and then it just stopped "watching" for some unexplainable reason. The file watcher and the event job is pretty straightforward based on several examples provided in this forum and elsewhere. Few details;
    Oracle EBS R12 (12.1.3)
    Database Version:
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE     11.2.0.2.0     Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionFile Watcher and Job DDL. Please note, this is not the original piece that I was working with when the problem started, but in an effort to diagnose the issue I picked a simpler version from one of the posts on this forum (posted by 'RnR'):
    begin
      dbms_scheduler.create_credential (
        'external_user',
        'osuser',
        'ospassword');
      dbms_scheduler.create_file_watcher (
        file_watcher_name => 'file_watcher',
        directory_path    => '/tmp',
        file_name         => 'file.txt',
        credential_name   => 'external_user',
        enabled           => TRUE);
      dbms_scheduler.create_job (
        job_name          =>'filewatchjob',
        queue_spec        =>'file_watcher',
        job_type          =>'plsql_block',
        job_action        =>'null;',
        event_condition   => NULL,
        enabled           =>true);
    end;
    NOTE: I have used different parameter values for directory_path, file_watcher & job name, and credential.
    1. I have tested and confirmed that 'Credential' works. This was tested by using another 'External' job which moves files from location A to B.
    2. I altered 'REPEAT_INTERVAL' attribute of 'FILE_WATCHER_SCHEDULE' from the default 10mins to 3mins.
    3. Created and touched the file "file.txt" at frequent intervals in anticipation it will get pooled.
    However,
    1. **schedulerjob_run_details* and **schedulerjob_log* does not show the said job as expected.
    2. The file watcher is created correctly and appears in dba_scheduler_file_watchers.
    3. The file watcher job appears in user_scheduler_jobs as ENABLED
    4. From table dba_scheduler_global_attribute the value for attribute FILE_WATCHER_COUNT is 6. Which sounds about right before things stopped.
    5. Finally (no quite as I tried several other things in-between), as a last resort the database server was bounced, but still no change.
    It almost feels like the background process that queues the file watcher queue has stopped!! Just a guess. But I have no idea how to check for that. I have looked at dba_running_jobs to see if sys.file_watcher job is running, but no. I am not sure if this is something I should be looking for....
    So, please any questions, suggestions, thoughts, etc... will be truly appreciated.
    thanks
    ilyas
    P.S. What tags to use to format code in forum post?
    Edited by: ilyas001 on Jul 7, 2011 11:38 PM
    Our DBA pointed out a BUG ID on metalink 11715143: FILE WATCHER DOESN'T EXECUTE THE JOB WHEN THERE'S FILES IN THE WATCHED DIRECTORY
    The symptoms listed in the bug note are very similar to my problem with two exceptions: 1). Our server is not generating a trace file for filewatcher (it did generate trace when I screwing up with 'External' job types), and 2). As mentioned previously, file watcher was working until 24Hrs back.....
    Edited by: ilyas001 on Jul 8, 2011 9:27 AM

    @mseberg
    suggestion :
    set parallel_instances=trueYES. The parallel inst attribute for the job was set to TRUE. Not for the job in the code snippet I posted, but for the original code that was working successfully - as expected. In the latter test code case I was creating and touching files every so often (my default job class interval was changed to 3mins.
    I know you have done this but I would triple check :
    SELECT credential_name,
    username
    FROM user_scheduler_credentials;YES. Creating Credentials was the first heartburn I had because it would get created, but just couldn't run any OS commands. Sorry, can't remember the exact error msg, it was something others had experienced on this forum. After a lot of digging on google and here it finally started to work after (re)linking libpam library (64bit).
    So, it appears in the scheduler credential table and have frequently tested it by running another job of type EXECUTABLE to move files around from the same source location where Filewatcher is polling from.
    Mseberg, thanks for your feedback.

  • Retrieving lists from other layer into a JSP page - Design Question

    Hi all,
    What should be a good design technique in order to allow a JSP page to present some list obtained from other layer of my application. I intend to leave only presentation logic in the JSP layer, while all data access will be in other layer.
    For example, I have a JSP page that will show the results of a SQL query originated from an entry form in other JSP page. Let's name them 'search.jsp' and 'result.jsp'
    I want that all JDBC access be done in some other layer.
    Question 1:
    What would be better for this task? A servlet or a bean? (A bean, I suppose?)
    Then this bean (?) would have to find some way to pass all the result set into this 'result.jsp'. I think it would be very poor design if I used some Data Object, because it would have to store all rows and pass them at once.
    I don't want, either, that the presentation (JSP) layer access directly the data access layer (JDBC, files...). This way, I don't want any JSP page accessing the Resultset object directly.
    Question 2:
    What do you think could be a good design technique?
    I thought of some intermediate layer that provided data objects and data access interfaces. I mean, as my data will come from different sources, like some database (JDBC), some Electronic Document Manager, I thought of having a common access interface, that would provide methods for accessing the resultsets. This could be even a java.util.Enumeration that has a hasMoreElements() method that could be implemented as the next() method from JDBC result sets and the nextElement() method that would actually bring the next row of data.
    This way the JSP layer would see only hasMoreElements() and nextElement() methods from the middle layer. On the other hand, the data layer would provide as many different implementations to this access interface (Enumeration?) as there were data sources (JDBC, Files, ...)
    Question 3:
    What do you think of this design?
    Question 4:
    Is there any flaw in my approach? Which?
    Question 5:
    Could you suggest other designs?
    I really thank you all, for any kind of answer. I actually use this design for development, however I've never seriously discussed it with someone... this is going to be of great value for me.
    Regards,
    Filipe Fedalto

    Well I saw you question and I'll tell you what I do.
    I have JSP's which post form data to servlets.
    The servlet then calls a factory to produce a ResultContainer (analagous to your lists) which is generated
    via JDBC, and/or request parameters etc...
    this provides a single point of reference and a "group" of containers (functions really) that can be produced and reused (same container different amount of data)
    I also have other static classes which can manipulate the data in the containers
    (such as add additional info to the items in the containers) before I forward the container (request attribute)
    to the JSP page
    Additionally I use Type safe constants for all my HTML form tag names (easier to change and ensure the same name is used everywhere when reading parameters) and again for item statuses
    and any other info I need to send along with the page (using Javascript to update the
    status to another type safe constant).
    I've found that using factories for ResultContainers is very worthwhile and allows you to implement additional servlets extremely quickly (mostly reusing containers that exist) and since the
    container is the same for all my JSPs (this may not be the case with you) I can implement JSP's
    very quickly as well (just change the view)
    btw I refrain from calling my ResultContainer a bean because it is not serializable
    I don't know if this will help but at least it gives me a forum to test my ideas
    Thanks

  • How to attach a .pld file in oracle Designer

    When we try to generate a form out of designer we are getting the error ilke
    sample.pld file is required. The Questions on it are,
    1. What is a .pld file in a designer mean.
    2. How to attach a .pld file in oracle designer for the generation of forms.
    Thanks,
    Ramesh.R

    Hi Erik,
    Thanks for the update.
    My problem in designer is in the desginer under the generator preference dialog window the property "Form/Libr" attachment the "module specific library attachment" has the value like "ABC". I am having ABC.pld file in my system. I have included the file path in the pll file path in the Generator options tab.
    While generating the forms from designer i am getting the error "CDG-01373 ERROR: Module ABC: Unable to attach library ABC".
    My Questions are how to attach the ABC.pld file for this error. Thanks in advance
    Thanks,
    Ramesh.R

  • Dreamweaver design question

    Hi all. I'm new to the forum and ha da design question. My site took about 3 weeks to complete and after finishing what I though was a pretty error free website I noticed that dreamwever 8 was coming up with numerous errors that matched http://validator.w3.org's scans. My question is this. Why does dreamwever ( regardless of the release ) allow the designer of the website he/she is creating without pointing out the errors as they go along with simple instructions on how to fx them.  As an example My meta tags
    <META NAME="keywords" CONTENT="xxxxxxx">
    <META NAME="description" CONTENT="xxxxxxxx">
    <META NAME="robots" CONTENT="xxxxx">
    <META NAME="author" CONTENT="xxxxxx">
    <META NAME="copyright" CONTENT="xxxxxx">
    all had to be changed over to
    <meta name="keywords" xxxxxxxxxxxxx">
    <meta name="description" CONTENT="xxxxxxx">
    <meta name="robots" CONTENT="xxxxxx">
    <meta name="author" CONTENT="xxxxxxxx">
    <meta name="copyright" CONTENT="xxxxxxxx">
    all because dreamweaver didnt tell me that the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    didnt fit the original design. Now my site ( if you wish to view the code ) is www.gamblingwhore.com and if you look at the page source you will see that the code has been corrected on dw 8 but still shows more than 30 errors on http://validator.w3.org. Does dreamwevaer not have the basic tool available to fix these errors without such hassle. Its not just my site either, many sites built in dreamwever can be checked with the http://validator.w3.org website only to find more than 20 -100 different errors.
    Dream weaver creators need to focus on these errors because they hinder seo and they create alot of extra work
    Thank you

    The w3c and XHTML have come a ways since the release of Dreamweaver 8 (I used it in late 2004 and 2005).
    Dreamweaver 8 will build transitional XHTML files as well as old style single tag HTML. It all depends on the personal preferences of the designer.
    Just for kicks, go to say... 20 random websites and see just how many get a green light when you validate them. If its half, you're lucky. This page doesn't even validate;
    Dreamweaver has the menu option (at least in CS3 an CS4) under the Commands menu to "Clean Up HTML" or "Clean Up XHTML" depending on what you're building. I make a point of running that command as I build along with Apply Source Formatting.
    I also use a local validator program to check my code before putting anything.
    That's why they call it WYSIWYG software.
    If it did everything perfectly for everyone every single time, good web designers would find themselves out of work.

  • File Extension of Design Studio

    I would like to know the file extension of Design studio.
    Ramesh

    Hi Ramesh,
    It makes no sense to mark any other than the correct answer just to close the question.
    After that click, your question is marked as "answered", the correct answer moves upwards, and is displayed direct under your question, so anybody can see the correct answer at first glance.
    In this case you should have marked Mustafas answer as correct not yours.
    Regards,
    Steffen

  • Database Connection design question

    Hello, I have a design question. Awhile back I needed to create a database connection to SQL Server, so I created a class to do it
    import java.sql.*;
    import java.io.*;
    import java.net.MalformedURLException;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    public class SQLServerConnection
         private static Connection connection = null;
         public SQLServerConnection(String user, String password, String dbName) throws java.sql.SQLException
              getDBConnection(user, password, dbName);
         public SQLServerConnection(String configFileName) throws java.sql.SQLException
              getDBConnection(configFileName);
         private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
             DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
             connection = DriverManager.getConnection(
                  "jdbc:microsoft:sqlserver:" + dbName, user, password);              
         private void getDBConnection(String configFileName) throws java.sql.SQLException
              String user;
              String password;
              String dbName;
              try
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = factory.newDocumentBuilder();
                   Document doc = db.parse(configFileName);
                   doc.getDocumentElement().normalize();
                   // get the configuration information
                   password = getConfigParameter("password", doc);
                   user = getConfigParameter("username", doc);
                   dbName = getConfigParameter("databasename", doc);
                   getDBConnection(user, password, dbName);
              catch (MalformedURLException murle)
                   System.out.println("Unable to connect to: " + configFileName + " -- " + murle);
                   System.exit(1);
              catch (FileNotFoundException fnfe)
                   System.out.println("Configuration file " + configFileName + " not found.");
                   System.exit(1);
              catch (IOException ioe)
                   System.out.println("IOException: " + ioe);
                   System.exit(1);
              catch (javax.xml.parsers.ParserConfigurationException pce)
                   System.out.println ("Parser Configuration Error: " + pce);
              catch (SAXException saxe)
                   System.out.println ("SAXException: " + saxe);
         private String getConfigParameter(String paramName, org.w3c.dom.Document doc)
              NodeList nl = doc.getElementsByTagName(paramName);
              if(nl != null)
                   Node n = null;
                   for (int i = 0; i < nl.getLength(); i++)
                        n = nl.item(i);          
                        if(n.hasChildNodes())
                             NodeList children = n.getChildNodes();
                             return ((Node)children.item(0)).getNodeValue();
              else
                   System.out.println ("nl is null");
              return "";          
         public void setCatalog(String catalogName) throws java.sql.SQLException
              connection.setCatalog(catalogName);
         public Connection getConnection()
              return connection;
         public void closeConnection()
              try
                   connection.close();
              catch(java.sql.SQLException sqle)
                   System.err.println ("SQL Server Connection failed to close: " + sqle);
    }Later on, I needed to do the same thing for MySQL, so I created a class for that, MySQLServerConnection which is exactly the same as above, except for:
    private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
              try
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
                   connection = DriverManager.getConnection(dbName, user, password);     
              catch(java.lang.ClassNotFoundException cnfe)
                   System.out.println (cnfe);
              catch(java.lang.InstantiationException ie)
                   System.out.println (ie);
              catch(java.lang.IllegalAccessException iae)
                   System.out.println (iae);
         }Later, on, I did the same thing with OracleServerConnection. My question is, I know this is probably not optimal code. For example, I didn't originally have a close connection method, so I had to go in and code one for all 3. I'm assuming that an interface would be a good idea so that if I have to code another database connection class I make sure and include all of the appropriate methods. I'm also assuming that it would have been smart to have a master class, maybe something like DatabaseConnection and extended these classes from that. Am I on the right track? Totally offbase?

    @nclow - I will work on trying the Factory Pattern for this over the weekend and post when I finish to see what you think.
    @abillconsl - just to make sure I understand, you're saying that I just try to connect and it will cycle through the different database connection possibilities and connect when it finds the right one? If it fails all 3, log an appropriate message. One question I have about this is, I thought I was being object oriented by separating the different types of db connections (Oracle, SQL Server, MySql) into different classes. Am I missing the point of OOP by what I was/am trying to accomplish? Going overboard? Also, does your way try and connect to all 3 even if I connected to one already?
    Thx, Grantarchy
    Edited by: grantarchy on May 9, 2008 9:50 PM

  • Catalyst 3850 Stack VLANs, layer 2 vs. layer 3 design question

    Hello there:
    Just a generic, design question, after doing much reading, I am just not clear as when to use one or the other, and what the benefits/tradeoffs are:
    Should we configure the switch stack w/ layer 3, or layer 2 VLANs?
    We have a Catalyst 3850 Stack, connected to an ASA-X 5545 firewall via 8GB etherchannel.
    We have about 100 servers (some connected w/ bonding or mini-etherchannels), and 30 VLANs.
    We have several 10GB connections to servers.
    We push large, (up to) TB sized files from VLAN to VLAN, mostly using scp.
    No ip phones, no POE.
    Inter-VLAN connectivity/throughput and security are priorities.
    Originally, we planned to use the ASA to filter connections between VLANs, and VACLs or PACLs on the switch stack to filter connections between hosts w/in the same VLAN.
    Thank you.

    If all of your servers are going to the 3850 then I'd say you've got the wrong switch model to do DC job.  If you don't configure QoS properly, then your servers will start dropping packets because Catalyst switches have very, very shallow memory buffers.  These memory buffers get swamped when servers do non-stop traffic. 
    Ideally, Cisco recommends the Nexus solution to connect servers to.  One of the guys here, Joseph, regularly recommends the Catalyst 4500-X as a suitable (and financial) alternative to the more expensive Nexus range.
    In a DC environment, if you have a lot of VM stuff, then stick with Layer 2.  V-Motion and Layer 3 don't go hand-in-hand.

  • Design question about instant download a patch

    Hi All,
    Here is a design question for you:
    Background:
    The application we built is being upgraded from time to time and we send it to our users.
    our users use it on a network so there is only one file to upgrade (and being done by the sys admin)
    We send them a �patch�; actually, it�s a new version of the application they place it in the relevant folder and continue to work with a new version.
    Problems:
    1. We send them the patch via email - sometimes it takes a while until they read their email and at they are using an �old version of the system�.
    2. Some of them are not computer savvy (when it�s not the sys admin) and we need to guide them as where exactly to place the file (there are 3 files)
    Our (conceptual never build yet) Solution:
    Build a program just like Norton antivirus (or other) that prompts the user from the task bar (next to the clock) that a new version is available and by
    clicking once it will automatically download the file and store it in the correct folder.
    Question:
    1. Did anyone try anything like this before (or something like) who can tell me about it?
    2. Do you think this kind of system will work for us?
    3. Does anyone have a better solution?
    Thanks
    Peter

    thanks, I posted it there.No, he meant that Webstart is the mechanism you should use. It supports net-based distribution and automatic centralized updates of apps. Exactly what you want.

  • Design question about instant download from

    Hi All,
    Here is a design question for you:
    Background:
    The application we built is being upgraded from time to time and we send it to our users.
    our users use it on a network so there is only one file to upgrade (and being done by the sys admin)
    We send them a �patch�; actually, it�s a new version of the application they place it in the relevant folder and continue to work with a new version.
    Problems:
    1. We send them the patch via email - sometimes it takes a while until they read their email and at they are using an �old version of the system�.
    2. Some of them are not computer savvy (when it�s not the sys admin) and we need to guide them as where exactly to place the file (there are 3 files)
    Our (conceptual never build yet) Solution:
    Build a program just like Norton antivirus (or other) that prompts the user from the task bar (next to the clock) that a new version is available and by
    clicking once it will automatically download the file and store it in the correct folder.
    Question:
    1. Did anyone try anything like this before (or something like) who can tell me about it?
    2. Do you think this kind of system will work for us?
    3. Does anyone have a better solution?
    Thanks
    Peter

    Java WebStart is the deployment technique suited for your purposes.
    The deployment will be done via a webserver running a jnlp servlet (provided).
    The applications may either run offline, or check online for automatic updates.
    You have several configuration options.
    ArgoUML and jEdit are two open source apps delivered this way.
    Your app will need to be adapted though.
    And your customers need an online browser with installed jvm.

  • Requesting user capability to "Save Response as PDF File w/form design intact"

    Love the new admin "Save Response as PDF File with form design intact" feature, but we really need for our indivual users (i.e. the ones filling out the form) to be able to do this. Our director still needs a hard copy of the form for manual signatures and those who pay by check. Our committee chairs use the online data (from excel file) but we also need the user to print a hard copy to physically turn in to the director. A .pdf file with form design intact that our user could print out and turn in would be helpful.

    Hi,
    We have an "Ideas" page where you can add or vote on feature ideas:
    http://forums.adobe.com/community/formscentral?view=idea
    I am pretty sure this idea has been added for you to vote on, but I didn't find it to link to.  I know it is a popular request though so if you need to add a new idea click "Create an idea" under "Actions" in the top right, I am sure it will get a lot of votes..
    Thanks,
    Josh

  • Design question: Scheduling a Variable-timeslot Resource

    I originally posted this in general java programming, because this seemed like a more high-level design descussion. But now I see some class design questions. Please excuse me if this thread does not belong here (this is my first time using the forum, save answering a couple questions).
    Forum,
    I am having trouble determining a data structure and applicable algorithm (actually, even more general than the data structure -- the general design to use) for holding a modifiable (but more heavily read/queried than updated), variable-timeslot schedule for a given resource. Here's the situation:
    Let's, for explanation purposes, say we're scheduling a school. The school has many resources. A resource is anything that can be reserved for a given event: classroom, gym, basketball, teacher, janitor, etc.
    Ok, so maybe the school deal isn't the best example. Let's assume, for the sake of explanation, that classes can be any amount of time in length: 50 minutes, 127 minutes, 4 hours, 3 seconds, etc.
    Now, the school has a base operation schedule, e.g. they're open from 8am to 5pm MTWRF and 10am to 2pm on saturday and sunday. Events in the school can only occur during these times, obviously.
    Then, each resource has its own base operation schedule, e.g. the gym is open from noon to 5pm MTWRF and noon to 2pm on sat. and sun. The default base operation schedule for any resource is the school which "owns" the resource.
    But then there are exceptions to the base operation schedule. The school (and therefore all its resources) are closed on holidays. The gym is closed on the third friday of every month for maintenance, or something like that. There are also exceptions to the available schedule due to reservations. I've implemented reservations as exceptions with a different status code to simplify things a little bit: because the basic idea is that an exception is either an addition to or removal from the scheduleable times of that resource. Each exception (reservation, closed for maintenance, etc) can be an (effectively) unrestricted amount of time.
    Ok, enough set up. Somehow I need to be able to "flatten" all this information into a schedule that I can display to the user, query against, and update.
    The issue is complicated more by recurring events, but I think I have that handled already and can make a recurring event be transparent from the application point of view. I just need to figure out how to represent this.
    This is my current idea, and I don't like it at all:
    A TimeSlot object, holding a beginning date and ending date. A data structure that holds list of TimeSlot objects in order by date. I'd probably also hold an index of some sort that maps some constant span of time to a general area in the data structure where times around there can be found, so I avoid O(n) time searching for a given time to find whether or not it is open.
    I don't like this idea, because it requires me to call getBeginningDate() and getEndDate() for every single time slot I search.
    Anyone have any ideas?

    If I am correct, your requirement is to display a schedule, showing the occupancy of a resource (open/closed/used/free and other kind of information) on a time line.
    I do not say that your design is incorrect. What I state below is strictly my views and should be treated that way.
    I would not go by time-slot, instead, I would go by resource, for instance the gym, the class rooms (identified accordingly), the swimming pool etc. are all resources. Therefore (for the requirements you have specified), I would create a class, lets say "Resource" to represent all the resources. I would recommend two attributes at this stage ("name" & "identifier").
    The primary attribute of interest in this case would be a date (starting at 00:00hrs and ending at 24:00hrs.), a span of 24hrs broken to the smallest unit of a minute (seconds really are not very practical here).
    I would next encapsulate the availability factor, which represents the concept of availability in a class, for instance "AvailabilityStatus". The recommended attributes would be "date" and "status".
    You have mentioned different status, for instance, available, booked, closed, under-maintainance etc. Each of these is a category. Let us say, numbered from 0 to n (where n<128).
    The "date" attribute could be a java.util.Date object, representing a date. The "status", is byte array of 1440 elements (one element for each minute of the day). Each element of the byte array is populated by the number designation of the status (i.e, 0,1,2...n etc.), where the numbers represent the status of the minute.
    The "Resource" class would carry an attribute of "resourceStatus", an ordered vector of "ResourceStatus" objects.
    The object (all the objects) could be populated manually at any time, or the entire process could be automated (that is a separate area).
    The problem of representation is over. You could add any number of resources as well as any number of status categories.
    This is a simple solution, I do not address the issues of querying this information and rendering the actual schedule, which I believe is straight forward enough.
    It is recognized that there are scope for optimizations/design rationalization here, however, this is a simple and effective enough solution.
    regards
    [email protected]

  • Help: I want to auto schedule a load using file watcher but it runs only once for the first time and after that it is not running at all

    Hi All,
    I am trying  to execute the below code as provided from one of the blogs. i am able to run the job only once based on a file watcher object(i.e. for very first time) and after that the job is not running at all and if  i schedule the job to run automatically based on interval of 10 or more minutes it is executing properly). Please let me know or guide me if i have missed any step or configuration.that is needed.
    Version of Oracle 11.2.0.1.0
    OS : Windows 7 Prof
    Given all the necessary privileges
    BEGIN
      DBMS_SCHEDULER.CREATE_CREDENTIAL(
         credential_name => 'cred',
         username        => 'XXXX',
         password        => 'XXXX');
    END;
    CREATE TABLE ZZZZ (WHEN timestamp, file_name varchar2(100),
       file_size number, processed char(1));
    CREATE OR REPLACE PROCEDURE YYYY
      (payload IN sys.scheduler_filewatcher_result) AS
    BEGIN
      INSERT INTO ZZZZ VALUES
         (payload.file_timestamp,
          payload.directory_path || '/' || payload.actual_file_name,
          payload.file_size,
          'N');
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_PROGRAM(
        program_name        => 'prog1',
        program_type        => 'stored_procedure',
        program_action      => 'YYYY',
        number_of_arguments => 1,
        enabled             => FALSE);
      DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT(
        program_name        => 'prog1',
        metadata_attribute  => 'event_message',
        argument_position   => 1);
      DBMS_SCHEDULER.ENABLE('prog1');
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_FILE_WATCHER(
        file_watcher_name => 'file_watcher1',
        directory_path    => 'D:\AAAA',
        file_name         => '*.txt',
        credential_name   => 'cred',
        destination       => NULL,
        enabled           => FALSE);
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_JOB(
        job_name        => 'job1',
        program_name    => 'prog1',
        queue_spec      => 'file_watcher1',
        auto_drop       => FALSE,
        enabled         => FALSE);
      DBMS_SCHEDULER.SET_ATTRIBUTE('job1','PARALLEL_INSTANCES',TRUE);
    END;
    EXEC DBMS_SCHEDULER.ENABLE('file_watcher1,job1');
    Regards,
    kumar.

    Please post a copy and paste of a complete run of a test case, similar to what I have shown below.
    SCOTT@orcl12c> SELECT banner FROM v$version
      2  /
    BANNER
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    PL/SQL Release 12.1.0.1.0 - Production
    CORE    12.1.0.1.0    Production
    TNS for 64-bit Windows: Version 12.1.0.1.0 - Production
    NLSRTL Version 12.1.0.1.0 - Production
    5 rows selected.
    SCOTT@orcl12c> CONN / AS SYSDBA
    Connected.
    SYS@orcl12c> -- set file watcher interval to one minute:
    SYS@orcl12c> BEGIN
      2    DBMS_SCHEDULER.SET_ATTRIBUTE
      3       ('file_watcher_schedule',
      4        'repeat_interval',
      5        'freq=minutely; interval=1');
      6  END;
      7  /
    PL/SQL procedure successfully completed.
    SYS@orcl12c> CONNECT scott/tiger
    Connected.
    SCOTT@orcl12c> BEGIN
      2    -- create credential using operating system user and password (fill in your own):
      3    DBMS_SCHEDULER.CREATE_CREDENTIAL
      4       (credential_name     => 'cred',
      5        username          => '...',
      6        password          => '...');
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- create table to insert results into:
    SCOTT@orcl12c> CREATE TABLE ZZZZ
      2    (WHEN      timestamp,
      3      file_name varchar2(100),
      4      file_size number,
      5      processed char(1))
      6  /
    Table created.
    SCOTT@orcl12c> -- create procedure to insert results:
    SCOTT@orcl12c> CREATE OR REPLACE PROCEDURE YYYY
      2    (payload IN sys.scheduler_filewatcher_result)
      3  AS
      4  BEGIN
      5    INSERT INTO ZZZZ VALUES
      6        (payload.file_timestamp,
      7         payload.directory_path || '/' || payload.actual_file_name,
      8         payload.file_size,
      9         'N');
    10  END;
    11  /
    Procedure created.
    SCOTT@orcl12c> -- create program, define metadata, and enable:
    SCOTT@orcl12c> BEGIN
      2    DBMS_SCHEDULER.CREATE_PROGRAM
      3       (program_name          => 'prog1',
      4        program_type          => 'stored_procedure',
      5        program_action      => 'YYYY',
      6        number_of_arguments => 1,
      7        enabled          => FALSE);
      8    DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT(
      9       program_name         => 'prog1',
    10       metadata_attribute  => 'event_message',
    11       argument_position   => 1);
    12    DBMS_SCHEDULER.ENABLE ('prog1');
    13  END;
    14  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> BEGIN
      2    -- create file watcher:
      3    DBMS_SCHEDULER.CREATE_FILE_WATCHER
      4       (file_watcher_name   => 'file_watcher1',
      5        directory_path      => 'c:\my_oracle_files',
      6        file_name          => 'f*.txt',
      7        credential_name     => 'cred',
      8        destination          => NULL,
      9        enabled          => FALSE);
    10  END;
    11  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> BEGIN
      2    -- create job:
      3    DBMS_SCHEDULER.CREATE_JOB
      4       (job_name          => 'job1',
      5        program_name          => 'prog1',
      6        queue_spec          => 'file_watcher1',
      7        auto_drop          => FALSE,
      8        enabled          => FALSE);
      9    -- set attributes:
    10    DBMS_SCHEDULER.SET_ATTRIBUTE ('job1', 'PARALLEL_INSTANCES', TRUE);
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- enable:
    SCOTT@orcl12c> EXEC DBMS_SCHEDULER.enable ('file_watcher1, job1');
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- write file (file must not exist previously):
    SCOTT@orcl12c> CREATE OR REPLACE DIRECTORY upncommon_dir AS 'c:\my_oracle_files'
      2  /
    Directory created.
    SCOTT@orcl12c> declare
      2    filtyp utl_file.file_type;
      3  begin
      4    filtyp := utl_file.fopen ('UPNCOMMON_DIR', 'file1.txt', 'W', NULL);
      5    utl_file.put_line (filtyp, 'File has arrived ' || SYSTIMESTAMP, TRUE);
      6    utl_file.fclose (filtyp);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- wait long enough (may take more than one minute) for job to run:
    SCOTT@orcl12c> EXEC DBMS_LOCK.SLEEP (100)
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- check for results:
    SCOTT@orcl12c> SELECT * FROM zzzz
      2  /
    WHEN
    FILE_NAME
    FILE_SIZE P
    22-OCT-13 10.12.28.309000 PM
    c:\my_oracle_files/file1.txt
            57 N
    1 row selected.
    SCOTT@orcl12c> declare
      2    filtyp utl_file.file_type;
      3  begin
      4    filtyp := utl_file.fopen ('UPNCOMMON_DIR', 'file2.txt', 'W', NULL);
      5    utl_file.put_line (filtyp, 'File has arrived ' || SYSTIMESTAMP, TRUE);
      6    utl_file.fclose (filtyp);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- wait long enough (may take more than one minute) for job to run:
    SCOTT@orcl12c> EXEC DBMS_LOCK.SLEEP (100)
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- check for results:
    SCOTT@orcl12c> SELECT * FROM zzzz
      2  /
    WHEN
    FILE_NAME
    FILE_SIZE P
    22-OCT-13 10.12.28.309000 PM
    c:\my_oracle_files/file1.txt
            57 N
    22-OCT-13 10.14.08.580000 PM
    c:\my_oracle_files/file2.txt
            57 N
    2 rows selected.

Maybe you are looking for

  • How to delete a UI element in a "safe" way?

    When I delete/cut/copy a UI element from a project. I cannot rebuild/archive the project due a "classpath" problem. The project's structure is damaged and a lot of errors are generated. 1) How to delete UI elements from the layout without damage the

  • What is REALLY causing the decreased battery life on my 4S?

    Suffice it to say that I've seen all of the related posts.  While I'm glad to see that I'm not alone, none of those posts really seem to help me, so I'm putting my own post out here. I can't say exactly when the problems began, but they definitely st

  • Secure Communication between SAP R/3 and SAP portal(WAS Java)

    Hi All,    We have a requirement where client says ,there needs to be a  SSL tunnel established between SAP R/3 and Portal(through ITS) to access R/3 through portal Do we have to use SSL for that or SNC?I heard SNC is a mechanism which have to be use

  • Blending similar colours into a solid colour?

    I've scanned a map (actually a nautical chart) that I want to print; see link below to a very small portion of the RGB 8-bit/Chan image. http://i77.photobucket.com/albums/j54/nigelmercier/sample_zps69cffb91.png~original In this I can identify white,

  • Workflow problem during upgrade ?

    Hi, We are Upgrading the system from 4.6C to ECC6.0. What kind of general problem will happen to workflow during upgrade? So that we would take necessary precautions. Thanks! Richard A