Result.java
001 /*
002  *
003  * Licensed to the Apache Software Foundation (ASF) under one
004  * or more contributor license agreements.  See the NOTICE file
005  * distributed with this work for additional information
006  * regarding copyright ownership.  The ASF licenses this file
007  * to you under the Apache License, Version 2.0 (the
008  * "License"); you may not use this file except in compliance
009  * with the License.  You may obtain a copy of the License at
010  *
011  *   http://www.apache.org/licenses/LICENSE-2.0
012  *
013  * Unless required by applicable law or agreed to in writing,
014  * software distributed under the License is distributed on an
015  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016  * KIND, either express or implied.  See the License for the
017  * specific language governing permissions and limitations
018  * under the License.
019  *
020  */
021 package org.apache.qpid.management.wsdm.capabilities;
022 
023 import java.util.*;
024 
025 /**
026  * Data Transfer Object that encapsulates the result of a method invocation.
027  * This is the object that will be marshalled in XML and will contain the result of a method 
028  * invocation (status code & text).
029  
030  @author Andrea Gazzarini
031  */
032 public class Result
033 {
034   private long _statusCode;
035   private String _statusText;
036   private Map<String,Object> _outputParameters;
037   
038   /**
039    * Builds a new result DTO with the given parameters.
040    
041    @param statusCode the return code.
042    @param statusText the status message.
043    @param outputParameters the output parameters.
044    */
045   public Result(long statusCode, String statusText,Map<String, Object> outputParameters)
046   {
047     this._statusCode = statusCode;
048     this._statusText = statusText;
049     this._outputParameters = outputParameters;
050   }
051   
052   /**
053    * Returns the status code.
054    
055    @return the status code.
056    */
057   public long getStatusCode()
058   {
059     return _statusCode;
060   }
061   
062   /**
063    * Sets the status code.
064    
065    @param statusCode the status code.
066    */
067   void setStatusCode(long statusCode)
068   {
069     this._statusCode = statusCode;
070   }
071   
072   /**
073    * Returns the status text.
074    
075    @return the status text.
076    */
077   public String getStatusText()
078   {
079     return _statusText;
080   }
081   
082   /**
083    * Sets the status text.
084    
085    @param statusText the status text.
086    */
087   void setStatusText(String statusText)
088   {
089     this._statusText = statusText;
090   }
091   
092   /**
093    * Returns the output parameterss.
094    
095    @return the output parameterss.
096    */
097   public Map<String, Object> getOutputParameters()
098   {
099     return _outputParameters;
100   }
101   
102   /**
103    * Sets the output parameters.
104    
105    @param outputParameters the output parameters.
106    */
107   void setOutputParameters(Map<String, Object> outputParameters)
108   {
109     this._outputParameters = outputParameters;
110   }
111 }