Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4Java)  1.26.2
Security.java
Go to the documentation of this file.
1 // -----------------------------------------------------------------------
2 // MLPI - <Security.java>
3 // -----------------------------------------------------------------------
4 // Copyright (c) 2012 Bosch Rexroth. All rights reserved.
5 // Redistribution and use in source and binary forms of this MLPI software
6 // (SW) provided to you, with or without modification, are permitted
7 // without prior approval provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code of SW must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form of SW must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // 3. User recognizes and acknowledges that it acquires no right,
17 // title or interest in or to any of the names or trademarks used in
18 // connection with the SW ("names") by virtue of this License and waives
19 // any right to or interest in the names. User recognizes and acknowledges
20 // that names of companies or names or products of companies displayed
21 // in the documentation of SW to indicate the interoperability of products
22 // with the SW are the names of their respective owners. The use of such
23 // names in the documentation of SW does not imply any sponsorship,
24 // approval, or endorsement by such companies of this product.
25 //
26 // 4. Modified code versions, i.e. any addition to or deletion from
27 // the substance or structure of the original code of the SW running
28 // the MLPI must be plainly marked as such and must not be misrepresented
29 // as being original SW.
30 //
31 // 5. The SW may only be used in connection with a Bosch Rexroth product.
32 //
33 // THIS INFORMATION IS PROVIDED BY BOSCH REXROTH CORPORATION "AS IS"
34 // AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING
35 // (BUT NOTLIMITED TO) ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
36 // FITNESS FOR ANY PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WHILE THE
37 // INFORMATION PROVIDED IS BELIEVED TO BE ACCURATE, IT MAY INCLUDE
38 // ERRORS OR INACCURACIES.
39 // SUBJECT TO COMPULSORY STATUTORY PROVISIONS OF THE GERMAN LAW AS
40 // THE APPLICABLE LAW FOR THIS LICENSE BOSCH REXROTH CORPORATION WILL
41 // NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF
42 // THE SOFTWARE DISTRIBUTED HEREUNDER, INCLUDING BUT NOT LIMITED TO
43 // DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES.
44 // -----------------------------------------------------------------------
45 //
55 //
56 // -----------------------------------------------------------------------
57 package com.boschrexroth.mlpi;
58 
59 public class Security extends MlpiComponent {
60  /*
61  * Constants
62  */
65  public static final int SECURIY_NETWORKSERVICE_MAX_NAME_LEN = 16;
66  public static final int SECURIY_MAX_NETWORKSERVICES = 16;
67  public static final int SECURITY_NETWORKCONFIGVALUE_MAX_NAME_LEN = 32;
68  public static final int SECURITY_NETWORKCONFIGVALUE_MAX_VALUE_LEN = 128;
69  public static final String SECURITY_NETWORKSERVICE_FTP = "FTP";
70  public static final String SECURITY_NETWORKSERVICE_SSH = "SSH";
71  public static final String SECURITY_NETWORKSERVICE_MLPI = "MLPI";
72  public static final String SECURITY_NETWORKSERVICE_MLPIS = "MLPIS";
73  public static final String SECURITY_NETWORKSERVICE_OPCUA = "OPCUA";
74 
75  /*
76  * Enums
77  */
87  public static enum NetworkServiceState {
88  MLPI_SECURITY_SERVICE_DISABLED(0),
89  MLPI_SECURITY_SERVICE_ENABLED(1);
90 
91  private int _code;
92  int getCode() { return _code; }
93  NetworkServiceState(int code) { this._code = code; }
94  static NetworkServiceState valueOf(int code) {
95  for (NetworkServiceState value : values()) {
96  if (code == value.getCode()) return value;
97  }
98  return null;
99  }
100  };
112  public static enum NetworkServiceControl {
113  MLPI_SECURITY_SERVICE_NOTCHANGEABLE (0x0000),
114  MLPI_SECURITY_SERVICE_ACTIVATABLE (0x0001),
115  MLPI_SECURITY_SERVICE_DEACTIVATABLE (0x0002),
116  MLPI_SECURITY_SERVICE_CHANGEABLE (0x0003);
117 
118  private int _code;
119  int getCode() { return _code; }
120  NetworkServiceControl(int code) { this._code = code; }
121  static NetworkServiceControl valueOf(int code) {
122  for (NetworkServiceControl value : values()) {
123  if (code == value.getCode()) return value;
124  }
125  return null;
126  }
127  };
128 
129  /*
130  * Structs
131  */
132 
144  public static class NetworkServiceInfo {
145  public String networkServiceName;
146  public NetworkServiceState networkServiceState;
147  public NetworkServiceControl networkServiceControl;
148  }
149 
160  public static class NetworkConfigurationValue {
161  public String name;
162  public String value;
163  }
164 
165  /*
166  * Methods
167  */
168 
172  Security(MlpiHandle connection) {
173  super(connection);
174  }
175 
182  public native NetworkServiceInfo[] getNetworkServiceInformation();
183 
187  @Deprecated
188  public NetworkServiceInfo[] GetNetworkServiceInformation() {
189  return getNetworkServiceInformation();
190  }
191 
199  public native NetworkServiceState getNetworkServiceActivation(String service);
200 
204  @Deprecated
205  public NetworkServiceState GetNetworkServiceActivation(String service) {
206  return getNetworkServiceActivation(service);
207  }
208 
217  public native void setNetworkServiceActivation(String service, NetworkServiceState state);
218 
222  @Deprecated
223  public void SetNetworkServiceActivation(String service, NetworkServiceState state) {
224  setNetworkServiceActivation(service, state);
225  }
226 
234  public native NetworkConfigurationValue[] getNetworkServiceConfiguration(String service);
235 
239  @Deprecated
240  public NetworkConfigurationValue[] GetNetworkServiceConfiguration(String service) {
241  return getNetworkServiceConfiguration(service);
242  }
243 
251  public native void setNetworkServiceConfiguration(String service, NetworkConfigurationValue[] configuration);
252 
256  @Deprecated
257  public void SetNetworkServiceConfiguration(String service, NetworkConfigurationValue[] configuration) {
258  setNetworkServiceConfiguration(service, configuration);
259  }
260 }
This enumeration describes the control possibilities of an specific network service.
Definition: Security.java:112
This enumeration defines the state of an network service on the control.
Definition: Security.java:87
This class is used for deploying inforations about an network service.
Definition: Security.java:144