View Javadoc

1   /*
2   Copyright 2011-2014 AGH-UST, http://www.agh.edu.pl
3   Faculty of Computer Science, Electronics and Telecommunications
4   Department of Computer Science 
5   
6   See the NOTICE file distributed with this work for additional
7   information regarding copyright ownership
8   
9   Licensed under the Apache License, Version 2.0 (the "License");
10  you may not use this file except in compliance with the License.
11  You may obtain a copy of the License at
12  
13    http://www.apache.org/licenses/LICENSE-2.0
14  
15  Unless required by applicable law or agreed to in writing, software
16  distributed under the License is distributed on an "AS IS" BASIS,
17  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  See the License for the specific language governing permissions and
19  limitations under the License.
20  */
21  package org.universAAL.ri.gateway.eimanager.impl.exporting;
22  
23  import java.io.Serializable;
24  
25  public class ProxyRegistration implements Serializable{
26      
27      /**
28       * 
29       */
30      private static final long serialVersionUID = 7598585122564189371L;
31      private String id;
32      private Object returnedValues;
33      private boolean success;
34      private String errorMessage;
35      
36      public ProxyRegistration(final String id, final Object returnedValues) {
37  	super();
38  	this.id = id;
39  	this.returnedValues = returnedValues;
40  	this.success = true;
41  	this.errorMessage = "";
42      }
43  
44      public ProxyRegistration(String errorMessage){
45      	this.id = "";
46      	this.returnedValues = "";
47      	this.success = false;
48      	this.errorMessage = errorMessage;
49      }
50      
51      public String getId() {
52  	return id;
53      }
54  
55      public void setId(final String id) {
56  	this.id = id;
57      }
58  
59      public Object getReturnedValues() {
60  	return returnedValues;
61      }
62  
63      public void setReturnedValues(final Object returnedValues) {
64  	this.returnedValues = returnedValues;
65      }
66      
67      @Override
68      public String toString() {
69  	return String.format("Proxy: id: %s, returns: %s", id, returnedValues);
70      }
71  
72  	public boolean isSuccess() {
73  		return success;
74  	}
75  
76  	public void setSuccess(boolean success) {
77  		this.success = success;
78  	}
79  
80  	public String getErrorMessage() {
81  		return errorMessage;
82  	}
83  
84  	public void setErrorMessage(String errorMessage) {
85  		this.errorMessage = errorMessage;
86  	}
87      
88  }