001    package railo.runtime.spooler.remote;
002    
003    import railo.runtime.config.RemoteClient;
004    import railo.runtime.spooler.ExecutionPlan;
005    import railo.runtime.spooler.SpoolerTaskWS;
006    import railo.runtime.type.Collection;
007    import railo.runtime.type.KeyImpl;
008    import railo.runtime.type.Struct;
009    import railo.runtime.type.StructImpl;
010    
011    public class RemoteClientTask extends SpoolerTaskWS {
012            
013            public static final Collection.Key PASSWORD = KeyImpl.intern("password");
014            public static final Collection.Key ATTRIBUTE_COLLECTION = KeyImpl.intern("attributeCollection");
015            public static final Collection.Key CALLER_ID = KeyImpl.intern("callerId");
016            private StructImpl args;
017            private String action;
018            private String type;
019        
020            public RemoteClientTask(ExecutionPlan[] plans,RemoteClient client, Struct attrColl,String callerId, String type) {
021                    super(plans,client);
022                    this.type=type;
023                    action=(String) attrColl.get(KeyImpl.ACTION,null);
024                    args = new StructImpl();
025                    args.setEL(KeyImpl.TYPE, client.getType());
026                    args.setEL(PASSWORD, client.getAdminPasswordEncrypted());
027                    args.setEL(ATTRIBUTE_COLLECTION, attrColl);
028                    args.setEL(CALLER_ID, callerId);
029            }
030    
031            /**
032             * @see railo.runtime.spooler.SpoolerTask#getType()
033             */
034            public String getType() {
035                    return type;
036            }
037    
038            /**
039             * @see railo.runtime.spooler.SpoolerTask#subject()
040             */
041            public String subject() {
042                    return action+" ("+super.subject()+")";
043            }
044            /**
045             * @see railo.runtime.spooler.SpoolerTask#detail()
046             */
047            public Struct detail() {
048                    Struct sct=super.detail();
049                    sct.setEL("action", action);
050                    return sct;
051            }
052            
053    
054            /**
055             * @see railo.runtime.spooler.SpoolerTaskWS#getMethodName()
056             */
057            protected String getMethodName() {
058                    return "invoke";
059            }
060            
061            /**
062             * @see railo.runtime.spooler.SpoolerTaskWS#getArguments()
063             */
064            protected Struct getArguments() {
065                    return args;
066            }
067    }